@contember/typesafe
Advanced tools
Comparing version 1.3.0-alpha.13 to 1.3.0-beta.1
@@ -1,7 +0,7 @@ | ||
declare type Unpacked<T> = T extends readonly (infer U)[] ? U : never; | ||
export declare type JsonObject = { | ||
type Unpacked<T> = T extends readonly (infer U)[] ? U : never; | ||
export type JsonObject = { | ||
readonly [P in string]?: Json; | ||
}; | ||
export declare type Scalar = string | number | boolean | null; | ||
export declare type Json = Scalar | readonly Json[] | JsonObject; | ||
export type Scalar = string | number | boolean | null; | ||
export type Json = Scalar | readonly Json[] | JsonObject; | ||
export interface Type<T extends Json | { | ||
@@ -45,5 +45,5 @@ readonly [K in string]?: Json; | ||
}>(field: F, inner: { [K in keyof T]: Type<T[K]>; }) => Type<{ [K_1 in keyof T]: { [X in F]: K_1; } & T[K_1]; }[keyof T]>; | ||
declare type TupleFromTupledType<T extends Type<Json>[]> = T extends [Type<infer X>, ...infer Y] ? (Y extends Type<Json>[] ? readonly [X, ...TupleFromTupledType<Y>] : readonly []) : readonly []; | ||
type TupleFromTupledType<T extends Type<Json>[]> = T extends [Type<infer X>, ...infer Y] ? (Y extends Type<Json>[] ? readonly [X, ...TupleFromTupledType<Y>] : readonly []) : readonly []; | ||
export declare const tuple: <T extends Type<Json>[]>(...inner: T) => Type<TupleFromTupledType<T>>; | ||
declare type DiscriminatedTupleUnionType<T extends Record<string, Type<Json>[]>> = { | ||
type DiscriminatedTupleUnionType<T extends Record<string, Type<Json>[]>> = { | ||
[K in keyof T]: (readonly [K, ...TupleFromTupledType<T[K]>]); | ||
@@ -62,7 +62,7 @@ }[keyof T & string]; | ||
export declare const valueAt: (input: any, path: PropertyKey[]) => unknown | undefined; | ||
declare type EqualsWrapped<T> = T extends infer R & {} ? { | ||
type EqualsWrapped<T> = T extends infer R & {} ? { | ||
[P in keyof R]: R[P]; | ||
} : never; | ||
export declare type Equals<A, B> = (<T>() => T extends EqualsWrapped<A> ? 1 : 2) extends <T>() => T extends EqualsWrapped<B> ? 1 : 2 ? true : false; | ||
export type Equals<A, B> = (<T>() => T extends EqualsWrapped<A> ? 1 : 2) extends <T>() => T extends EqualsWrapped<B> ? 1 : 2 ? true : false; | ||
export {}; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -258,3 +258,3 @@ "use strict"; | ||
const { [field]: _, ...inputWithoutDiscr } = input; | ||
return { [field]: key, ...discriminatedType(inputWithoutDiscr) }; | ||
return { [field]: key, ...discriminatedType(inputWithoutDiscr, path) }; | ||
}; | ||
@@ -261,0 +261,0 @@ type.inner = inner; |
{ | ||
"name": "@contember/typesafe", | ||
"version": "1.3.0-alpha.13", | ||
"version": "1.3.0-beta.1", | ||
"license": "Apache-2.0", | ||
@@ -5,0 +5,0 @@ "main": "dist/src/index.js", |
@@ -291,3 +291,3 @@ type Unpacked<T> = T extends readonly (infer U)[] ? U : never | ||
return { [field]: key, ...discriminatedType(inputWithoutDiscr) } | ||
return { [field]: key, ...discriminatedType(inputWithoutDiscr, path) } | ||
@@ -294,0 +294,0 @@ } |
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
84907