Comparing version 0.2.1 to 0.2.2
@@ -143,2 +143,32 @@ /** | ||
/** | ||
* Construct an intersection runtype from runtypes for its alternatives. | ||
*/ | ||
export declare function Intersect(): Runtype<never>; | ||
export declare function Intersect<A>(a: Runtype<A>): Runtype<A>; | ||
export declare function Intersect<A, B>(a: Runtype<A>, b: Runtype<B>): Runtype<A & B>; | ||
export declare function Intersect<A, B, C>(a: Runtype<A>, b: Runtype<B>, c: Runtype<C>): Runtype<A & B & C>; | ||
export declare function Intersect<A, B, C, D>(a: Runtype<A>, b: Runtype<B>, c: Runtype<C>, d: Runtype<D>): Runtype<A & B & C & D>; | ||
export declare function Intersect<A, B, C, D, E>(a: Runtype<A>, b: Runtype<B>, c: Runtype<C>, d: Runtype<D>, e: Runtype<E>): Runtype<A & B & C & D & E>; | ||
export declare function Intersect<A, B, C, D, E, F>(a: Runtype<A>, b: Runtype<B>, c: Runtype<C>, d: Runtype<D>, e: Runtype<E>, f: Runtype<F>): Runtype<A & B & C & D & E & F>; | ||
export declare function Intersect<A, B, C, D, E, F, G>(a: Runtype<A>, b: Runtype<B>, c: Runtype<C>, d: Runtype<D>, e: Runtype<E>, f: Runtype<F>, g: Runtype<G>): Runtype<A & B & C & D & E & F & G>; | ||
export declare function Intersect<A, B, C, D, E, F, G, H>(a: Runtype<A>, b: Runtype<B>, c: Runtype<C>, d: Runtype<D>, e: Runtype<E>, f: Runtype<F>, g: Runtype<G>, h: Runtype<H>): Runtype<A & B & C & D & E & F & G & H>; | ||
export declare function Intersect<A, B, C, D, E, F, G, H, I>(a: Runtype<A>, b: Runtype<B>, c: Runtype<C>, d: Runtype<D>, e: Runtype<E>, f: Runtype<F>, g: Runtype<G>, h: Runtype<H>, i: Runtype<I>): Runtype<A & B & C & D & E & F & G & H & I>; | ||
export declare function Intersect<A, B, C, D, E, F, G, H, I, J>(a: Runtype<A>, b: Runtype<B>, c: Runtype<C>, d: Runtype<D>, e: Runtype<E>, f: Runtype<F>, g: Runtype<G>, h: Runtype<H>, i: Runtype<I>, j: Runtype<J>): Runtype<A & B & C & D & E & F & G & H & I & J>; | ||
export declare function Intersect<A, B, C, D, E, F, G, H, I, J, K>(a: Runtype<A>, b: Runtype<B>, c: Runtype<C>, d: Runtype<D>, e: Runtype<E>, f: Runtype<F>, g: Runtype<G>, h: Runtype<H>, i: Runtype<I>, j: Runtype<J>, k: Runtype<K>): Runtype<A & B & C & D & E & F & G & H & I & J & K>; | ||
export declare function Intersect<A, B, C, D, E, F, G, H, I, J, K, L>(a: Runtype<A>, b: Runtype<B>, c: Runtype<C>, d: Runtype<D>, e: Runtype<E>, f: Runtype<F>, g: Runtype<G>, h: Runtype<H>, i: Runtype<I>, j: Runtype<J>, k: Runtype<K>, l: Runtype<L>): Runtype<A & B & C & D & E & F & G & H & I & J & K & L>; | ||
export declare function Intersect<A, B, C, D, E, F, G, H, I, J, K, L, M>(a: Runtype<A>, b: Runtype<B>, c: Runtype<C>, d: Runtype<D>, e: Runtype<E>, f: Runtype<F>, g: Runtype<G>, h: Runtype<H>, i: Runtype<I>, j: Runtype<J>, k: Runtype<K>, m: Runtype<M>): Runtype<A & B & C & D & E & F & G & H & I & J & K & L & M>; | ||
export declare function Intersect<A, B, C, D, E, F, G, H, I, J, K, L, M, N>(a: Runtype<A>, b: Runtype<B>, c: Runtype<C>, d: Runtype<D>, e: Runtype<E>, f: Runtype<F>, g: Runtype<G>, h: Runtype<H>, i: Runtype<I>, j: Runtype<J>, k: Runtype<K>, m: Runtype<M>, n: Runtype<N>): Runtype<A & B & C & D & E & F & G & H & I & J & K & L & M & N>; | ||
export declare function Intersect<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O>(a: Runtype<A>, b: Runtype<B>, c: Runtype<C>, d: Runtype<D>, e: Runtype<E>, f: Runtype<F>, g: Runtype<G>, h: Runtype<H>, i: Runtype<I>, j: Runtype<J>, k: Runtype<K>, m: Runtype<M>, n: Runtype<N>, o: Runtype<O>): Runtype<A & B & C & D & E & F & G & H & I & J & K & L & M & N & O>; | ||
export declare function Intersect<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P>(a: Runtype<A>, b: Runtype<B>, c: Runtype<C>, d: Runtype<D>, e: Runtype<E>, f: Runtype<F>, g: Runtype<G>, h: Runtype<H>, i: Runtype<I>, j: Runtype<J>, k: Runtype<K>, m: Runtype<M>, n: Runtype<N>, o: Runtype<O>, p: Runtype<P>): Runtype<A & B & C & D & E & F & G & H & I & J & K & L & M & N & O & P>; | ||
export declare function Intersect<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q>(a: Runtype<A>, b: Runtype<B>, c: Runtype<C>, d: Runtype<D>, e: Runtype<E>, f: Runtype<F>, g: Runtype<G>, h: Runtype<H>, i: Runtype<I>, j: Runtype<J>, k: Runtype<K>, m: Runtype<M>, n: Runtype<N>, o: Runtype<O>, p: Runtype<P>, q: Runtype<Q>): Runtype<A & B & C & D & E & F & G & H & I & J & K & L & M & N & O & P & Q>; | ||
export declare function Intersect<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R>(a: Runtype<A>, b: Runtype<B>, c: Runtype<C>, d: Runtype<D>, e: Runtype<E>, f: Runtype<F>, g: Runtype<G>, h: Runtype<H>, i: Runtype<I>, j: Runtype<J>, k: Runtype<K>, m: Runtype<M>, n: Runtype<N>, o: Runtype<O>, p: Runtype<P>, q: Runtype<Q>, r: Runtype<R>): Runtype<A & B & C & D & E & F & G & H & I & J & K & L & M & N & O & P & Q & R>; | ||
export declare function Intersect<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S>(a: Runtype<A>, b: Runtype<B>, c: Runtype<C>, d: Runtype<D>, e: Runtype<E>, f: Runtype<F>, g: Runtype<G>, h: Runtype<H>, i: Runtype<I>, j: Runtype<J>, k: Runtype<K>, m: Runtype<M>, n: Runtype<N>, o: Runtype<O>, p: Runtype<P>, q: Runtype<Q>, r: Runtype<R>, s: Runtype<S>): Runtype<A & B & C & D & E & F & G & H & I & J & K & L & M & N & O & P & Q & R & S>; | ||
export declare function Intersect<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T>(a: Runtype<A>, b: Runtype<B>, c: Runtype<C>, d: Runtype<D>, e: Runtype<E>, f: Runtype<F>, g: Runtype<G>, h: Runtype<H>, i: Runtype<I>, j: Runtype<J>, k: Runtype<K>, m: Runtype<M>, n: Runtype<N>, o: Runtype<O>, p: Runtype<P>, q: Runtype<Q>, r: Runtype<R>, s: Runtype<S>, t: Runtype<T>): Runtype<A & B & C & D & E & F & G & H & I & J & K & L & M & N & O & P & Q & R & S & T>; | ||
export declare function Intersect<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U>(a: Runtype<A>, b: Runtype<B>, c: Runtype<C>, d: Runtype<D>, e: Runtype<E>, f: Runtype<F>, g: Runtype<G>, h: Runtype<H>, i: Runtype<I>, j: Runtype<J>, k: Runtype<K>, m: Runtype<M>, n: Runtype<N>, o: Runtype<O>, p: Runtype<P>, q: Runtype<Q>, r: Runtype<R>, s: Runtype<S>, t: Runtype<T>, u: Runtype<U>): Runtype<A & B & C & D & E & F & G & H & I & J & K & L & M & N & O & P & Q & R & S & T & U>; | ||
export declare function Intersect<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V>(a: Runtype<A>, b: Runtype<B>, c: Runtype<C>, d: Runtype<D>, e: Runtype<E>, f: Runtype<F>, g: Runtype<G>, h: Runtype<H>, i: Runtype<I>, j: Runtype<J>, k: Runtype<K>, m: Runtype<M>, n: Runtype<N>, o: Runtype<O>, p: Runtype<P>, q: Runtype<Q>, r: Runtype<R>, s: Runtype<S>, t: Runtype<T>, u: Runtype<U>, v: Runtype<V>): Runtype<A & B & C & D & E & F & G & H & I & J & K & L & M & N & O & P & Q & R & S & T & U & V>; | ||
export declare function Intersect<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W>(a: Runtype<A>, b: Runtype<B>, c: Runtype<C>, d: Runtype<D>, e: Runtype<E>, f: Runtype<F>, g: Runtype<G>, h: Runtype<H>, i: Runtype<I>, j: Runtype<J>, k: Runtype<K>, m: Runtype<M>, n: Runtype<N>, o: Runtype<O>, p: Runtype<P>, q: Runtype<Q>, r: Runtype<R>, s: Runtype<S>, t: Runtype<T>, u: Runtype<U>, v: Runtype<V>, w: Runtype<W>): Runtype<A & B & C & D & E & F & G & H & I & J & K & L & M & N & O & P & Q & R & S & T & U & V & W>; | ||
export declare function Intersect<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X>(a: Runtype<A>, b: Runtype<B>, c: Runtype<C>, d: Runtype<D>, e: Runtype<E>, f: Runtype<F>, g: Runtype<G>, h: Runtype<H>, i: Runtype<I>, j: Runtype<J>, k: Runtype<K>, m: Runtype<M>, n: Runtype<N>, o: Runtype<O>, p: Runtype<P>, q: Runtype<Q>, r: Runtype<R>, s: Runtype<S>, t: Runtype<T>, u: Runtype<U>, v: Runtype<V>, w: Runtype<W>, x: Runtype<X>): Runtype<A & B & C & D & E & F & G & H & I & J & K & L & M & N & O & P & Q & R & S & T & U & V & W & X>; | ||
export declare function Intersect<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y>(a: Runtype<A>, b: Runtype<B>, c: Runtype<C>, d: Runtype<D>, e: Runtype<E>, f: Runtype<F>, g: Runtype<G>, h: Runtype<H>, i: Runtype<I>, j: Runtype<J>, k: Runtype<K>, m: Runtype<M>, n: Runtype<N>, o: Runtype<O>, p: Runtype<P>, q: Runtype<Q>, r: Runtype<R>, s: Runtype<S>, t: Runtype<T>, u: Runtype<U>, v: Runtype<V>, w: Runtype<W>, x: Runtype<X>, y: Runtype<Y>): Runtype<A & B & C & D & E & F & G & H & I & J & K & L & M & N & O & P & Q & R & S & T & U & V & W & X & Y>; | ||
export declare function Intersect<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z>(a: Runtype<A>, b: Runtype<B>, c: Runtype<C>, d: Runtype<D>, e: Runtype<E>, f: Runtype<F>, g: Runtype<G>, h: Runtype<H>, i: Runtype<I>, j: Runtype<J>, k: Runtype<K>, m: Runtype<M>, n: Runtype<N>, o: Runtype<O>, p: Runtype<P>, q: Runtype<Q>, r: Runtype<R>, s: Runtype<S>, t: Runtype<T>, u: Runtype<U>, v: Runtype<V>, w: Runtype<W>, x: Runtype<X>, y: Runtype<Y>, z: Runtype<Z>): Runtype<A & B & C & D & E & F & G & H & I & J & K & L & M & N & O & P & Q & R & S & T & U & V & W & X & Y & Z>; | ||
/** | ||
* Constructs a possibly-undefined Runtype. | ||
@@ -145,0 +175,0 @@ */ |
@@ -146,2 +146,16 @@ "use strict"; | ||
exports.Union = Union; | ||
function Intersect() { | ||
var runtypes = []; | ||
for (var _i = 0; _i < arguments.length; _i++) { | ||
runtypes[_i] = arguments[_i]; | ||
} | ||
return runtype(function (x) { | ||
for (var _i = 0, runtypes_2 = runtypes; _i < runtypes_2.length; _i++) { | ||
var coerce = runtypes_2[_i].coerce; | ||
coerce(x); | ||
} | ||
return x; | ||
}); | ||
} | ||
exports.Intersect = Intersect; | ||
/** | ||
@@ -148,0 +162,0 @@ * Constructs a possibly-undefined Runtype. |
{ | ||
"name": "runtypes", | ||
"version": "0.2.1", | ||
"version": "0.2.2", | ||
"description": "Runtime type validation for (Java|Type)Script", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
@@ -1,2 +0,2 @@ | ||
import { Runtype, Anything, Nothing, Undefined, Null, Void, Boolean, Number, String, Literal, Array, Record, Tuple, Union, Optional, Lazy } from './index' | ||
import { Runtype, Anything, Nothing, Undefined, Null, Void, Boolean, Number, String, Literal, Array, Record, Tuple, Union, Optional, Lazy, Intersect } from './index'; | ||
@@ -7,3 +7,2 @@ | ||
const union1 = Union(Literal(3), String, boolTuple, record1) | ||
const Person = Lazy(() => Record({ name: String, likes: Array(Person) })) | ||
@@ -32,2 +31,3 @@ | ||
Person, | ||
Intersect: Intersect(Record({ Boolean }), Record({ Number })) | ||
} | ||
@@ -50,3 +50,3 @@ | ||
{ value: [true, false, true], passes: ['boolArray', 'boolTuple', 'union1'] }, | ||
{ value: { Boolean: true, Number: 3 }, passes: ['record1', 'union1', 'optionalKey'] }, | ||
{ value: { Boolean: true, Number: 3 }, passes: ['record1', 'union1', 'optionalKey', 'Intersect'] }, | ||
{ value: { Boolean: true }, passes: ['optionalKey'] }, | ||
@@ -53,0 +53,0 @@ { value: { Boolean: true, foo: 'hello' }, passes: ['optionalKey'] }, |
403
src/index.ts
@@ -647,3 +647,406 @@ /** | ||
/** | ||
* Construct an intersection runtype from runtypes for its alternatives. | ||
*/ | ||
export function Intersect( | ||
): Runtype<never> | ||
export function Intersect<A>( | ||
a: Runtype<A>, | ||
): Runtype<A> | ||
export function Intersect<A, B>( | ||
a: Runtype<A>, | ||
b: Runtype<B>, | ||
): Runtype<A & B> | ||
export function Intersect<A, B, C>( | ||
a: Runtype<A>, | ||
b: Runtype<B>, | ||
c: Runtype<C>, | ||
): Runtype<A & B & C> | ||
export function Intersect<A, B, C, D>( | ||
a: Runtype<A>, | ||
b: Runtype<B>, | ||
c: Runtype<C>, | ||
d: Runtype<D>, | ||
): Runtype<A & B & C & D> | ||
export function Intersect<A, B, C, D, E>( | ||
a: Runtype<A>, | ||
b: Runtype<B>, | ||
c: Runtype<C>, | ||
d: Runtype<D>, | ||
e: Runtype<E>, | ||
): Runtype<A & B & C & D & E> | ||
export function Intersect<A, B, C, D, E, F>( | ||
a: Runtype<A>, | ||
b: Runtype<B>, | ||
c: Runtype<C>, | ||
d: Runtype<D>, | ||
e: Runtype<E>, | ||
f: Runtype<F>, | ||
): Runtype<A & B & C & D & E & F> | ||
export function Intersect<A, B, C, D, E, F, G>( | ||
a: Runtype<A>, | ||
b: Runtype<B>, | ||
c: Runtype<C>, | ||
d: Runtype<D>, | ||
e: Runtype<E>, | ||
f: Runtype<F>, | ||
g: Runtype<G>, | ||
): Runtype<A & B & C & D & E & F & G> | ||
export function Intersect<A, B, C, D, E, F, G, H>( | ||
a: Runtype<A>, | ||
b: Runtype<B>, | ||
c: Runtype<C>, | ||
d: Runtype<D>, | ||
e: Runtype<E>, | ||
f: Runtype<F>, | ||
g: Runtype<G>, | ||
h: Runtype<H>, | ||
): Runtype<A & B & C & D & E & F & G & H> | ||
export function Intersect<A, B, C, D, E, F, G, H, I>( | ||
a: Runtype<A>, | ||
b: Runtype<B>, | ||
c: Runtype<C>, | ||
d: Runtype<D>, | ||
e: Runtype<E>, | ||
f: Runtype<F>, | ||
g: Runtype<G>, | ||
h: Runtype<H>, | ||
i: Runtype<I>, | ||
): Runtype<A & B & C & D & E & F & G & H & I> | ||
export function Intersect<A, B, C, D, E, F, G, H, I, J>( | ||
a: Runtype<A>, | ||
b: Runtype<B>, | ||
c: Runtype<C>, | ||
d: Runtype<D>, | ||
e: Runtype<E>, | ||
f: Runtype<F>, | ||
g: Runtype<G>, | ||
h: Runtype<H>, | ||
i: Runtype<I>, | ||
j: Runtype<J>, | ||
): Runtype<A & B & C & D & E & F & G & H & I & J> | ||
export function Intersect<A, B, C, D, E, F, G, H, I, J, K>( | ||
a: Runtype<A>, | ||
b: Runtype<B>, | ||
c: Runtype<C>, | ||
d: Runtype<D>, | ||
e: Runtype<E>, | ||
f: Runtype<F>, | ||
g: Runtype<G>, | ||
h: Runtype<H>, | ||
i: Runtype<I>, | ||
j: Runtype<J>, | ||
k: Runtype<K>, | ||
): Runtype<A & B & C & D & E & F & G & H & I & J & K> | ||
export function Intersect<A, B, C, D, E, F, G, H, I, J, K, L>( | ||
a: Runtype<A>, | ||
b: Runtype<B>, | ||
c: Runtype<C>, | ||
d: Runtype<D>, | ||
e: Runtype<E>, | ||
f: Runtype<F>, | ||
g: Runtype<G>, | ||
h: Runtype<H>, | ||
i: Runtype<I>, | ||
j: Runtype<J>, | ||
k: Runtype<K>, | ||
l: Runtype<L>, | ||
): Runtype<A & B & C & D & E & F & G & H & I & J & K & L> | ||
export function Intersect<A, B, C, D, E, F, G, H, I, J, K, L, M>( | ||
a: Runtype<A>, | ||
b: Runtype<B>, | ||
c: Runtype<C>, | ||
d: Runtype<D>, | ||
e: Runtype<E>, | ||
f: Runtype<F>, | ||
g: Runtype<G>, | ||
h: Runtype<H>, | ||
i: Runtype<I>, | ||
j: Runtype<J>, | ||
k: Runtype<K>, | ||
m: Runtype<M>, | ||
): Runtype<A & B & C & D & E & F & G & H & I & J & K & L & M> | ||
export function Intersect<A, B, C, D, E, F, G, H, I, J, K, L, M, N>( | ||
a: Runtype<A>, | ||
b: Runtype<B>, | ||
c: Runtype<C>, | ||
d: Runtype<D>, | ||
e: Runtype<E>, | ||
f: Runtype<F>, | ||
g: Runtype<G>, | ||
h: Runtype<H>, | ||
i: Runtype<I>, | ||
j: Runtype<J>, | ||
k: Runtype<K>, | ||
m: Runtype<M>, | ||
n: Runtype<N>, | ||
): Runtype<A & B & C & D & E & F & G & H & I & J & K & L & M & N> | ||
export function Intersect<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O>( | ||
a: Runtype<A>, | ||
b: Runtype<B>, | ||
c: Runtype<C>, | ||
d: Runtype<D>, | ||
e: Runtype<E>, | ||
f: Runtype<F>, | ||
g: Runtype<G>, | ||
h: Runtype<H>, | ||
i: Runtype<I>, | ||
j: Runtype<J>, | ||
k: Runtype<K>, | ||
m: Runtype<M>, | ||
n: Runtype<N>, | ||
o: Runtype<O>, | ||
): Runtype<A & B & C & D & E & F & G & H & I & J & K & L & M & N & O> | ||
export function Intersect<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P>( | ||
a: Runtype<A>, | ||
b: Runtype<B>, | ||
c: Runtype<C>, | ||
d: Runtype<D>, | ||
e: Runtype<E>, | ||
f: Runtype<F>, | ||
g: Runtype<G>, | ||
h: Runtype<H>, | ||
i: Runtype<I>, | ||
j: Runtype<J>, | ||
k: Runtype<K>, | ||
m: Runtype<M>, | ||
n: Runtype<N>, | ||
o: Runtype<O>, | ||
p: Runtype<P>, | ||
): Runtype<A & B & C & D & E & F & G & H & I & J & K & L & M & N & O & P> | ||
export function Intersect<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q>( | ||
a: Runtype<A>, | ||
b: Runtype<B>, | ||
c: Runtype<C>, | ||
d: Runtype<D>, | ||
e: Runtype<E>, | ||
f: Runtype<F>, | ||
g: Runtype<G>, | ||
h: Runtype<H>, | ||
i: Runtype<I>, | ||
j: Runtype<J>, | ||
k: Runtype<K>, | ||
m: Runtype<M>, | ||
n: Runtype<N>, | ||
o: Runtype<O>, | ||
p: Runtype<P>, | ||
q: Runtype<Q>, | ||
): Runtype<A & B & C & D & E & F & G & H & I & J & K & L & M & N & O & P & Q> | ||
export function Intersect<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R>( | ||
a: Runtype<A>, | ||
b: Runtype<B>, | ||
c: Runtype<C>, | ||
d: Runtype<D>, | ||
e: Runtype<E>, | ||
f: Runtype<F>, | ||
g: Runtype<G>, | ||
h: Runtype<H>, | ||
i: Runtype<I>, | ||
j: Runtype<J>, | ||
k: Runtype<K>, | ||
m: Runtype<M>, | ||
n: Runtype<N>, | ||
o: Runtype<O>, | ||
p: Runtype<P>, | ||
q: Runtype<Q>, | ||
r: Runtype<R>, | ||
): Runtype<A & B & C & D & E & F & G & H & I & J & K & L & M & N & O & P & Q & R> | ||
export function Intersect<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S>( | ||
a: Runtype<A>, | ||
b: Runtype<B>, | ||
c: Runtype<C>, | ||
d: Runtype<D>, | ||
e: Runtype<E>, | ||
f: Runtype<F>, | ||
g: Runtype<G>, | ||
h: Runtype<H>, | ||
i: Runtype<I>, | ||
j: Runtype<J>, | ||
k: Runtype<K>, | ||
m: Runtype<M>, | ||
n: Runtype<N>, | ||
o: Runtype<O>, | ||
p: Runtype<P>, | ||
q: Runtype<Q>, | ||
r: Runtype<R>, | ||
s: Runtype<S>, | ||
): Runtype<A & B & C & D & E & F & G & H & I & J & K & L & M & N & O & P & Q & R & S> | ||
export function Intersect<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T>( | ||
a: Runtype<A>, | ||
b: Runtype<B>, | ||
c: Runtype<C>, | ||
d: Runtype<D>, | ||
e: Runtype<E>, | ||
f: Runtype<F>, | ||
g: Runtype<G>, | ||
h: Runtype<H>, | ||
i: Runtype<I>, | ||
j: Runtype<J>, | ||
k: Runtype<K>, | ||
m: Runtype<M>, | ||
n: Runtype<N>, | ||
o: Runtype<O>, | ||
p: Runtype<P>, | ||
q: Runtype<Q>, | ||
r: Runtype<R>, | ||
s: Runtype<S>, | ||
t: Runtype<T>, | ||
): Runtype<A & B & C & D & E & F & G & H & I & J & K & L & M & N & O & P & Q & R & S & T> | ||
export function Intersect<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U>( | ||
a: Runtype<A>, | ||
b: Runtype<B>, | ||
c: Runtype<C>, | ||
d: Runtype<D>, | ||
e: Runtype<E>, | ||
f: Runtype<F>, | ||
g: Runtype<G>, | ||
h: Runtype<H>, | ||
i: Runtype<I>, | ||
j: Runtype<J>, | ||
k: Runtype<K>, | ||
m: Runtype<M>, | ||
n: Runtype<N>, | ||
o: Runtype<O>, | ||
p: Runtype<P>, | ||
q: Runtype<Q>, | ||
r: Runtype<R>, | ||
s: Runtype<S>, | ||
t: Runtype<T>, | ||
u: Runtype<U>, | ||
): Runtype<A & B & C & D & E & F & G & H & I & J & K & L & M & N & O & P & Q & R & S & T & U> | ||
export function Intersect<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V>( | ||
a: Runtype<A>, | ||
b: Runtype<B>, | ||
c: Runtype<C>, | ||
d: Runtype<D>, | ||
e: Runtype<E>, | ||
f: Runtype<F>, | ||
g: Runtype<G>, | ||
h: Runtype<H>, | ||
i: Runtype<I>, | ||
j: Runtype<J>, | ||
k: Runtype<K>, | ||
m: Runtype<M>, | ||
n: Runtype<N>, | ||
o: Runtype<O>, | ||
p: Runtype<P>, | ||
q: Runtype<Q>, | ||
r: Runtype<R>, | ||
s: Runtype<S>, | ||
t: Runtype<T>, | ||
u: Runtype<U>, | ||
v: Runtype<V>, | ||
): Runtype<A & B & C & D & E & F & G & H & I & J & K & L & M & N & O & P & Q & R & S & T & U & V> | ||
export function Intersect<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W>( | ||
a: Runtype<A>, | ||
b: Runtype<B>, | ||
c: Runtype<C>, | ||
d: Runtype<D>, | ||
e: Runtype<E>, | ||
f: Runtype<F>, | ||
g: Runtype<G>, | ||
h: Runtype<H>, | ||
i: Runtype<I>, | ||
j: Runtype<J>, | ||
k: Runtype<K>, | ||
m: Runtype<M>, | ||
n: Runtype<N>, | ||
o: Runtype<O>, | ||
p: Runtype<P>, | ||
q: Runtype<Q>, | ||
r: Runtype<R>, | ||
s: Runtype<S>, | ||
t: Runtype<T>, | ||
u: Runtype<U>, | ||
v: Runtype<V>, | ||
w: Runtype<W>, | ||
): Runtype<A & B & C & D & E & F & G & H & I & J & K & L & M & N & O & P & Q & R & S & T & U & V & W> | ||
export function Intersect<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X>( | ||
a: Runtype<A>, | ||
b: Runtype<B>, | ||
c: Runtype<C>, | ||
d: Runtype<D>, | ||
e: Runtype<E>, | ||
f: Runtype<F>, | ||
g: Runtype<G>, | ||
h: Runtype<H>, | ||
i: Runtype<I>, | ||
j: Runtype<J>, | ||
k: Runtype<K>, | ||
m: Runtype<M>, | ||
n: Runtype<N>, | ||
o: Runtype<O>, | ||
p: Runtype<P>, | ||
q: Runtype<Q>, | ||
r: Runtype<R>, | ||
s: Runtype<S>, | ||
t: Runtype<T>, | ||
u: Runtype<U>, | ||
v: Runtype<V>, | ||
w: Runtype<W>, | ||
x: Runtype<X>, | ||
): Runtype<A & B & C & D & E & F & G & H & I & J & K & L & M & N & O & P & Q & R & S & T & U & V & W & X> | ||
export function Intersect<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y>( | ||
a: Runtype<A>, | ||
b: Runtype<B>, | ||
c: Runtype<C>, | ||
d: Runtype<D>, | ||
e: Runtype<E>, | ||
f: Runtype<F>, | ||
g: Runtype<G>, | ||
h: Runtype<H>, | ||
i: Runtype<I>, | ||
j: Runtype<J>, | ||
k: Runtype<K>, | ||
m: Runtype<M>, | ||
n: Runtype<N>, | ||
o: Runtype<O>, | ||
p: Runtype<P>, | ||
q: Runtype<Q>, | ||
r: Runtype<R>, | ||
s: Runtype<S>, | ||
t: Runtype<T>, | ||
u: Runtype<U>, | ||
v: Runtype<V>, | ||
w: Runtype<W>, | ||
x: Runtype<X>, | ||
y: Runtype<Y>, | ||
): Runtype<A & B & C & D & E & F & G & H & I & J & K & L & M & N & O & P & Q & R & S & T & U & V & W & X & Y> | ||
export function Intersect<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z>( | ||
a: Runtype<A>, | ||
b: Runtype<B>, | ||
c: Runtype<C>, | ||
d: Runtype<D>, | ||
e: Runtype<E>, | ||
f: Runtype<F>, | ||
g: Runtype<G>, | ||
h: Runtype<H>, | ||
i: Runtype<I>, | ||
j: Runtype<J>, | ||
k: Runtype<K>, | ||
m: Runtype<M>, | ||
n: Runtype<N>, | ||
o: Runtype<O>, | ||
p: Runtype<P>, | ||
q: Runtype<Q>, | ||
r: Runtype<R>, | ||
s: Runtype<S>, | ||
t: Runtype<T>, | ||
u: Runtype<U>, | ||
v: Runtype<V>, | ||
w: Runtype<W>, | ||
x: Runtype<X>, | ||
y: Runtype<Y>, | ||
z: Runtype<Z>, | ||
): Runtype<A & B & C & D & E & F & G & H & I & J & K & L & M & N & O & P & Q & R & S & T & U & V & W & X & Y & Z> | ||
export function Intersect(...runtypes: Runtype<any>[]) { | ||
return runtype(x => { | ||
for (const { coerce } of runtypes) | ||
coerce(x) | ||
return x | ||
}) | ||
} | ||
/** | ||
* Constructs a possibly-undefined Runtype. | ||
@@ -650,0 +1053,0 @@ */ |
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
62649
1553