UNPKG

@frauschert/ts-guard

Version:

ts-guard is a typescript library that provides composable type guards. Its inspired by zod but focusses only on type guards and is more lightweight.

3 lines 144 B
export type Guard<T> = (x: unknown) => x is T; export type TypeOf<T> = T extends Guard<infer U> ? U : never; //# sourceMappingURL=types.d.ts.map