We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Hi there,
Thanks for the great library. I just ran into an issue with a trick I use to specify a non empty list in typescript:
export type Item = string; export type NonEmptyArray = [Item, ...Item[]];
ts-auto-guard generates:
ts-auto-guard
/* * Generated type guards for "nonempty.ts". * WARNING: Do not manually change this file. */ import { NonEmptyArray } from "./nonempty"; export function isNonEmptyArray(obj: unknown): obj is NonEmptyArray { const typedObj = obj as NonEmptyArray return ( Array.isArray(typedObj) && typeof typedObj[0] === "string" && typeof typedObj[1] === "string" ) }
Which means it's expecting an Array of 2 elements. I suppose that the rest elements in tuple types is not implemented ?
The text was updated successfully, but these errors were encountered:
@jmatsushita not that I'm aware of. You're welcome to have a go!
Sorry, something went wrong.
No branches or pull requests
Hi there,
Thanks for the great library. I just ran into an issue with a trick I use to specify a non empty list in typescript:
ts-auto-guard
generates:Which means it's expecting an Array of 2 elements. I suppose that the rest elements in tuple types is not implemented ?
The text was updated successfully, but these errors were encountered: