Comparing version 5.1.1-canary-2 to 5.1.1-canary-3
@@ -55,3 +55,7 @@ declare function Arr<TElement extends RuntypeBase<unknown>>(element: TElement): Arr<TElement>; | ||
declare type Case<T extends RuntypeBase<unknown>, Result> = (v: Static<T>) => Result; | ||
/** | ||
* This is an internal type that should not be referenced directly from outside of the funtypes package. | ||
* @internal | ||
*/ | ||
export declare type Case<T extends RuntypeBase<unknown>, Result> = (v: Static<T>) => Result; | ||
@@ -95,3 +99,7 @@ export declare interface Codec<TParsed> extends Runtype<TParsed> { | ||
declare interface Constructor<V> { | ||
/** | ||
* This is an internal type that should not be referenced directly from outside of the funtypes package. | ||
* @internal | ||
*/ | ||
export declare interface Constructor<V> { | ||
new (...args: any[]): V; | ||
@@ -111,3 +119,7 @@ } | ||
declare type Cycle<T> = { | ||
/** | ||
* This is an internal type that should not be referenced directly from outside of the funtypes package. | ||
* @internal | ||
*/ | ||
export declare interface Cycle<T> { | ||
success: true; | ||
@@ -117,3 +129,3 @@ cycle: true; | ||
unwrap: () => Result<T>; | ||
}; | ||
} | ||
@@ -150,3 +162,7 @@ export declare function Enum<TEnum extends { | ||
declare type FullError = [string, ...FullError[]]; | ||
/** | ||
* This is an internal type that should not be referenced directly from outside of the funtypes package. | ||
* @internal | ||
*/ | ||
export declare type FullError = [string, ...FullError[]]; | ||
@@ -180,3 +196,7 @@ declare interface Function_2 extends Codec<(...args: any[]) => any> { | ||
declare interface InternalRecord<O extends RecordFields, IsPartial extends boolean, IsReadonly extends boolean> extends Codec<RecordStaticType<O, IsPartial, IsReadonly>> { | ||
/** | ||
* This is an internal type that should not be referenced directly from outside of the funtypes package. | ||
* @internal | ||
*/ | ||
export declare interface InternalRecord<O extends RecordFields, IsPartial extends boolean, IsReadonly extends boolean> extends Codec<RecordStaticType<O, IsPartial, IsReadonly>> { | ||
readonly tag: 'object'; | ||
@@ -194,3 +214,7 @@ readonly fields: O; | ||
declare interface InternalValidation<TParsed> { | ||
/** | ||
* This is an internal type that should not be referenced directly from outside of the funtypes package. | ||
* @internal | ||
*/ | ||
export declare interface InternalValidation<TParsed> { | ||
/** | ||
@@ -237,5 +261,13 @@ * parse | ||
declare type KeyRuntypeBase = KeyRuntypeBaseWithoutUnion | Pick<Union<KeyRuntypeBaseWithoutUnion[]>, 'alternatives' | keyof RuntypeBase>; | ||
/** | ||
* This is an internal type that should not be referenced directly from outside of the funtypes package. | ||
* @internal | ||
*/ | ||
export declare type KeyRuntypeBase = KeyRuntypeBaseWithoutUnion | Pick<Union<KeyRuntypeBaseWithoutUnion[]>, 'alternatives' | keyof RuntypeBase>; | ||
declare type KeyRuntypeBaseWithoutUnion = Pick<String_2, keyof RuntypeBase> | Pick<Number_2, keyof RuntypeBase> | Pick<Literal<string | number>, 'value' | keyof RuntypeBase> | Pick<Constraint<KeyRuntypeBase, string | number>, 'underlying' | keyof RuntypeBase>; | ||
/** | ||
* This is an internal type that should not be referenced directly from outside of the funtypes package. | ||
* @internal | ||
*/ | ||
export declare type KeyRuntypeBaseWithoutUnion = Pick<String_2, keyof RuntypeBase> | Pick<Number_2, keyof RuntypeBase> | Pick<Literal<string | number>, 'value' | keyof RuntypeBase> | Pick<Constraint<KeyRuntypeBase, string | number>, 'underlying' | keyof RuntypeBase>; | ||
@@ -267,3 +299,7 @@ /** | ||
declare interface Match<A extends readonly RuntypeBase<unknown>[]> { | ||
/** | ||
* This is an internal type that should not be referenced directly from outside of the funtypes package. | ||
* @internal | ||
*/ | ||
export declare interface Match<A extends readonly RuntypeBase<unknown>[]> { | ||
<Z>(...a: { | ||
@@ -274,3 +310,7 @@ [key in keyof A]: A[key] extends RuntypeBase<unknown> ? Case<A[key], Z> : never; | ||
declare type Matcher<A extends readonly RuntypeBase<unknown>[], Z> = (x: { | ||
/** | ||
* This is an internal type that should not be referenced directly from outside of the funtypes package. | ||
* @internal | ||
*/ | ||
export declare type Matcher<A extends readonly RuntypeBase<unknown>[], Z> = (x: { | ||
[key in keyof A]: A[key] extends RuntypeBase<infer Type> ? Type : unknown; | ||
@@ -289,2 +329,10 @@ }[number]) => Z; | ||
/** | ||
* This is an internal type that should not be referenced directly from outside of the funtypes package. | ||
* @internal | ||
*/ | ||
export declare type MutableRecordStaticType<O extends RecordFields> = { | ||
-readonly [K in keyof O]: Static<O[K]>; | ||
}; | ||
export declare function Named<TUnderlying extends RuntypeBase<unknown>>(name: string, underlying: TUnderlying): Named<TUnderlying>; | ||
@@ -336,3 +384,7 @@ | ||
declare interface ParsedValueConfig<TUnderlying extends RuntypeBase<unknown>, TParsed> { | ||
/** | ||
* This is an internal type that should not be referenced directly from outside of the funtypes package. | ||
* @internal | ||
*/ | ||
export declare interface ParsedValueConfig<TUnderlying extends RuntypeBase<unknown>, TParsed> { | ||
name?: string; | ||
@@ -350,2 +402,18 @@ parse: (value: Static<TUnderlying>) => Result<TParsed>; | ||
/** | ||
* This is an internal type that should not be referenced directly from outside of the funtypes package. | ||
* @internal | ||
*/ | ||
export declare type PartialMutableRecordStaticType<O extends RecordFields> = { | ||
-readonly [K in keyof O]?: Static<O[K]>; | ||
}; | ||
/** | ||
* This is an internal type that should not be referenced directly from outside of the funtypes package. | ||
* @internal | ||
*/ | ||
export declare type PartialReadonlyRecordStaticType<O extends RecordFields> = { | ||
readonly [K in keyof O]?: Static<O[K]>; | ||
}; | ||
declare function Readonly_2<TFields extends RecordFields, TPartial extends boolean>(input: InternalRecord<TFields, TPartial, false>): InternalRecord<TFields, TPartial, true>; | ||
@@ -386,3 +454,15 @@ | ||
declare type ReadonlyStaticTuple<TElements extends readonly RuntypeBase<unknown>[]> = { | ||
/** | ||
* This is an internal type that should not be referenced directly from outside of the funtypes package. | ||
* @internal | ||
*/ | ||
export declare type ReadonlyRecordStaticType<O extends RecordFields> = { | ||
readonly [K in keyof O]: Static<O[K]>; | ||
}; | ||
/** | ||
* This is an internal type that should not be referenced directly from outside of the funtypes package. | ||
* @internal | ||
*/ | ||
export declare type ReadonlyStaticTuple<TElements extends readonly RuntypeBase<unknown>[]> = { | ||
readonly [key in keyof TElements]: TElements[key] extends RuntypeBase<infer E> ? E : unknown; | ||
@@ -415,15 +495,15 @@ }; | ||
declare type RecordFields = { | ||
/** | ||
* This is an internal type that should not be referenced directly from outside of the funtypes package. | ||
* @internal | ||
*/ | ||
export declare type RecordFields = { | ||
readonly [_: string]: RuntypeBase<unknown>; | ||
}; | ||
declare type RecordStaticType<O extends RecordFields, IsPartial extends boolean, IsReadonly extends boolean> = IsPartial extends false ? IsReadonly extends false ? { | ||
-readonly [K in keyof O]: Static<O[K]>; | ||
} : { | ||
readonly [K in keyof O]: Static<O[K]>; | ||
} : IsReadonly extends false ? { | ||
-readonly [K in keyof O]?: Static<O[K]>; | ||
} : { | ||
readonly [K in keyof O]?: Static<O[K]>; | ||
}; | ||
/** | ||
* This is an internal type that should not be referenced directly from outside of the funtypes package. | ||
* @internal | ||
*/ | ||
export declare type RecordStaticType<O extends RecordFields, IsPartial extends boolean, IsReadonly extends boolean> = IsPartial extends false ? IsReadonly extends false ? MutableRecordStaticType<O> : ReadonlyRecordStaticType<O> : IsReadonly extends false ? PartialMutableRecordStaticType<O> : PartialReadonlyRecordStaticType<O>; | ||
@@ -435,3 +515,7 @@ /** | ||
declare type ResultWithCycle<T> = (Result<T> & { | ||
/** | ||
* This is an internal type that should not be referenced directly from outside of the funtypes package. | ||
* @internal | ||
*/ | ||
export declare type ResultWithCycle<T> = (Result<T> & { | ||
cycle?: false; | ||
@@ -501,3 +585,3 @@ }) | Cycle<T>; | ||
*/ | ||
declare interface RuntypeBase<TParsed = unknown> { | ||
export declare interface RuntypeBase<TParsed = unknown> { | ||
readonly tag: string; | ||
@@ -547,7 +631,15 @@ /** | ||
declare interface SealedConfig { | ||
/** | ||
* This is an internal type that should not be referenced directly from outside of the funtypes package. | ||
* @internal | ||
*/ | ||
export declare interface SealedConfig { | ||
readonly deep?: boolean; | ||
} | ||
declare type SealedState = { | ||
/** | ||
* This is an internal type that should not be referenced directly from outside of the funtypes package. | ||
* @internal | ||
*/ | ||
export declare type SealedState = { | ||
readonly keysFromIntersect?: ReadonlySet<string>; | ||
@@ -568,11 +660,23 @@ readonly deep: boolean; | ||
declare type StaticIntersect<TIntersectees extends readonly RuntypeBase<unknown>[]> = { | ||
/** | ||
* This is an internal type that should not be referenced directly from outside of the funtypes package. | ||
* @internal | ||
*/ | ||
export declare type StaticIntersect<TIntersectees extends readonly RuntypeBase<unknown>[]> = { | ||
[key in keyof TIntersectees]: TIntersectees[key] extends RuntypeBase ? (parameter: Static<TIntersectees[key]>) => any : unknown; | ||
}[number] extends (k: infer I) => void ? I : never; | ||
declare type StaticTuple<TElements extends readonly RuntypeBase<unknown>[]> = { | ||
/** | ||
* This is an internal type that should not be referenced directly from outside of the funtypes package. | ||
* @internal | ||
*/ | ||
export declare type StaticTuple<TElements extends readonly RuntypeBase<unknown>[]> = { | ||
[key in keyof TElements]: TElements[key] extends RuntypeBase<infer E> ? E : unknown; | ||
}; | ||
declare type StaticUnion<TAlternatives extends readonly RuntypeBase<unknown>[]> = { | ||
/** | ||
* This is an internal type that should not be referenced directly from outside of the funtypes package. | ||
* @internal | ||
*/ | ||
export declare type StaticUnion<TAlternatives extends readonly RuntypeBase<unknown>[]> = { | ||
[key in keyof TAlternatives]: TAlternatives[key] extends RuntypeBase<unknown> ? Static<TAlternatives[key]> : unknown; | ||
@@ -621,2 +725,3 @@ }[number]; | ||
Runtype, | ||
RuntypeBase, | ||
Codec, | ||
@@ -623,0 +728,0 @@ Static, |
@@ -43,2 +43,3 @@ export { | ||
Runtype, | ||
RuntypeBase, | ||
Sealed, | ||
@@ -45,0 +46,0 @@ Static, |
{ | ||
"name": "funtypes", | ||
"version": "5.1.1-canary-2", | ||
"version": "5.1.1-canary-3", | ||
"description": "Runtime validation for static types", | ||
@@ -8,2 +8,11 @@ "main": "./lib/index.js", | ||
"types": "./lib/index.d.ts", | ||
"files": [ | ||
"lib/index.js", | ||
"lib/index.d.ts", | ||
"lib/index.mjs", | ||
"lib/readonly.js", | ||
"lib/readonly.d.ts", | ||
"lib/readonly.mjs", | ||
"readonly/package.json" | ||
], | ||
"sideEffects": false, | ||
@@ -10,0 +19,0 @@ "exports": { |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
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
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
0
1
109046
10
3015