generic-type-guard
Version:
Generic type guards for TypeScript
8 lines (7 loc) • 34.8 kB
Source Map (JSON)
{
"version": 3,
"sources": ["src/index.ts", "src/utils.ts", "src/primitives.ts", "src/objects.ts", "src/combinators/functions.ts", "src/combinators/unionof.ts", "src/combinators/intersectionof.ts", "src/combinators/interface.ts"],
"sourcesContent": ["/**\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/.\n */\n\nexport * from './guards.js';\nexport * from './primitives.js';\nexport * from './objects.js';\nexport * from './combinators/index.js';\nexport * from './utils.js';\n", "/**\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/.\n */\n\nimport type { GuardedType, PartialTypeGuard as PTG } from './guards.js';\n\n/**\n * Indicates there was an error validating a typeguard.\n *\n * @public\n */\nexport class AssertionError extends RangeError {\n\tpublic constructor(\n\t\tpublic value: unknown,\n\t\tmessage?: string,\n\t) {\n\t\tsuper(message);\n\n\t\tthis.name = this.constructor.name;\n\t}\n}\n\n/**\n * Asserts that a guard is successful.\n *\n * This may not work properly in ECMAScript environments that don't fully support ES6. If this is your environment then\n * you should do this check manually and throw your own error.\n *\n * @throws AssertionError if the guard returns false.\n * @public\n */\nexport const assert: <T, Guard extends PTG<T, T>>(\n\tvalue: T,\n\tguard: Guard,\n\tmessage?: string,\n) => asserts value is GuardedType<Guard> = (value, guard, message) => {\n\tif (!guard(value)) {\n\t\tthrow new AssertionError(value, message ?? `Invalid value provided: ${JSON.stringify(value)}`);\n\t}\n};\n\n/**\n * Helper to string many different typeguards together into something larger.\n *\n * @param guards - A list of partial typeguards to string together.\n *\n * @public\n */\nexport const combine: {\n\t<A, B extends A, C extends B>(g1: PTG<A, B>, g2: PTG<B, C>): PTG<A, C>;\n\t<A, B extends A, C extends B, D extends C>(g1: PTG<A, B>, g2: PTG<B, C>, g3: PTG<C, D>): PTG<A, D>;\n\t<A, B extends A, C extends B, D extends C, E extends D>(\n\t\tg1: PTG<A, B>,\n\t\tg2: PTG<B, C>,\n\t\tg3: PTG<C, D>,\n\t\tg4: PTG<D, E>,\n\t): PTG<A, E>;\n\t<A, B extends A, C extends B, D extends C, E extends D, F extends E>(\n\t\tg1: PTG<A, B>,\n\t\tg2: PTG<B, C>,\n\t\tg3: PTG<C, D>,\n\t\tg4: PTG<D, E>,\n\t\tg5: PTG<D, E>,\n\t): PTG<A, F>;\n}\n\t= (...guards: Array<PTG<unknown, unknown>>) =>\n\t\t(v: unknown): v is unknown => {\n\t\t\tfor (const guard of guards) {\n\t\t\t\tif (!guard(v)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t};\n", "/**\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/.\n */\n\nimport type { PartialTypeGuard, TypeGuard } from './guards.js';\nimport { combine } from './utils.js';\n\n/**\n * Helper to diff types.\n * @public\n */\nexport type Diff<T, U> = T extends U ? never : T;\n\nconst MINIMUM_ARRAY_INDEX = 0;\n\n/**\n * Validate if a value is a javascript number.\n *\n * @public\n */\nexport const isNumber: TypeGuard<number> = (n: unknown): n is number => typeof n === 'number' && !isNaN(n);\n\n/**\n * Validate the value is a finite number.\n *\n * @public\n */\nexport const isFiniteNumber: TypeGuard<number> = (n: unknown): n is number =>\n\ttypeof n === 'number' && !isNaN(n) && isFinite(n);\n\n/**\n * Validate the value is a number in the rawest sense.\n *\n * This check is exactly what the type system says on the tin. This value is a floating point value with all\n * the edge cases that entails.\n *\n * @public\n */\nexport const isFloat: TypeGuard<number> = (n: unknown): n is number => typeof n === 'number';\n\n/**\n * Alias for isFloat.\n *\n * @see isFloat()\n * @public\n */\nexport const isDouble = isFloat;\n\n/**\n * Validate the value is infinite.\n *\n * @public\n */\nexport const isInfinity: TypeGuard<number> = (n: unknown): n is number =>\n\ttypeof n === 'number' && !isNaN(n) && !isFinite(n);\n\n/**\n * Validates a value is exactly the NaN constant value.\n *\n * @public\n */\nconst _isNaN: TypeGuard<number> = (n: unknown): n is number => typeof n === 'number' && isNaN(n);\nexport { _isNaN as isNaN };\n\n/**\n * Validates that a value is one of a set of values.\n *\n * @public\n */\nexport const isElementOf = (<T>(...ss: T[]): TypeGuard<T> =>\n\t(s: unknown): s is T =>\n\t\tss.indexOf(s as T) >= MINIMUM_ARRAY_INDEX) as {\n\t(): TypeGuard<never>;\n\t<T>(...ss: T[]): TypeGuard<T>;\n};\n\n/**\n * Validate if a value is a specific javascript number.\n *\n * @public\n */\nexport const isSingletonNumber\n\t= <T extends number>(v: T): TypeGuard<T> =>\n\t\t(n: unknown): n is T =>\n\t\t\tn === v;\n\n/**\n * Validate if a value is one of a set of specific numbers.\n *\n * @public\n */\nexport const isSingletonNumberUnion = (<T extends number>(...ss: T[]): TypeGuard<T> =>\n\t(s: unknown): s is T =>\n\t\tss.indexOf(s as T) >= MINIMUM_ARRAY_INDEX) as {\n\t(): TypeGuard<never>;\n\t<T extends number>(...ss: T[]): TypeGuard<T>;\n};\n\n/**\n * Validate if a value is a string.\n *\n * @public\n */\nexport const isString: TypeGuard<string> = (s: unknown): s is string => typeof s === 'string';\n\n/**\n * Validate if a value is a specific string.\n *\n * @public\n */\nexport const isSingletonString\n\t= <T extends string>(v: T): TypeGuard<T> =>\n\t\t(s: unknown): s is T =>\n\t\t\ts === v;\n\n/**\n * Validate if a value is one of a set of specific strings.\n *\n * @public\n */\nexport const isSingletonStringUnion = (<T extends string>(...ss: T[]): TypeGuard<T> =>\n\t(s: unknown): s is T =>\n\t\tss.indexOf(s as T) >= MINIMUM_ARRAY_INDEX) as {\n\t(): TypeGuard<never>;\n\t<T extends string>(...ss: T[]): TypeGuard<T>;\n};\n\n/**\n * Validate if a value is a boolean.\n *\n * @public\n */\nexport const isBoolean: TypeGuard<boolean> = (b: unknown): b is boolean => typeof b === 'boolean';\n\n/**\n * Validate if a value is the constant null.\n *\n * @public\n */\nexport const isNull: TypeGuard<null> = (o: unknown): o is null => o === null;\n\n/**\n * Validate if a value is the constant undefined.\n *\n * @public\n */\nexport const isUndefined: TypeGuard<undefined> = (u: unknown): u is undefined => typeof u === 'undefined';\n\n/**\n * Validate if a value is optionally a given type.\n *\n * @public\n */\nexport const isOptional\n\t= <T>(tgt: TypeGuard<T>): TypeGuard<T | undefined> =>\n\t\t(o: unknown): o is T | undefined =>\n\t\t\ttypeof o === 'undefined' || tgt(o);\n\n/**\n * Validate if a value is a given type or null.\n *\n * @public\n */\nexport const isNullable\n\t= <T>(tgt: TypeGuard<T>): TypeGuard<T | null> =>\n\t\t(o: unknown): o is T | null =>\n\t\t\to === null || tgt(o);\n\n/**\n * Validates if a value is a given type or null or undefined.\n *\n * @public\n */\nexport const isMissing\n\t= <T>(tgt: TypeGuard<T>): TypeGuard<T | undefined | null> =>\n\t\t(o: unknown): o is T | null | undefined =>\n\t\t\to == null || tgt(o);\n\n/**\n * Validate if a value is an array of a specific type of value.\n *\n * @public\n */\nexport const isArray\n\t= <T>(valueCheck: TypeGuard<T>): TypeGuard<T[]> =>\n\t\t(arr: unknown): arr is T[] =>\n\t\t\tArray.isArray(arr) && arr.reduce<boolean>((acc, v) => acc && valueCheck(v as unknown), true);\n\n/**\n * Validate if a value is a non-empty array of a specific type of value.\n *\n * @public\n */\nexport const isNotEmptyList\n\t= <T>(valueCheck: TypeGuard<T>): TypeGuard<[T, ...T[]]> =>\n\t\t(arr: unknown): arr is [T, ...T[]] =>\n\t\t\tArray.isArray(arr)\n\t\t\t&& arr.length >= 1\n\t\t\t&& arr.reduce<boolean>((acc, v) => acc && valueCheck(v as unknown), true);\n\n/**\n * Narrow the type of a value.\n *\n * @public\n * @deprecated Use combine instead, this alias is poorly named.\n */\nexport const narrowValue = <T, U extends T, V extends U>(\n\tptt: PartialTypeGuard<T, U>,\n\tptu: PartialTypeGuard<U, V>,\n): PartialTypeGuard<T, V> => combine(ptt, ptu);\n\n/**\n * Narrow the type of elements inside an array.\n *\n * @public\n */\nexport const narrowArray\n\t= <T, U extends T>(pt: PartialTypeGuard<T, U>): PartialTypeGuard<T[], U[]> =>\n\t\t(ts: T[]): ts is U[] =>\n\t\t\tts.reduce<boolean>((acc, b) => acc && pt(b), true);\n\n/**\n * Validate if an object is a Set containing elements of a given type.\n *\n * @public\n */\nexport const isSetOf\n\t= <T>(tg: TypeGuard<T>) =>\n\t\t(o: unknown): o is Set<T> =>\n\t\t\to instanceof Set\n\t\t\t&& Array.of(...(o as Set<unknown>).values()).reduce<boolean>((acc, v) => acc && tg(v), true);\n\n/**\n * Validate if a value is like an object.\n *\n * Specifically, this only checks typeof === \"object\" which includes\n * things that typescript has other primitives for like arrays.\n *\n * @public\n */\nexport const isObjectLike: TypeGuard<object> = (obj: unknown): obj is object => obj != null && typeof obj === 'object';\n\n/**\n * Validate if a value is an object.\n *\n * @public\n */\nexport const isObject: TypeGuard<object> = (obj: unknown): obj is object =>\n\tobj != null && typeof obj === 'object' && !(obj instanceof Array);\n\n/**\n * Validates if a value is not null and not undefined.\n *\n * @public\n */\nexport const isSet = <T = unknown>(obj: T): obj is Diff<T, undefined | null> => obj != null;\n\n/**\n * Validates if a value is a valid part of a numeric enumeration.\n *\n * @param e - The enumeration to check\n * @param flags - Whether this is a flag style enumeration\n *\n * @public\n */\nexport const isNumericalEnumeration = <T extends Record<string | number, string | number>>(\n\te: T,\n\tflags = false,\n): TypeGuard<T> => {\n\tconst options = Object.values(e).filter(isNumber);\n\tif (!flags) {\n\t\treturn (obj: unknown): obj is T => (options as unknown[]).includes(obj);\n\t} else {\n\t\treturn (obj: unknown): obj is T =>\n\t\t\ttypeof obj === 'number'\n\t\t\t&& obj !== 0\n\t\t\t&& options.filter((v) => (v & obj) === v).reduce((acc, v) => acc | v, 0) === obj;\n\t}\n};\n\n/**\n * Validates if a value is a valid part of a string enumeration.\n *\n * @param e - The enumeration to check\n *\n * @public\n */\nexport const isStringEnumeration = <T extends Record<string, string>>(e: T): TypeGuard<T> => {\n\tconst options: unknown[] = Object.values(e);\n\treturn (obj: unknown): obj is T => options.includes(obj);\n};\n\n/**\n * Helper for asserting nothing at all.\n *\n * Note: this is very rarely useful. You probably want isSet. isAny\n * allows null and undefined through as well - it matches TypeScripts type\n * and simply returns a static true because anything is an any.\n *\n * You can use isSet to validate that a value is non-null then let TypeScript\n * widen it back to any in your interface.\n *\n * @public\n */\nexport const isAny: TypeGuard<unknown> = (_a: unknown): _a is unknown => true;\n\n/**\n * Alias for isAny.\n *\n * @see isAny\n * @public\n */\nexport const isUnknown = isAny;\n\n/**\n * Helper for exhaustiveness checking.\n *\n * @public\n */\nexport const isNever = (n: never): never => {\n\t// eslint-disable-next-line @typescript-eslint/restrict-template-expressions\n\tthrow Error(`Unexpected value when expecting never: ${n}`);\n};\n", "/**\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/.\n */\n\nimport type { MappedTypeGuard, PartialTypeGuard, TypeGuard } from './guards.js';\nimport { combine } from './utils.js';\nimport { isObject } from './primitives.js';\n\n/**\n * Validates that a given object has a property of a given type.\n *\n * @public\n */\nexport const hasProperty\n\t= <K extends string, V>(property: K, value: TypeGuard<V>): PartialTypeGuard<object, Record<K, V>> =>\n\t\t(o: object): o is Record<K, V> =>\n\t\t// If the property exists and conforms to the value type guard.\n\t\t\tvalue((o as Record<string, unknown>)[property]);\n\n/**\n * Validates that a given object has an optional property of a given type.\n *\n * @public\n */\nexport const hasOptionalProperty\n\t= <K extends string, V>(property: K, value: TypeGuard<V>): PartialTypeGuard<object, Partial<Record<K, V>>> =>\n\t\t(o: object): o is Partial<Record<K, V>> =>\n\t\t\t!(property in o)\n\t\t\t// If the property exists and conforms to the value type guard.\n\t\t\t|| value((o as Record<string, unknown>)[property]);\n\n/**\n * Validate that a variable is an object with a single field.\n *\n * If you need multiple fields then use hasProperties.\n *\n * @public\n */\nexport const isRecord\n\t= <K extends string, V>(property: K, value: TypeGuard<V>): TypeGuard<Record<K, V>> =>\n\t\t(o: unknown): o is Record<K, V> =>\n\t\t\tisObject(o) && hasProperty(property, value)(o);\n\n/**\n * Validates that a given object has a string index signature.\n *\n * @param enforce - Whether to enforce that there is at least one property already set. Be careful setting this to\n * false, you will get some unexpected outputs, for instance arrays will have a string index signature.\n *\n * @public\n */\nexport const hasStringIndexSignature\n\t= <V>(value: TypeGuard<V>, enforce = true): PartialTypeGuard<object, Record<string, V>> =>\n\t\t(o: object): o is Record<string, V> => {\n\t\t\tlet n = 0;\n\t\t\tfor (const prop in o) {\n\t\t\t\tif (isNaN(parseInt(prop, 10))) {\n\t\t\t\t\tif (value((o as Record<string, unknown>)[prop])) {\n\t\t\t\t\t\tn++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn !enforce || n > 0;\n\t\t};\n\n/**\n * Validates that a given object has a numeric index signature.\n *\n * @param enforce - Whether to enforce that there is at least one property already set. Be careful setting this to\n * false, you will get some unexpected outputs, for instance objects will have a numeric index signature.\n *\n * @public\n */\nexport const hasNumericIndexSignature\n\t= <V>(value: TypeGuard<V>, enforce = true): PartialTypeGuard<object, Record<number, V>> =>\n\t\t(o: object): o is Record<string, V> => {\n\t\t\tlet n = 0;\n\t\t\tfor (const prop in o) {\n\t\t\t\tif (!isNaN(parseInt(prop, 10))) {\n\t\t\t\t// We still index as a string here because prop is a string.\n\t\t\t\t\tif (value((o as Record<string, unknown>)[prop])) {\n\t\t\t\t\t\tn++;\n\t\t\t\t\t} else {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn !enforce || n > 0;\n\t\t};\n\n/**\n * Validates that a given object is an instance of a class.\n *\n * @public\n */\nexport const isInstance\n\t= <T extends object>(klass: abstract new (...args: never[]) => T): TypeGuard<T> =>\n\t\t(o: unknown): o is T =>\n\t\t\to instanceof klass;\n\n/**\n * Validate that a given object has all the given properties\n *\n * @param props - a MappedGuard of the object to be validated, i.e. an object that has the same properties as the\n * object being validated whose types are TypeGuards for the matching type on the original property.\n *\n * @public\n */\nexport const hasProperties\n\t= <V extends object>(props: MappedTypeGuard<V>): PartialTypeGuard<object, V> =>\n\t\t(o: object): o is V => {\n\t\t\tfor (const prop in props) {\n\t\t\t\tif (!hasProperty(prop, props[prop])(o)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t};\n\n/**\n * Validate that a given object only has the given properties\n *\n * @param props - A MappedTypeGuard of the object to be validated.\n *\n * @public\n */\nexport const hasOnlyProperties\n\t= <V extends object>(props: MappedTypeGuard<V>): PartialTypeGuard<object, V> =>\n\t\t(o: object): o is V => {\n\t\t\tconst found: Array<keyof typeof props> = [];\n\n\t\t\tfor (const prop in o) {\n\t\t\t\tif (prop in props) {\n\t\t\t\t\tconst propsKey = prop as Extract<keyof typeof props, string>;\n\t\t\t\t\tif (!hasProperty(propsKey, props[propsKey])(o)) {\n\t\t\t\t\t\treturn false;\n\t\t\t\t\t}\n\t\t\t\t\tfound.push(propsKey);\n\t\t\t\t} else {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn found.length === Object.keys(props).length;\n\t\t};\n\n/**\n * Validate that a given object has all the given optional properties\n *\n * @param props - a MappedGuard of the object to be validated, i.e. an object that has the same properties as the\n * object being validated whose types are TypeGuards for the matching type on the original property.\n *\n * @public\n */\nexport const hasOptionalProperties\n\t= <V extends object>(props: MappedTypeGuard<V>): PartialTypeGuard<object, Partial<V>> =>\n\t\t(o: object): o is Partial<V> => {\n\t\t\tfor (const prop in props) {\n\t\t\t\tif (!hasOptionalProperty(prop, props[prop])(o)) {\n\t\t\t\t\treturn false;\n\t\t\t\t}\n\t\t\t}\n\n\t\t\treturn true;\n\t\t};\n\n/**\n * Validate that an object has the fields provided.\n *\n * @public\n */\nexport const isLikeObject = <V extends object>(props: MappedTypeGuard<V>): TypeGuard<V> =>\n\tcombine(isObject, hasProperties(props));\n\n/**\n * Validate that an object has exactly the fields provided.\n *\n * @public\n */\nexport const isExactObject = <V extends object>(props: MappedTypeGuard<V>): TypeGuard<V> =>\n\tcombine(isObject, hasOnlyProperties(props));\n", "/**\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/.\n */\n\nimport type { PartialTypeGuard } from '../guards.js';\n\n/**\n * Check if a value is a union of two types.\n *\n * @public\n */\nexport const isUnion = <B, T extends B, U extends B>(\n\tptt: PartialTypeGuard<B, T>,\n\tptu: PartialTypeGuard<B, U>,\n): PartialTypeGuard<B, T | U> =>\n\t(o: B): o is T | U =>\n\t\tptt(o) || ptu(o);\n\n/**\n * Check if a value is an intersection of two types.\n *\n * @public\n */\nexport const isIntersection = <B, T extends B, U extends B>(\n\tptt: PartialTypeGuard<B, T>,\n\tptu: PartialTypeGuard<B, U>,\n): PartialTypeGuard<B, T & U> =>\n\t(o: B): o is T & U =>\n\t\tptt(o) && ptu(o);\n", "/**\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/.\n */\n\nimport { isUnion } from './functions.js';\nimport type { PartialTypeGuard } from '../guards.js';\n\n/**\n * A small class to help with constructing larger union checkers.\n *\n * @public\n */\nexport class UnionOf<B, T extends B> {\n\tprivate readonly ptt: PartialTypeGuard<B, T>;\n\n\tpublic constructor(ptt: PartialTypeGuard<B, T>) {\n\t\tthis.ptt = ptt;\n\t}\n\n\t/**\n\t * Finalise and return the partial type guard for this builder.\n\t */\n\tpublic get(): PartialTypeGuard<B, T> {\n\t\treturn this.ptt;\n\t}\n\n\t/**\n\t * Add a new option for this union.\n\t */\n\tpublic with<U extends B>(ptv: PartialTypeGuard<B, U>): UnionOf<B, T | U> {\n\t\treturn new UnionOf(isUnion(this.ptt, ptv));\n\t}\n}\n", "/**\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/.\n */\n\nimport { isIntersection } from './functions.js';\nimport type { PartialTypeGuard } from '../guards.js';\n\n/**\n * A small class to help with constructing larger intersection checkers.\n *\n * @public\n */\nexport class IntersectionOf<B, T extends B> {\n\tprivate readonly ptt: PartialTypeGuard<B, T>;\n\n\tpublic constructor(ptt: PartialTypeGuard<B, T>) {\n\t\tthis.ptt = ptt;\n\t}\n\n\t/**\n\t * Finalise and return the partial type guard for this builder.\n\t */\n\tpublic get(): PartialTypeGuard<B, T> {\n\t\treturn this.ptt;\n\t}\n\n\t/**\n\t * Add a new option for this intersection.\n\t */\n\tpublic with<U extends B>(ptu: PartialTypeGuard<B, U>): IntersectionOf<B, T & U> {\n\t\treturn new IntersectionOf(isIntersection(this.ptt, ptu));\n\t}\n}\n", "/**\n * This Source Code Form is subject to the terms of the Mozilla Public\n * License, v. 2.0. If a copy of the MPL was not distributed with this\n * file, You can obtain one at http://mozilla.org/MPL/2.0/.\n */\n\nimport * as o from '../objects.js';\nimport type { MappedTypeGuard, PartialTypeGuard, TypeGuard } from '../guards.js';\nimport { isIntersection } from './functions.js';\nimport { isObjectLike } from '../primitives.js';\n\n// tslint:disable:max-classes-per-file\n\n/**\n * Fluent Builder pattern for creating guards for interface types.\n *\n * @public\n */\nexport interface InterfaceBuilder<T extends object> {\n\t/**\n\t * Finalise and return the type guard which has been built.\n\t */\n\tget: () => TypeGuard<T>;\n\n\t/**\n\t * Add a free-form type guard to this interface as a union.\n\t */\n\twith: <V extends object>(ptv: PartialTypeGuard<object, V>) => InterfaceBuilder<T & V>;\n\n\t/**\n\t * Add a single property to the interface.\n\t *\n\t * @param key - The string key of the property.\n\t * @param ptv - The type guard for this property.\n\t */\n\twithProperty: <K extends string, V>(key: K, ptv: TypeGuard<V>) => InterfaceBuilder<T & Record<K, V>>;\n\n\t/**\n\t * Add a single optional property to the interface.\n\t *\n\t * @param key - The string key of the property.\n\t * @param ptv - The type guard for this property.\n\t */\n\twithOptionalProperty: <K extends string, V>(\n\t\tkey: K,\n\t\tptv: TypeGuard<V>,\n\t) => InterfaceBuilder<T & Partial<Record<K, V>>>;\n\n\t/**\n\t * Add a string index signature to the interface.\n\t *\n\t * @param value - The type guard for values accessed by the index signature.\n\t * @param enforce - Whether to enforce that there is at least one property already set. Be careful setting this to\n\t * false, you will get some unexpected outputs, for instance arrays will have a string index signature.\n\t */\n\twithStringIndexSignature: <V>(value: TypeGuard<V>, enforce?: boolean) => InterfaceBuilder<T & Record<string, V>>;\n\n\t/**\n\t * Add a numeric index signature to the interface.\n\t *\n\t * @param value - The type guard for values accessed by the index signature.\n\t * @param enforce - Whether to enforce that there is at least one property already set. Be careful setting this to\n\t * false, you will get some unexpected outputs, for instance arrays will have a string index signature.\n\t */\n\twithNumericIndexSignature: <V>(value: TypeGuard<V>, enforce?: boolean) => InterfaceBuilder<T & Record<number, V>>;\n\n\t/**\n\t * Add many properties to the interface at once.\n\t *\n\t * @param props - A map of properties to guards to apply to the interface.\n\t */\n\twithProperties: <V extends object>(props: MappedTypeGuard<V>) => InterfaceBuilder<T & V>;\n\n\t/**\n\t * Add many optional properties to the interface at once.\n\t *\n\t * @param props - A map of properties to guards to apply to the interface.\n\t */\n\twithOptionalProperties: <V extends object>(props: MappedTypeGuard<V>) => InterfaceBuilder<T & Partial<V>>;\n}\n\n/**\n * Internal class used to represent each step in the building process.\n */\nclass InterfaceStep<T extends object> implements InterfaceBuilder<T> {\n\tprivate readonly ptt: PartialTypeGuard<object, T>;\n\n\tpublic constructor(ptt: PartialTypeGuard<object, T>) {\n\t\tthis.ptt = ptt;\n\t}\n\n\tpublic get(): TypeGuard<T> {\n\t\treturn (obj): obj is T => isObjectLike(obj) && this.ptt(obj);\n\t}\n\n\tpublic with<V extends object>(ptv: PartialTypeGuard<object, V>): InterfaceBuilder<T & V> {\n\t\treturn new InterfaceStep<T & V>(isIntersection(this.ptt, ptv));\n\t}\n\n\tpublic withProperty<K extends string, V>(key: K, ptv: TypeGuard<V>): InterfaceBuilder<T & Record<K, V>> {\n\t\treturn new InterfaceStep(isIntersection(this.ptt, o.hasProperty(key, ptv)));\n\t}\n\n\tpublic withOptionalProperty<K extends string, V>(\n\t\tkey: K,\n\t\tptv: TypeGuard<V>,\n\t): InterfaceBuilder<T & Partial<Record<K, V>>> {\n\t\treturn new InterfaceStep(isIntersection(this.ptt, o.hasOptionalProperty(key, ptv)));\n\t}\n\n\tpublic withStringIndexSignature<V>(value: TypeGuard<V>, enforce = true): InterfaceBuilder<T & Record<string, V>> {\n\t\treturn new InterfaceStep(isIntersection(this.ptt, o.hasStringIndexSignature(value, enforce)));\n\t}\n\n\tpublic withNumericIndexSignature<V>(value: TypeGuard<V>, enforce = true): InterfaceBuilder<T & Record<number, V>> {\n\t\treturn new InterfaceStep(isIntersection(this.ptt, o.hasNumericIndexSignature(value, enforce)));\n\t}\n\n\tpublic withProperties<V extends object>(props: MappedTypeGuard<V>): InterfaceBuilder<T & V> {\n\t\treturn new InterfaceStep(isIntersection(this.ptt, o.hasProperties(props)));\n\t}\n\n\tpublic withOptionalProperties<V extends object>(props: MappedTypeGuard<V>): InterfaceBuilder<T & Partial<V>> {\n\t\treturn new InterfaceStep(isIntersection(this.ptt, o.hasOptionalProperties(props)));\n\t}\n}\n\n/**\n * A small class to help with constructing interface guards.\n *\n * @public\n */\nexport class IsInterface implements InterfaceBuilder<object> {\n\tpublic get(): TypeGuard<object> {\n\t\treturn isObjectLike;\n\t}\n\n\tpublic with<V extends object>(ptv: PartialTypeGuard<object, V>): InterfaceBuilder<V> {\n\t\treturn new InterfaceStep(ptv);\n\t}\n\n\tpublic withProperty<K extends string, V>(key: K, ptv: TypeGuard<V>): InterfaceBuilder<Record<K, V>> {\n\t\treturn new InterfaceStep(o.hasProperty(key, ptv));\n\t}\n\n\tpublic withOptionalProperty<K extends string, V>(\n\t\tkey: K,\n\t\tptv: TypeGuard<V>,\n\t): InterfaceBuilder<object & Partial<Record<K, V>>> {\n\t\treturn new InterfaceStep(o.hasOptionalProperty(key, ptv));\n\t}\n\n\tpublic withStringIndexSignature<V>(value: TypeGuard<V>, enforce = true): InterfaceBuilder<Record<string, V>> {\n\t\treturn new InterfaceStep(o.hasStringIndexSignature(value, enforce));\n\t}\n\n\tpublic withNumericIndexSignature<V>(value: TypeGuard<V>, enforce = true): InterfaceBuilder<Record<number, V>> {\n\t\treturn new InterfaceStep(o.hasNumericIndexSignature(value, enforce));\n\t}\n\n\tpublic withProperties<V extends object>(props: MappedTypeGuard<V>): InterfaceBuilder<object & V> {\n\t\treturn new InterfaceStep(o.hasProperties(props));\n\t}\n\n\tpublic withOptionalProperties<V extends object>(props: MappedTypeGuard<V>): InterfaceBuilder<object & Partial<V>> {\n\t\treturn new InterfaceStep(o.hasOptionalProperties(props));\n\t}\n}\n"],
"mappings": ";;;;;;;;;;;;;;;;;;;;AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;ACaA,IAAA;;EAAA,SAAA,QAAA;AAAoC,cAAAA,iBAAA,MAAA;AACnC,aAAAA,gBACQ,OACP,SAAgB;AAEhB,UAAA,QAAA,OAAK,KAAA,MAAC,OAAO,KAAC;AAHP,YAAA,QAAA;AAKP,YAAK,OAAO,MAAK,YAAY;;IAC9B;AACD,WAAAA;EAAA,EAToC,UAAU;;AAoBvC,IAAM,SAI8B,SAAC,OAAO,OAAO,SAAO;AAChE,MAAI,CAAC,MAAM,KAAK,GAAG;AAClB,UAAM,IAAI,eAAe,OAAO,YAAO,QAAP,YAAO,SAAP,UAAW,2BAAA,OAA2B,KAAK,UAAU,KAAK,CAAC,CAAE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