`string.integer.parsed` with limits
I need a simple port number,
1 < integer < 9999
Hovewer, I want to parse it from env string
so I need string.integer.parse
How do I make the limited parsed integer?26 Replies
(this doesn't work)
WIW is
So what is your issue?
t.in
is a Type, not an inferred output
It's t.infer
like it has always been🤔 what was my issue again
This
2.0.0-rc.6
what is the error on T?
Oh just that it's unused?
.....
Waitaminute
Lemme unupdate back
I can't repro it
I can't repron't it
Researching...
I mean that type doesn't make any sense it's like it's not even trying to infer anything
Okay this was tsconfig
looking what exactly
I have tested it with only
strictNullChecks
in tsconfig and it works
So I guess you have some resolution setting that is actively breaking itOkay it was
"moduleResolution": "node",
But that should work I thought?
Isn't that the default
I know there was a problem with node resolution in a previous build so I added tests for default settings and people said their node resolution was fixed
Okay here's repro
Why do I even have that
lib: esnext
there (╯°□°)╯︵ ┻━┻Why does that break it though blah
https://github.com/microsoft/TypeScript/blob/main/src/lib/esnext.d.ts well maybe some of those
GitHub
TypeScript/src/lib/esnext.d.ts at main · microsoft/TypeScript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output. - microsoft/TypeScript
Dunno it still works fine for me with that enabled
okay idk see you tomorrow (╯°□°)╯︵ ┻━┻
Me don't like this
Why can't I just
'string.integer.parse > 0'
Or at least ['string.integer.parse', '=>', 'number.integer > 0']
Or at least ['string.integer.parse', '=>', type('number.integer > 0')]
You can use
.to
when piping to another type then pass the definition deirectlyCan what?
Wtf is your type
.to
is only available on morphs which string.integer.parse
is but it's clearly not being inferred correctlythat 💩 magic that doesn't allow me to use stuff! It come again! (╯°□°)╯︵ ┻━┻
okay idk see you tomorrow (╯°□°)╯︵ ┻━┻
Okay I've kleaned up my node_modules and it now work
Try that first next time your env is always doing weird shit🤣