@sinclair/typebox 0.32.33 → 0.32.35
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/cjs/errors/errors.js +2 -2
- package/build/cjs/errors/function.js +4 -5
- package/build/cjs/type/any/any.js +1 -2
- package/build/cjs/type/array/array.js +1 -2
- package/build/cjs/type/async-iterator/async-iterator.js +1 -2
- package/build/cjs/type/awaited/awaited.js +1 -2
- package/build/cjs/type/bigint/bigint.js +1 -2
- package/build/cjs/type/boolean/boolean.js +1 -2
- package/build/cjs/type/clone/type.js +2 -3
- package/build/cjs/type/clone/value.js +1 -2
- package/build/cjs/type/composite/composite.js +1 -2
- package/build/cjs/type/const/const.js +1 -2
- package/build/cjs/type/constructor/constructor.js +1 -2
- package/build/cjs/type/constructor-parameters/constructor-parameters.js +1 -2
- package/build/cjs/type/date/date.js +1 -2
- package/build/cjs/type/deref/deref.js +1 -2
- package/build/cjs/type/discard/discard.js +1 -2
- package/build/cjs/type/enum/enum.js +1 -2
- package/build/cjs/type/exclude/exclude-from-mapped-result.js +1 -2
- package/build/cjs/type/exclude/exclude-from-template-literal.js +1 -2
- package/build/cjs/type/exclude/exclude.js +1 -2
- package/build/cjs/type/extends/extends-check.js +2 -2
- package/build/cjs/type/extends/extends-from-mapped-key.js +1 -2
- package/build/cjs/type/extends/extends-from-mapped-result.js +1 -2
- package/build/cjs/type/extends/extends-undefined.js +1 -2
- package/build/cjs/type/extends/extends.js +1 -2
- package/build/cjs/type/extract/extract-from-mapped-result.js +1 -2
- package/build/cjs/type/extract/extract-from-template-literal.js +1 -2
- package/build/cjs/type/extract/extract.js +1 -2
- package/build/cjs/type/function/function.js +1 -2
- package/build/cjs/type/guard/kind.js +45 -46
- package/build/cjs/type/guard/type.js +48 -48
- package/build/cjs/type/guard/value.js +15 -16
- package/build/cjs/type/helpers/helpers.js +1 -2
- package/build/cjs/type/indexed/indexed-from-mapped-key.js +1 -2
- package/build/cjs/type/indexed/indexed-from-mapped-result.js +1 -2
- package/build/cjs/type/indexed/indexed-property-keys.js +1 -2
- package/build/cjs/type/indexed/indexed.js +3 -4
- package/build/cjs/type/instance-type/instance-type.js +1 -2
- package/build/cjs/type/integer/integer.js +1 -2
- package/build/cjs/type/intersect/intersect-create.js +1 -2
- package/build/cjs/type/intersect/intersect-evaluated.js +1 -2
- package/build/cjs/type/intersect/intersect.js +1 -2
- package/build/cjs/type/intrinsic/capitalize.js +1 -2
- package/build/cjs/type/intrinsic/intrinsic-from-mapped-key.js +1 -2
- package/build/cjs/type/intrinsic/intrinsic.js +1 -2
- package/build/cjs/type/intrinsic/lowercase.js +1 -2
- package/build/cjs/type/intrinsic/uncapitalize.js +1 -2
- package/build/cjs/type/intrinsic/uppercase.js +1 -2
- package/build/cjs/type/iterator/iterator.js +1 -2
- package/build/cjs/type/keyof/keyof-from-mapped-result.js +1 -2
- package/build/cjs/type/keyof/keyof-property-entries.js +1 -2
- package/build/cjs/type/keyof/keyof-property-keys.js +2 -3
- package/build/cjs/type/keyof/keyof.js +2 -3
- package/build/cjs/type/literal/literal.js +1 -2
- package/build/cjs/type/mapped/mapped-key.js +1 -2
- package/build/cjs/type/mapped/mapped-result.js +1 -2
- package/build/cjs/type/mapped/mapped.js +2 -3
- package/build/cjs/type/never/never.js +1 -2
- package/build/cjs/type/not/not.js +1 -2
- package/build/cjs/type/null/null.js +1 -2
- package/build/cjs/type/number/number.js +1 -2
- package/build/cjs/type/omit/omit-from-mapped-key.js +1 -2
- package/build/cjs/type/omit/omit-from-mapped-result.js +1 -2
- package/build/cjs/type/omit/omit.js +1 -2
- package/build/cjs/type/optional/optional-from-mapped-result.js +1 -2
- package/build/cjs/type/optional/optional.js +1 -2
- package/build/cjs/type/parameters/parameters.js +1 -2
- package/build/cjs/type/partial/partial-from-mapped-result.js +1 -2
- package/build/cjs/type/partial/partial.js +1 -2
- package/build/cjs/type/patterns/patterns.d.ts +2 -0
- package/build/cjs/type/patterns/patterns.js +3 -1
- package/build/cjs/type/pick/pick-from-mapped-key.js +1 -2
- package/build/cjs/type/pick/pick-from-mapped-result.js +1 -2
- package/build/cjs/type/pick/pick.d.ts +2 -2
- package/build/cjs/type/pick/pick.js +1 -2
- package/build/cjs/type/promise/promise.js +1 -2
- package/build/cjs/type/readonly/readonly-from-mapped-result.js +1 -2
- package/build/cjs/type/readonly/readonly.js +1 -2
- package/build/cjs/type/readonly-optional/readonly-optional.js +1 -2
- package/build/cjs/type/record/record.d.ts +4 -1
- package/build/cjs/type/record/record.js +12 -3
- package/build/cjs/type/recursive/recursive.js +1 -2
- package/build/cjs/type/ref/ref.js +1 -2
- package/build/cjs/type/regexp/regexp.js +1 -2
- package/build/cjs/type/registry/format.js +6 -7
- package/build/cjs/type/registry/type.js +6 -7
- package/build/cjs/type/required/required-from-mapped-result.js +1 -2
- package/build/cjs/type/required/required.js +1 -2
- package/build/cjs/type/rest/rest.js +1 -2
- package/build/cjs/type/return-type/return-type.js +1 -2
- package/build/cjs/type/sets/set.js +8 -9
- package/build/cjs/type/strict/strict.js +1 -2
- package/build/cjs/type/string/string.js +1 -2
- package/build/cjs/type/symbol/symbol.js +1 -2
- package/build/cjs/type/template-literal/finite.js +3 -3
- package/build/cjs/type/template-literal/generate.d.ts +1 -1
- package/build/cjs/type/template-literal/generate.js +3 -3
- package/build/cjs/type/template-literal/parse.js +3 -3
- package/build/cjs/type/template-literal/pattern.js +2 -2
- package/build/cjs/type/template-literal/syntax.js +1 -2
- package/build/cjs/type/template-literal/template-literal.js +1 -2
- package/build/cjs/type/template-literal/union.js +1 -2
- package/build/cjs/type/transform/transform.js +2 -2
- package/build/cjs/type/tuple/tuple.js +1 -2
- package/build/cjs/type/type/index.d.ts +1 -1
- package/build/cjs/type/uint8array/uint8array.js +1 -2
- package/build/cjs/type/undefined/undefined.js +1 -2
- package/build/cjs/type/union/union-create.js +1 -2
- package/build/cjs/type/union/union-evaluated.js +1 -2
- package/build/cjs/type/union/union.js +1 -2
- package/build/cjs/type/unknown/unknown.js +1 -2
- package/build/cjs/type/unsafe/unsafe.js +1 -2
- package/build/cjs/type/void/void.js +1 -2
- package/build/cjs/value/cast/cast.js +2 -2
- package/build/cjs/value/check/check.js +2 -2
- package/build/cjs/value/clean/clean.js +1 -2
- package/build/cjs/value/clone/clone.js +1 -2
- package/build/cjs/value/convert/convert.js +4 -2
- package/build/cjs/value/create/create.js +2 -2
- package/build/cjs/value/default/default.js +1 -2
- package/build/cjs/value/delta/delta.js +3 -3
- package/build/cjs/value/deref/deref.js +2 -2
- package/build/cjs/value/equal/equal.js +1 -2
- package/build/cjs/value/guard/guard.js +34 -35
- package/build/cjs/value/hash/hash.js +2 -2
- package/build/cjs/value/mutate/mutate.js +2 -2
- package/build/cjs/value/pointer/pointer.js +6 -6
- package/build/cjs/value/transform/decode.js +2 -2
- package/build/cjs/value/transform/encode.js +2 -2
- package/build/cjs/value/transform/has.js +1 -2
- package/build/cjs/value/value/value.js +15 -16
- package/build/esm/errors/function.mjs +1 -1
- package/build/esm/type/patterns/patterns.d.mts +2 -0
- package/build/esm/type/patterns/patterns.mjs +2 -0
- package/build/esm/type/pick/pick.d.mts +2 -2
- package/build/esm/type/record/record.d.mts +4 -1
- package/build/esm/type/record/record.mjs +13 -3
- package/build/esm/type/template-literal/generate.d.mts +1 -1
- package/build/esm/type/type/index.d.mts +1 -1
- package/build/esm/value/convert/convert.mjs +3 -0
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Partial =
|
|
4
|
+
exports.Partial = Partial;
|
|
5
5
|
const index_1 = require("../optional/index");
|
|
6
6
|
const index_2 = require("../object/index");
|
|
7
7
|
const index_3 = require("../intersect/index");
|
|
@@ -43,4 +43,3 @@ function Partial(T, options = {}) {
|
|
|
43
43
|
const R = (0, type_1.CloneType)(PartialResolve(T), options);
|
|
44
44
|
return { ...D, ...R };
|
|
45
45
|
}
|
|
46
|
-
exports.Partial = Partial;
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
export declare const PatternBoolean = "(true|false)";
|
|
2
2
|
export declare const PatternNumber = "(0|[1-9][0-9]*)";
|
|
3
3
|
export declare const PatternString = "(.*)";
|
|
4
|
+
export declare const PatternNever = "(?!.*)";
|
|
4
5
|
export declare const PatternBooleanExact = "^(true|false)$";
|
|
5
6
|
export declare const PatternNumberExact = "^(0|[1-9][0-9]*)$";
|
|
6
7
|
export declare const PatternStringExact = "^(.*)$";
|
|
8
|
+
export declare const PatternNeverExact = "^(?!.*)$";
|
|
@@ -1,10 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.PatternStringExact = exports.PatternNumberExact = exports.PatternBooleanExact = exports.PatternString = exports.PatternNumber = exports.PatternBoolean = void 0;
|
|
4
|
+
exports.PatternNeverExact = exports.PatternStringExact = exports.PatternNumberExact = exports.PatternBooleanExact = exports.PatternNever = exports.PatternString = exports.PatternNumber = exports.PatternBoolean = void 0;
|
|
5
5
|
exports.PatternBoolean = '(true|false)';
|
|
6
6
|
exports.PatternNumber = '(0|[1-9][0-9]*)';
|
|
7
7
|
exports.PatternString = '(.*)';
|
|
8
|
+
exports.PatternNever = '(?!.*)';
|
|
8
9
|
exports.PatternBooleanExact = `^${exports.PatternBoolean}$`;
|
|
9
10
|
exports.PatternNumberExact = `^${exports.PatternNumber}$`;
|
|
10
11
|
exports.PatternStringExact = `^${exports.PatternString}$`;
|
|
12
|
+
exports.PatternNeverExact = `^${exports.PatternNever}$`;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.PickFromMappedKey =
|
|
4
|
+
exports.PickFromMappedKey = PickFromMappedKey;
|
|
5
5
|
const index_1 = require("../mapped/index");
|
|
6
6
|
const pick_1 = require("./pick");
|
|
7
7
|
// prettier-ignore
|
|
@@ -25,4 +25,3 @@ function PickFromMappedKey(T, K, options) {
|
|
|
25
25
|
const P = FromMappedKey(T, K, options);
|
|
26
26
|
return (0, index_1.MappedResult)(P);
|
|
27
27
|
}
|
|
28
|
-
exports.PickFromMappedKey = PickFromMappedKey;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.PickFromMappedResult =
|
|
4
|
+
exports.PickFromMappedResult = PickFromMappedResult;
|
|
5
5
|
const index_1 = require("../mapped/index");
|
|
6
6
|
const pick_1 = require("./pick");
|
|
7
7
|
// prettier-ignore
|
|
@@ -20,4 +20,3 @@ function PickFromMappedResult(R, K, options) {
|
|
|
20
20
|
const P = FromMappedResult(R, K, options);
|
|
21
21
|
return (0, index_1.MappedResult)(P);
|
|
22
22
|
}
|
|
23
|
-
exports.PickFromMappedResult = PickFromMappedResult;
|
|
@@ -9,9 +9,9 @@ import { type TIndexPropertyKeys } from '../indexed/index';
|
|
|
9
9
|
import { type TPickFromMappedKey } from './pick-from-mapped-key';
|
|
10
10
|
import { type TPickFromMappedResult } from './pick-from-mapped-result';
|
|
11
11
|
type FromIntersect<T extends TSchema[], K extends PropertyKey[], Acc extends TSchema[] = []> = T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? FromIntersect<R, K, [...Acc, TPick<L, K>]> : Acc;
|
|
12
|
-
declare function FromIntersect<T extends TSchema[], K extends PropertyKey[]>(T: T, K: K): FromIntersect<T, K
|
|
12
|
+
declare function FromIntersect<T extends TSchema[], K extends PropertyKey[]>(T: T, K: K): FromIntersect<T, K>;
|
|
13
13
|
type FromUnion<T extends TSchema[], K extends PropertyKey[], Acc extends TSchema[] = []> = T extends [infer L extends TSchema, ...infer R extends TSchema[]] ? FromUnion<R, K, [...Acc, TPick<L, K>]> : Acc;
|
|
14
|
-
declare function FromUnion<T extends TSchema[], K extends PropertyKey[]>(T: T, K: K): FromUnion<T, K
|
|
14
|
+
declare function FromUnion<T extends TSchema[], K extends PropertyKey[]>(T: T, K: K): FromUnion<T, K>;
|
|
15
15
|
type FromProperties<T extends TProperties, K extends PropertyKey[], I extends PropertyKey = TupleToUnion<K>> = Evaluate<Pick<T, I & keyof T>>;
|
|
16
16
|
declare function FromProperties<T extends TProperties, K extends PropertyKey[]>(T: T, K: K): never;
|
|
17
17
|
export type TPick<T extends TProperties, K extends PropertyKey[]> = T extends TRecursive<infer S> ? TRecursive<TPick<S, K>> : T extends TIntersect<infer S> ? TIntersect<FromIntersect<S, K>> : T extends TUnion<infer S> ? TUnion<FromUnion<S, K>> : T extends TObject<infer S> ? TObject<FromProperties<S, K>> : TObject<{}>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Pick =
|
|
4
|
+
exports.Pick = Pick;
|
|
5
5
|
const index_1 = require("../intersect/index");
|
|
6
6
|
const index_2 = require("../union/index");
|
|
7
7
|
const index_3 = require("../object/index");
|
|
@@ -52,4 +52,3 @@ function Pick(T, K, options = {}) {
|
|
|
52
52
|
const R = (0, type_1.CloneType)(PickResolve(T, I), options);
|
|
53
53
|
return { ...D, ...R };
|
|
54
54
|
}
|
|
55
|
-
exports.Pick = Pick;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Promise =
|
|
4
|
+
exports.Promise = Promise;
|
|
5
5
|
const type_1 = require("../clone/type");
|
|
6
6
|
const index_1 = require("../symbols/index");
|
|
7
7
|
/** `[JavaScript]` Creates a Promise type */
|
|
@@ -13,4 +13,3 @@ function Promise(item, options = {}) {
|
|
|
13
13
|
item: (0, type_1.CloneType)(item),
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
exports.Promise = Promise;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.ReadonlyFromMappedResult =
|
|
4
|
+
exports.ReadonlyFromMappedResult = ReadonlyFromMappedResult;
|
|
5
5
|
const index_1 = require("../mapped/index");
|
|
6
6
|
const readonly_1 = require("./readonly");
|
|
7
7
|
// prettier-ignore
|
|
@@ -20,4 +20,3 @@ function ReadonlyFromMappedResult(R, F) {
|
|
|
20
20
|
const P = FromMappedResult(R, F);
|
|
21
21
|
return (0, index_1.MappedResult)(P);
|
|
22
22
|
}
|
|
23
|
-
exports.ReadonlyFromMappedResult = ReadonlyFromMappedResult;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Readonly =
|
|
4
|
+
exports.Readonly = Readonly;
|
|
5
5
|
const index_1 = require("../symbols/index");
|
|
6
6
|
const type_1 = require("../clone/type");
|
|
7
7
|
const index_2 = require("../discard/index");
|
|
@@ -24,4 +24,3 @@ function Readonly(schema, enable) {
|
|
|
24
24
|
const F = enable ?? true;
|
|
25
25
|
return (0, kind_1.IsMappedResult)(schema) ? (0, readonly_from_mapped_result_1.ReadonlyFromMappedResult)(schema, F) : ReadonlyWithFlag(schema, F);
|
|
26
26
|
}
|
|
27
|
-
exports.Readonly = Readonly;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.ReadonlyOptional =
|
|
4
|
+
exports.ReadonlyOptional = ReadonlyOptional;
|
|
5
5
|
const index_1 = require("../readonly/index");
|
|
6
6
|
const index_2 = require("../optional/index");
|
|
7
7
|
/** `[Json]` Creates a Readonly and Optional property */
|
|
8
8
|
function ReadonlyOptional(schema) {
|
|
9
9
|
return (0, index_1.Readonly)((0, index_2.Optional)(schema));
|
|
10
10
|
}
|
|
11
|
-
exports.ReadonlyOptional = ReadonlyOptional;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { TSchema } from '../schema/index';
|
|
2
2
|
import type { Static } from '../static/index';
|
|
3
3
|
import type { Evaluate, Ensure, Assert } from '../helpers/index';
|
|
4
|
+
import { type TAny } from '../any/index';
|
|
4
5
|
import { type TObject, type TProperties, type TAdditionalProperties, type ObjectOptions } from '../object/index';
|
|
5
6
|
import { type TLiteral, type TLiteralValue } from '../literal/index';
|
|
6
7
|
import { type TNever } from '../never/index';
|
|
@@ -33,6 +34,8 @@ type TFromLiteralKey<K extends TLiteralValue, T extends TSchema> = (Ensure<TObje
|
|
|
33
34
|
}>>);
|
|
34
35
|
type TFromRegExpKey<_ extends TRegExp, T extends TSchema> = (Ensure<TRecord<TRegExp, T>>);
|
|
35
36
|
type TFromStringKey<_ extends TString, T extends TSchema> = (Ensure<TRecord<TString, T>>);
|
|
37
|
+
type TFromAnyKey<_ extends TAny, T extends TSchema> = (Ensure<TRecord<TAny, T>>);
|
|
38
|
+
type TFromNeverKey<_ extends TNever, T extends TSchema> = (Ensure<TRecord<TNever, T>>);
|
|
36
39
|
type TFromIntegerKey<_ extends TSchema, T extends TSchema> = (Ensure<TRecord<TNumber, T>>);
|
|
37
40
|
type TFromNumberKey<_ extends TSchema, T extends TSchema> = (Ensure<TRecord<TNumber, T>>);
|
|
38
41
|
type RecordStatic<K extends TSchema, T extends TSchema, P extends unknown[]> = (Evaluate<{
|
|
@@ -47,7 +50,7 @@ export interface TRecord<K extends TSchema = TSchema, T extends TSchema = TSchem
|
|
|
47
50
|
};
|
|
48
51
|
additionalProperties: TAdditionalProperties;
|
|
49
52
|
}
|
|
50
|
-
export type TRecordOrObject<K extends TSchema, T extends TSchema> = K extends TTemplateLiteral ? TFromTemplateLiteralKey<K, T> : K extends TEnum<infer S> ? TFromEnumKey<S, T> : K extends TUnion<infer S> ? TFromUnionKey<S, T> : K extends TLiteral<infer S> ? TFromLiteralKey<S, T> : K extends TInteger ? TFromIntegerKey<K, T> : K extends TNumber ? TFromNumberKey<K, T> : K extends TRegExp ? TFromRegExpKey<K, T> : K extends TString ? TFromStringKey<K, T> : TNever;
|
|
53
|
+
export type TRecordOrObject<K extends TSchema, T extends TSchema> = K extends TTemplateLiteral ? TFromTemplateLiteralKey<K, T> : K extends TEnum<infer S> ? TFromEnumKey<S, T> : K extends TUnion<infer S> ? TFromUnionKey<S, T> : K extends TLiteral<infer S> ? TFromLiteralKey<S, T> : K extends TInteger ? TFromIntegerKey<K, T> : K extends TNumber ? TFromNumberKey<K, T> : K extends TRegExp ? TFromRegExpKey<K, T> : K extends TString ? TFromStringKey<K, T> : K extends TAny ? TFromAnyKey<K, T> : K extends TNever ? TFromNeverKey<K, T> : TNever;
|
|
51
54
|
/** `[Json]` Creates a Record type */
|
|
52
55
|
export declare function Record<K extends TSchema, T extends TSchema>(K: K, T: T, options?: ObjectOptions): TRecordOrObject<K, T>;
|
|
53
56
|
export {};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Record =
|
|
4
|
+
exports.Record = Record;
|
|
5
5
|
const index_1 = require("../object/index");
|
|
6
6
|
const index_2 = require("../never/index");
|
|
7
7
|
const index_3 = require("../union/index");
|
|
@@ -64,6 +64,14 @@ function FromStringKey(K, T, options) {
|
|
|
64
64
|
return RecordCreateFromPattern(pattern, T, options);
|
|
65
65
|
}
|
|
66
66
|
// prettier-ignore
|
|
67
|
+
function FromAnyKey(K, T, options) {
|
|
68
|
+
return RecordCreateFromPattern(index_5.PatternStringExact, T, options);
|
|
69
|
+
}
|
|
70
|
+
// prettier-ignore
|
|
71
|
+
function FromNeverKey(K, T, options) {
|
|
72
|
+
return RecordCreateFromPattern(index_5.PatternNeverExact, T, options);
|
|
73
|
+
}
|
|
74
|
+
// prettier-ignore
|
|
67
75
|
function FromIntegerKey(_, T, options) {
|
|
68
76
|
return RecordCreateFromPattern(index_5.PatternNumberExact, T, options);
|
|
69
77
|
}
|
|
@@ -84,6 +92,7 @@ function Record(K, T, options = {}) {
|
|
|
84
92
|
(0, kind_1.IsNumber)(K) ? FromNumberKey(K, T, options) :
|
|
85
93
|
(0, kind_1.IsRegExp)(K) ? FromRegExpKey(K, T, options) :
|
|
86
94
|
(0, kind_1.IsString)(K) ? FromStringKey(K, T, options) :
|
|
87
|
-
(0,
|
|
95
|
+
(0, kind_1.IsAny)(K) ? FromAnyKey(K, T, options) :
|
|
96
|
+
(0, kind_1.IsNever)(K) ? FromNeverKey(K, T, options) :
|
|
97
|
+
(0, index_2.Never)(options));
|
|
88
98
|
}
|
|
89
|
-
exports.Record = Record;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Recursive =
|
|
4
|
+
exports.Recursive = Recursive;
|
|
5
5
|
const type_1 = require("../clone/type");
|
|
6
6
|
const value_1 = require("../guard/value");
|
|
7
7
|
const index_1 = require("../symbols/index");
|
|
@@ -16,4 +16,3 @@ function Recursive(callback, options = {}) {
|
|
|
16
16
|
// prettier-ignore
|
|
17
17
|
return (0, type_1.CloneType)({ ...options, [index_1.Hint]: 'Recursive', ...thisType });
|
|
18
18
|
}
|
|
19
|
-
exports.Recursive = Recursive;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Ref =
|
|
4
|
+
exports.Ref = Ref;
|
|
5
5
|
const index_1 = require("../symbols/index");
|
|
6
6
|
// ------------------------------------------------------------------
|
|
7
7
|
// ValueGuard
|
|
@@ -19,4 +19,3 @@ function Ref(unresolved, options = {}) {
|
|
|
19
19
|
$ref: unresolved.$id,
|
|
20
20
|
};
|
|
21
21
|
}
|
|
22
|
-
exports.Ref = Ref;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.RegExp =
|
|
4
|
+
exports.RegExp = RegExp;
|
|
5
5
|
const value_1 = require("../guard/value");
|
|
6
6
|
const index_1 = require("../symbols/index");
|
|
7
7
|
/** `[JavaScript]` Creates a RegExp type */
|
|
@@ -9,4 +9,3 @@ function RegExp(unresolved, options = {}) {
|
|
|
9
9
|
const expr = (0, value_1.IsString)(unresolved) ? new globalThis.RegExp(unresolved) : unresolved;
|
|
10
10
|
return { ...options, [index_1.Kind]: 'RegExp', type: 'RegExp', source: expr.source, flags: expr.flags };
|
|
11
11
|
}
|
|
12
|
-
exports.RegExp = RegExp;
|
|
@@ -1,36 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.Entries = Entries;
|
|
5
|
+
exports.Clear = Clear;
|
|
6
|
+
exports.Delete = Delete;
|
|
7
|
+
exports.Has = Has;
|
|
8
|
+
exports.Set = Set;
|
|
9
|
+
exports.Get = Get;
|
|
5
10
|
/** A registry for user defined string formats */
|
|
6
11
|
const map = new Map();
|
|
7
12
|
/** Returns the entries in this registry */
|
|
8
13
|
function Entries() {
|
|
9
14
|
return new Map(map);
|
|
10
15
|
}
|
|
11
|
-
exports.Entries = Entries;
|
|
12
16
|
/** Clears all user defined string formats */
|
|
13
17
|
function Clear() {
|
|
14
18
|
return map.clear();
|
|
15
19
|
}
|
|
16
|
-
exports.Clear = Clear;
|
|
17
20
|
/** Deletes a registered format */
|
|
18
21
|
function Delete(format) {
|
|
19
22
|
return map.delete(format);
|
|
20
23
|
}
|
|
21
|
-
exports.Delete = Delete;
|
|
22
24
|
/** Returns true if the user defined string format exists */
|
|
23
25
|
function Has(format) {
|
|
24
26
|
return map.has(format);
|
|
25
27
|
}
|
|
26
|
-
exports.Has = Has;
|
|
27
28
|
/** Sets a validation function for a user defined string format */
|
|
28
29
|
function Set(format, func) {
|
|
29
30
|
map.set(format, func);
|
|
30
31
|
}
|
|
31
|
-
exports.Set = Set;
|
|
32
32
|
/** Gets a validation function for a user defined string format */
|
|
33
33
|
function Get(format) {
|
|
34
34
|
return map.get(format);
|
|
35
35
|
}
|
|
36
|
-
exports.Get = Get;
|
|
@@ -1,36 +1,35 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.Entries = Entries;
|
|
5
|
+
exports.Clear = Clear;
|
|
6
|
+
exports.Delete = Delete;
|
|
7
|
+
exports.Has = Has;
|
|
8
|
+
exports.Set = Set;
|
|
9
|
+
exports.Get = Get;
|
|
5
10
|
/** A registry for user defined types */
|
|
6
11
|
const map = new Map();
|
|
7
12
|
/** Returns the entries in this registry */
|
|
8
13
|
function Entries() {
|
|
9
14
|
return new Map(map);
|
|
10
15
|
}
|
|
11
|
-
exports.Entries = Entries;
|
|
12
16
|
/** Clears all user defined types */
|
|
13
17
|
function Clear() {
|
|
14
18
|
return map.clear();
|
|
15
19
|
}
|
|
16
|
-
exports.Clear = Clear;
|
|
17
20
|
/** Deletes a registered type */
|
|
18
21
|
function Delete(kind) {
|
|
19
22
|
return map.delete(kind);
|
|
20
23
|
}
|
|
21
|
-
exports.Delete = Delete;
|
|
22
24
|
/** Returns true if this registry contains this kind */
|
|
23
25
|
function Has(kind) {
|
|
24
26
|
return map.has(kind);
|
|
25
27
|
}
|
|
26
|
-
exports.Has = Has;
|
|
27
28
|
/** Sets a validation function for a user defined type */
|
|
28
29
|
function Set(kind, func) {
|
|
29
30
|
map.set(kind, func);
|
|
30
31
|
}
|
|
31
|
-
exports.Set = Set;
|
|
32
32
|
/** Gets a custom validation function for a user defined type */
|
|
33
33
|
function Get(kind) {
|
|
34
34
|
return map.get(kind);
|
|
35
35
|
}
|
|
36
|
-
exports.Get = Get;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.RequiredFromMappedResult =
|
|
4
|
+
exports.RequiredFromMappedResult = RequiredFromMappedResult;
|
|
5
5
|
const index_1 = require("../mapped/index");
|
|
6
6
|
const required_1 = require("./required");
|
|
7
7
|
// prettier-ignore
|
|
@@ -20,4 +20,3 @@ function RequiredFromMappedResult(R, options) {
|
|
|
20
20
|
const P = FromMappedResult(R, options);
|
|
21
21
|
return (0, index_1.MappedResult)(P);
|
|
22
22
|
}
|
|
23
|
-
exports.RequiredFromMappedResult = RequiredFromMappedResult;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Required =
|
|
4
|
+
exports.Required = Required;
|
|
5
5
|
const index_1 = require("../intersect/index");
|
|
6
6
|
const index_2 = require("../union/index");
|
|
7
7
|
const index_3 = require("../object/index");
|
|
@@ -45,4 +45,3 @@ function Required(T, options = {}) {
|
|
|
45
45
|
return { ...D, ...R };
|
|
46
46
|
}
|
|
47
47
|
}
|
|
48
|
-
exports.Required = Required;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Rest =
|
|
4
|
+
exports.Rest = Rest;
|
|
5
5
|
const type_1 = require("../clone/type");
|
|
6
6
|
// ------------------------------------------------------------------
|
|
7
7
|
// TypeGuard
|
|
@@ -18,4 +18,3 @@ function RestResolve(T) {
|
|
|
18
18
|
function Rest(T) {
|
|
19
19
|
return (0, type_1.CloneRest)(RestResolve(T));
|
|
20
20
|
}
|
|
21
|
-
exports.Rest = Rest;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.ReturnType =
|
|
4
|
+
exports.ReturnType = ReturnType;
|
|
5
5
|
const type_1 = require("../clone/type");
|
|
6
6
|
/** `[JavaScript]` Extracts the ReturnType from the given Function type */
|
|
7
7
|
function ReturnType(schema, options = {}) {
|
|
8
8
|
return (0, type_1.CloneType)(schema.returns, options);
|
|
9
9
|
}
|
|
10
|
-
exports.ReturnType = ReturnType;
|
|
@@ -1,39 +1,40 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.SetIncludes = SetIncludes;
|
|
5
|
+
exports.SetIsSubset = SetIsSubset;
|
|
6
|
+
exports.SetDistinct = SetDistinct;
|
|
7
|
+
exports.SetIntersect = SetIntersect;
|
|
8
|
+
exports.SetUnion = SetUnion;
|
|
9
|
+
exports.SetComplement = SetComplement;
|
|
10
|
+
exports.SetIntersectMany = SetIntersectMany;
|
|
11
|
+
exports.SetUnionMany = SetUnionMany;
|
|
5
12
|
/** Returns true if element right is in the set of left */
|
|
6
13
|
// prettier-ignore
|
|
7
14
|
function SetIncludes(T, S) {
|
|
8
15
|
return T.includes(S);
|
|
9
16
|
}
|
|
10
|
-
exports.SetIncludes = SetIncludes;
|
|
11
17
|
/** Returns true if left is a subset of right */
|
|
12
18
|
function SetIsSubset(T, S) {
|
|
13
19
|
return T.every((L) => SetIncludes(S, L));
|
|
14
20
|
}
|
|
15
|
-
exports.SetIsSubset = SetIsSubset;
|
|
16
21
|
/** Returns a distinct set of elements */
|
|
17
22
|
function SetDistinct(T) {
|
|
18
23
|
return [...new Set(T)];
|
|
19
24
|
}
|
|
20
|
-
exports.SetDistinct = SetDistinct;
|
|
21
25
|
/** Returns the Intersect of the given sets */
|
|
22
26
|
function SetIntersect(T, S) {
|
|
23
27
|
return T.filter((L) => S.includes(L));
|
|
24
28
|
}
|
|
25
|
-
exports.SetIntersect = SetIntersect;
|
|
26
29
|
/** Returns the Union of the given sets */
|
|
27
30
|
function SetUnion(T, S) {
|
|
28
31
|
return [...T, ...S];
|
|
29
32
|
}
|
|
30
|
-
exports.SetUnion = SetUnion;
|
|
31
33
|
/** Returns the Complement by omitting elements in T that are in S */
|
|
32
34
|
// prettier-ignore
|
|
33
35
|
function SetComplement(T, S) {
|
|
34
36
|
return T.filter(L => !S.includes(L));
|
|
35
37
|
}
|
|
36
|
-
exports.SetComplement = SetComplement;
|
|
37
38
|
// prettier-ignore
|
|
38
39
|
function SetIntersectManyResolve(T, Init) {
|
|
39
40
|
return T.reduce((Acc, L) => {
|
|
@@ -49,7 +50,6 @@ function SetIntersectMany(T) {
|
|
|
49
50
|
? SetIntersectManyResolve(T.slice(1), T[0])
|
|
50
51
|
: []);
|
|
51
52
|
}
|
|
52
|
-
exports.SetIntersectMany = SetIntersectMany;
|
|
53
53
|
/** Returns the Union of multiple sets */
|
|
54
54
|
function SetUnionMany(T) {
|
|
55
55
|
const Acc = [];
|
|
@@ -57,4 +57,3 @@ function SetUnionMany(T) {
|
|
|
57
57
|
Acc.push(...L);
|
|
58
58
|
return Acc;
|
|
59
59
|
}
|
|
60
|
-
exports.SetUnionMany = SetUnionMany;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Strict =
|
|
4
|
+
exports.Strict = Strict;
|
|
5
5
|
/** `[Json]` Omits compositing symbols from this schema. */
|
|
6
6
|
function Strict(schema) {
|
|
7
7
|
return JSON.parse(JSON.stringify(schema));
|
|
8
8
|
}
|
|
9
|
-
exports.Strict = Strict;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.String =
|
|
4
|
+
exports.String = String;
|
|
5
5
|
const index_1 = require("../symbols/index");
|
|
6
6
|
/** `[Json]` Creates a String type */
|
|
7
7
|
function String(options = {}) {
|
|
8
8
|
return { ...options, [index_1.Kind]: 'String', type: 'string' };
|
|
9
9
|
}
|
|
10
|
-
exports.String = String;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Symbol =
|
|
4
|
+
exports.Symbol = Symbol;
|
|
5
5
|
const index_1 = require("../symbols/index");
|
|
6
6
|
/** `[JavaScript]` Creates a Symbol type */
|
|
7
7
|
function Symbol(options) {
|
|
8
8
|
return { ...options, [index_1.Kind]: 'Symbol', type: 'symbol' };
|
|
9
9
|
}
|
|
10
|
-
exports.Symbol = Symbol;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.TemplateLiteralFiniteError = void 0;
|
|
5
|
+
exports.IsTemplateLiteralExpressionFinite = IsTemplateLiteralExpressionFinite;
|
|
6
|
+
exports.IsTemplateLiteralFinite = IsTemplateLiteralFinite;
|
|
5
7
|
const parse_1 = require("./parse");
|
|
6
8
|
const index_1 = require("../error/index");
|
|
7
9
|
// ------------------------------------------------------------------
|
|
@@ -47,10 +49,8 @@ function IsTemplateLiteralExpressionFinite(expression) {
|
|
|
47
49
|
(expression.type === 'const') ? true :
|
|
48
50
|
(() => { throw new TemplateLiteralFiniteError(`Unknown expression type`); })());
|
|
49
51
|
}
|
|
50
|
-
exports.IsTemplateLiteralExpressionFinite = IsTemplateLiteralExpressionFinite;
|
|
51
52
|
/** Returns true if this TemplateLiteral resolves to a finite set of values */
|
|
52
53
|
function IsTemplateLiteralFinite(schema) {
|
|
53
54
|
const expression = (0, parse_1.TemplateLiteralParseExact)(schema.pattern);
|
|
54
55
|
return IsTemplateLiteralExpressionFinite(expression);
|
|
55
56
|
}
|
|
56
|
-
exports.IsTemplateLiteralFinite = IsTemplateLiteralFinite;
|
|
@@ -13,7 +13,7 @@ type TStringReduceBinary<L extends string[], R extends string[], Acc extends str
|
|
|
13
13
|
type TStringReduceMany<T extends string[][]> = T extends [infer L extends string[], infer R extends string[], ...infer Rest extends string[][]] ? TStringReduceMany<[TStringReduceBinary<L, R>, ...Rest]> : T;
|
|
14
14
|
type TStringReduce<T extends string[][], O = TStringReduceMany<T>> = 0 extends keyof O ? Assert<O[0], string[]> : [];
|
|
15
15
|
type TFromTemplateLiteralUnionKinds<T extends TTemplateLiteralKind[]> = T extends [infer L extends TLiteral, ...infer R extends TLiteral[]] ? [`${L['const']}`, ...TFromTemplateLiteralUnionKinds<R>] : [];
|
|
16
|
-
type TFromTemplateLiteralKinds<T extends TTemplateLiteralKind[], Acc extends TLiteralValue[][] = []> = T extends [infer L extends TTemplateLiteralKind, ...infer R extends TTemplateLiteralKind[]] ? (L extends TLiteral<infer S extends TLiteralValue> ? TFromTemplateLiteralKinds<R, [...Acc, [S]]> : L extends TUnion<infer S extends TTemplateLiteralKind[]> ? TFromTemplateLiteralKinds<R, [...Acc, TFromTemplateLiteralUnionKinds<S>]> : L extends TBoolean ? TFromTemplateLiteralKinds<R, [...Acc, ['true', 'false']]> : Acc) : Acc;
|
|
16
|
+
type TFromTemplateLiteralKinds<T extends TTemplateLiteralKind[], Acc extends TLiteralValue[][] = []> = T extends [infer L extends TTemplateLiteralKind, ...infer R extends TTemplateLiteralKind[]] ? (L extends TTemplateLiteral<infer S extends TTemplateLiteralKind[]> ? TFromTemplateLiteralKinds<[...S, ...R], Acc> : L extends TLiteral<infer S extends TLiteralValue> ? TFromTemplateLiteralKinds<R, [...Acc, [S]]> : L extends TUnion<infer S extends TTemplateLiteralKind[]> ? TFromTemplateLiteralKinds<R, [...Acc, TFromTemplateLiteralUnionKinds<S>]> : L extends TBoolean ? TFromTemplateLiteralKinds<R, [...Acc, ['true', 'false']]> : Acc) : Acc;
|
|
17
17
|
export declare function TemplateLiteralExpressionGenerate(expression: Expression): IterableIterator<string>;
|
|
18
18
|
export type TTemplateLiteralGenerate<T extends TTemplateLiteral, F = TIsTemplateLiteralFinite<T>> = F extends true ? (T extends TTemplateLiteral<infer S extends TTemplateLiteralKind[]> ? TFromTemplateLiteralKinds<S> extends infer R extends string[][] ? TStringReduce<R> : [] : []) : [];
|
|
19
19
|
/** Generates a tuple of strings from the given TemplateLiteral. Returns an empty tuple if infinite. */
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.TemplateLiteralGenerateError = void 0;
|
|
5
|
+
exports.TemplateLiteralExpressionGenerate = TemplateLiteralExpressionGenerate;
|
|
6
|
+
exports.TemplateLiteralGenerate = TemplateLiteralGenerate;
|
|
5
7
|
const finite_1 = require("./finite");
|
|
6
8
|
const parse_1 = require("./parse");
|
|
7
9
|
const index_1 = require("../error/index");
|
|
@@ -48,7 +50,6 @@ function* TemplateLiteralExpressionGenerate(expression) {
|
|
|
48
50
|
throw new TemplateLiteralGenerateError('Unknown expression');
|
|
49
51
|
})();
|
|
50
52
|
}
|
|
51
|
-
exports.TemplateLiteralExpressionGenerate = TemplateLiteralExpressionGenerate;
|
|
52
53
|
/** Generates a tuple of strings from the given TemplateLiteral. Returns an empty tuple if infinite. */
|
|
53
54
|
function TemplateLiteralGenerate(schema) {
|
|
54
55
|
const expression = (0, parse_1.TemplateLiteralParseExact)(schema.pattern);
|
|
@@ -57,4 +58,3 @@ function TemplateLiteralGenerate(schema) {
|
|
|
57
58
|
? [...TemplateLiteralExpressionGenerate(expression)]
|
|
58
59
|
: []);
|
|
59
60
|
}
|
|
60
|
-
exports.TemplateLiteralGenerate = TemplateLiteralGenerate;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.TemplateLiteralParserError = void 0;
|
|
5
|
+
exports.TemplateLiteralParse = TemplateLiteralParse;
|
|
6
|
+
exports.TemplateLiteralParseExact = TemplateLiteralParseExact;
|
|
5
7
|
const index_1 = require("../error/index");
|
|
6
8
|
// ------------------------------------------------------------------
|
|
7
9
|
// TemplateLiteralParserError
|
|
@@ -163,7 +165,6 @@ function TemplateLiteralParse(pattern) {
|
|
|
163
165
|
IsPrecedenceAnd(pattern) ? And(pattern) :
|
|
164
166
|
{ type: 'const', const: Unescape(pattern) });
|
|
165
167
|
}
|
|
166
|
-
exports.TemplateLiteralParse = TemplateLiteralParse;
|
|
167
168
|
// ------------------------------------------------------------------
|
|
168
169
|
// TemplateLiteralParseExact
|
|
169
170
|
// ------------------------------------------------------------------
|
|
@@ -171,4 +172,3 @@ exports.TemplateLiteralParse = TemplateLiteralParse;
|
|
|
171
172
|
function TemplateLiteralParseExact(pattern) {
|
|
172
173
|
return TemplateLiteralParse(pattern.slice(1, pattern.length - 1));
|
|
173
174
|
}
|
|
174
|
-
exports.TemplateLiteralParseExact = TemplateLiteralParseExact;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.TemplateLiteralPatternError = void 0;
|
|
5
|
+
exports.TemplateLiteralPattern = TemplateLiteralPattern;
|
|
5
6
|
const index_1 = require("../patterns/index");
|
|
6
7
|
const index_2 = require("../symbols/index");
|
|
7
8
|
const index_3 = require("../error/index");
|
|
@@ -36,4 +37,3 @@ function Visit(schema, acc) {
|
|
|
36
37
|
function TemplateLiteralPattern(kinds) {
|
|
37
38
|
return `^${kinds.map((schema) => Visit(schema, '')).join('')}\$`;
|
|
38
39
|
}
|
|
39
|
-
exports.TemplateLiteralPattern = TemplateLiteralPattern;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.TemplateLiteralSyntax =
|
|
4
|
+
exports.TemplateLiteralSyntax = TemplateLiteralSyntax;
|
|
5
5
|
const index_1 = require("../literal/index");
|
|
6
6
|
const index_2 = require("../boolean/index");
|
|
7
7
|
const index_3 = require("../bigint/index");
|
|
@@ -57,4 +57,3 @@ function* FromSyntax(syntax) {
|
|
|
57
57
|
function TemplateLiteralSyntax(syntax) {
|
|
58
58
|
return [...FromSyntax(syntax)];
|
|
59
59
|
}
|
|
60
|
-
exports.TemplateLiteralSyntax = TemplateLiteralSyntax;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.TemplateLiteral =
|
|
4
|
+
exports.TemplateLiteral = TemplateLiteral;
|
|
5
5
|
const syntax_1 = require("./syntax");
|
|
6
6
|
const pattern_1 = require("./pattern");
|
|
7
7
|
const value_1 = require("../guard/value");
|
|
@@ -14,4 +14,3 @@ function TemplateLiteral(unresolved, options = {}) {
|
|
|
14
14
|
: (0, pattern_1.TemplateLiteralPattern)(unresolved);
|
|
15
15
|
return { ...options, [index_1.Kind]: 'TemplateLiteral', type: 'string', pattern };
|
|
16
16
|
}
|
|
17
|
-
exports.TemplateLiteral = TemplateLiteral;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.TemplateLiteralToUnion =
|
|
4
|
+
exports.TemplateLiteralToUnion = TemplateLiteralToUnion;
|
|
5
5
|
const index_1 = require("../union/index");
|
|
6
6
|
const index_2 = require("../literal/index");
|
|
7
7
|
const generate_1 = require("./generate");
|
|
@@ -11,4 +11,3 @@ function TemplateLiteralToUnion(schema) {
|
|
|
11
11
|
const L = R.map((S) => (0, index_2.Literal)(S));
|
|
12
12
|
return (0, index_1.UnionEvaluated)(L);
|
|
13
13
|
}
|
|
14
|
-
exports.TemplateLiteralToUnion = TemplateLiteralToUnion;
|