schemastery
Advanced tools
Comparing version 3.8.1 to 3.9.0
@@ -6,7 +6,7 @@ import { Dict } from 'cosmokit'; | ||
type From<X> = X extends string | number | boolean ? Schema<X> : X extends Schema ? X : X extends typeof String ? Schema<string> : X extends typeof Number ? Schema<number> : X extends typeof Boolean ? Schema<boolean> : X extends typeof Function ? Schema<Function, (...args: any[]) => any> : X extends Constructor<infer S> ? Schema<S> : never; | ||
type _TypeS<X> = X extends Schema<infer S, unknown> ? S : never; | ||
type TypeS1<X> = X extends Schema<infer S, unknown> ? S : never; | ||
type Inverse<X> = X extends Schema<any, infer Y> ? (arg: Y) => void : never; | ||
type TypeS<X> = _TypeS<From<X>>; | ||
type TypeS<X> = TypeS1<From<X>>; | ||
type TypeT<X> = ReturnType<From<X>>; | ||
type Resolve = (data: any, schema: Schema, strict?: boolean) => [any, any?]; | ||
type Resolve = (data: any, schema: Schema, options?: Options, strict?: boolean) => [any, any?]; | ||
type IntersectS<X> = From<X> extends Schema<infer S, unknown> ? S : never; | ||
@@ -50,2 +50,5 @@ type IntersectT<X> = Inverse<From<X>> extends ((arg: infer T) => void) ? T : never; | ||
} | ||
interface Options { | ||
autofix?: boolean; | ||
} | ||
} | ||
@@ -89,4 +92,4 @@ } | ||
interface Schema<S = any, T = S> extends Schema.Base<T> { | ||
(data?: S | null): T; | ||
new (data?: S | null): T; | ||
(data?: S | null, options?: Schemastery.Options): T; | ||
new (data?: S | null, options?: Schemastery.Options): T; | ||
[kSchema]: true; | ||
@@ -93,0 +96,0 @@ toJSON(): Schema.Base<T>; |
{ | ||
"name": "schemastery", | ||
"description": "Type driven schema validator", | ||
"version": "3.8.1", | ||
"version": "3.9.0", | ||
"main": "lib/index.cjs", | ||
@@ -6,0 +6,0 @@ "module": "lib/index.mjs", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
117098
1077