Comparing version 6.4.0 to 6.4.1
@@ -7,3 +7,3 @@ import { RuntypeBase } from './runtype'; | ||
[key in keyof A]: A[key] extends PairCase<any, infer Z> ? Z : unknown; | ||
}>; | ||
}[number]>; | ||
export declare type PairCase<A extends RuntypeBase, Z> = [A, Case<A, Z>]; |
import { Runtype, RuntypeBase, Static } from '../runtype'; | ||
import { Optional } from './optional'; | ||
declare type DictionaryKeyType = string | number | symbol; | ||
declare type StringLiteralFor<K extends DictionaryKeyType> = K extends string ? 'string' : K extends number ? 'number' : K extends symbol ? 'symbol' : never; | ||
declare type DictionaryKeyRuntype = RuntypeBase<string | number | symbol>; | ||
export interface Dictionary<V extends RuntypeBase, K extends DictionaryKeyType> extends Runtype<{ | ||
export interface Dictionary<V extends RuntypeBase, K extends DictionaryKeyType> extends Runtype<V extends Optional<any> ? { | ||
[_ in K]?: Static<V>; | ||
} : { | ||
[_ in K]: Static<V>; | ||
@@ -12,4 +15,6 @@ }> { | ||
} | ||
export interface StringDictionary<V extends RuntypeBase> extends Runtype<{ | ||
[_: string]: Static<V>; | ||
export interface StringDictionary<V extends RuntypeBase> extends Runtype<V extends Optional<any> ? { | ||
[_ in string]?: Static<V>; | ||
} : { | ||
[_ in string]: Static<V>; | ||
}> { | ||
@@ -20,4 +25,6 @@ tag: 'dictionary'; | ||
} | ||
export interface NumberDictionary<V extends RuntypeBase> extends Runtype<{ | ||
[_: number]: Static<V>; | ||
export interface NumberDictionary<V extends RuntypeBase> extends Runtype<V extends Optional<any> ? { | ||
[_ in number]?: Static<V>; | ||
} : { | ||
[_ in number]: Static<V>; | ||
}> { | ||
@@ -24,0 +31,0 @@ tag: 'dictionary'; |
{ | ||
"name": "runtypes", | ||
"version": "6.4.0", | ||
"version": "6.4.1", | ||
"description": "Runtime validation for static types", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
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
120458
2508