Shiba
Shiba
@mattpocock Found a better solution that returns less complex type for `Unarray` test. ```ts interface ArrayConstructor { // @ts-ignore isArray(arg: T[] extends T ? T | T[] : never): arg...
i mean first solution was passing the tests, down side was. On this test: ```ts doNotExecute(() => { function test(value: T) { type Unarray = T extends Array ? U...
@mattpocock Wasn't expecting to solve it this quick. Got rid of `@ts-ignore` Current behavior: Input => Result - any => any[] - any[] => any[] - unknown => unknown[] -...
@mjxl This PR is for narrowing the type correctly. Not for returning true or false, based on argument type. But, if you ask me if the type of the argument...
Although Matt told me to open this PR, I don't think this is gonna get merged, it has been months. I don't wanna deal with this PR anymore. So closing...
@russelldavis > ```ts > const colors = new Set(['red', 'blue'] as const); > const inputColor = 'red' as 'red' | 'blue' | 'green' > if (!colors.has(inputColor)) { > inputColor //...
@russelldavis Oh alright, this makes sense now. `Set` accepts `"red" | "blue"` but empty, which makes the type to be wrong, true.
```ts doNotExecute(async () => { function makeArray(input: Item) { if (Array.isArray(input)) { return input; } return [input]; } const [first] = makeArray([{ a: "1" }, { a: "2" }, {...
Did a PR: https://github.com/Sheraff/ts-reset/pull/1 This will return undefined regardless if `strictNullChecks` is `true` or `false`. But this is already the behaviour of native `ReadonlyArray` `.at()`. As seen here: ```ts interface...
I need to list the enums so I need access the values. And also on build I get this warning or message:`transforming (25) node_modules/@prisma/client/index-browser.js'.prisma/client/index-browser' is imported by .prisma/client/index-browser?commonjs-external, but could...