@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,79 +1,78 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.IsAsyncIterator = IsAsyncIterator;
|
|
5
|
+
exports.IsArray = IsArray;
|
|
6
|
+
exports.IsBigInt = IsBigInt;
|
|
7
|
+
exports.IsBoolean = IsBoolean;
|
|
8
|
+
exports.IsDate = IsDate;
|
|
9
|
+
exports.IsFunction = IsFunction;
|
|
10
|
+
exports.IsIterator = IsIterator;
|
|
11
|
+
exports.IsNull = IsNull;
|
|
12
|
+
exports.IsNumber = IsNumber;
|
|
13
|
+
exports.IsObject = IsObject;
|
|
14
|
+
exports.IsRegExp = IsRegExp;
|
|
15
|
+
exports.IsString = IsString;
|
|
16
|
+
exports.IsSymbol = IsSymbol;
|
|
17
|
+
exports.IsUint8Array = IsUint8Array;
|
|
18
|
+
exports.IsUndefined = IsUndefined;
|
|
5
19
|
/** Returns true if this value is an async iterator */
|
|
6
20
|
function IsAsyncIterator(value) {
|
|
7
21
|
return IsObject(value) && !IsArray(value) && !IsUint8Array(value) && Symbol.asyncIterator in value;
|
|
8
22
|
}
|
|
9
|
-
exports.IsAsyncIterator = IsAsyncIterator;
|
|
10
23
|
/** Returns true if this value is an array */
|
|
11
24
|
function IsArray(value) {
|
|
12
25
|
return Array.isArray(value);
|
|
13
26
|
}
|
|
14
|
-
exports.IsArray = IsArray;
|
|
15
27
|
/** Returns true if this value is bigint */
|
|
16
28
|
function IsBigInt(value) {
|
|
17
29
|
return typeof value === 'bigint';
|
|
18
30
|
}
|
|
19
|
-
exports.IsBigInt = IsBigInt;
|
|
20
31
|
/** Returns true if this value is a boolean */
|
|
21
32
|
function IsBoolean(value) {
|
|
22
33
|
return typeof value === 'boolean';
|
|
23
34
|
}
|
|
24
|
-
exports.IsBoolean = IsBoolean;
|
|
25
35
|
/** Returns true if this value is a Date object */
|
|
26
36
|
function IsDate(value) {
|
|
27
37
|
return value instanceof globalThis.Date;
|
|
28
38
|
}
|
|
29
|
-
exports.IsDate = IsDate;
|
|
30
39
|
/** Returns true if this value is a function */
|
|
31
40
|
function IsFunction(value) {
|
|
32
41
|
return typeof value === 'function';
|
|
33
42
|
}
|
|
34
|
-
exports.IsFunction = IsFunction;
|
|
35
43
|
/** Returns true if this value is an iterator */
|
|
36
44
|
function IsIterator(value) {
|
|
37
45
|
return IsObject(value) && !IsArray(value) && !IsUint8Array(value) && Symbol.iterator in value;
|
|
38
46
|
}
|
|
39
|
-
exports.IsIterator = IsIterator;
|
|
40
47
|
/** Returns true if this value is null */
|
|
41
48
|
function IsNull(value) {
|
|
42
49
|
return value === null;
|
|
43
50
|
}
|
|
44
|
-
exports.IsNull = IsNull;
|
|
45
51
|
/** Returns true if this value is number */
|
|
46
52
|
function IsNumber(value) {
|
|
47
53
|
return typeof value === 'number';
|
|
48
54
|
}
|
|
49
|
-
exports.IsNumber = IsNumber;
|
|
50
55
|
/** Returns true if this value is an object */
|
|
51
56
|
function IsObject(value) {
|
|
52
57
|
return typeof value === 'object' && value !== null;
|
|
53
58
|
}
|
|
54
|
-
exports.IsObject = IsObject;
|
|
55
59
|
/** Returns true if this value is RegExp */
|
|
56
60
|
function IsRegExp(value) {
|
|
57
61
|
return value instanceof globalThis.RegExp;
|
|
58
62
|
}
|
|
59
|
-
exports.IsRegExp = IsRegExp;
|
|
60
63
|
/** Returns true if this value is string */
|
|
61
64
|
function IsString(value) {
|
|
62
65
|
return typeof value === 'string';
|
|
63
66
|
}
|
|
64
|
-
exports.IsString = IsString;
|
|
65
67
|
/** Returns true if this value is symbol */
|
|
66
68
|
function IsSymbol(value) {
|
|
67
69
|
return typeof value === 'symbol';
|
|
68
70
|
}
|
|
69
|
-
exports.IsSymbol = IsSymbol;
|
|
70
71
|
/** Returns true if this value is a Uint8Array */
|
|
71
72
|
function IsUint8Array(value) {
|
|
72
73
|
return value instanceof globalThis.Uint8Array;
|
|
73
74
|
}
|
|
74
|
-
exports.IsUint8Array = IsUint8Array;
|
|
75
75
|
/** Returns true if this value is undefined */
|
|
76
76
|
function IsUndefined(value) {
|
|
77
77
|
return value === undefined;
|
|
78
78
|
}
|
|
79
|
-
exports.IsUndefined = IsUndefined;
|
|
@@ -1,9 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Increment =
|
|
4
|
+
exports.Increment = Increment;
|
|
5
5
|
/** Increments the given string value + 1 */
|
|
6
6
|
function Increment(T) {
|
|
7
7
|
return (parseInt(T) + 1).toString();
|
|
8
8
|
}
|
|
9
|
-
exports.Increment = Increment;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.IndexFromMappedKey =
|
|
4
|
+
exports.IndexFromMappedKey = IndexFromMappedKey;
|
|
5
5
|
const indexed_1 = require("./indexed");
|
|
6
6
|
const index_1 = require("../mapped/index");
|
|
7
7
|
// prettier-ignore
|
|
@@ -23,4 +23,3 @@ function IndexFromMappedKey(T, K, options) {
|
|
|
23
23
|
const P = MappedIndexProperties(T, K, options);
|
|
24
24
|
return (0, index_1.MappedResult)(P);
|
|
25
25
|
}
|
|
26
|
-
exports.IndexFromMappedKey = IndexFromMappedKey;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.IndexFromMappedResult =
|
|
4
|
+
exports.IndexFromMappedResult = IndexFromMappedResult;
|
|
5
5
|
const index_1 = require("../mapped/index");
|
|
6
6
|
const indexed_property_keys_1 = require("./indexed-property-keys");
|
|
7
7
|
const index_2 = require("./index");
|
|
@@ -22,4 +22,3 @@ function IndexFromMappedResult(T, R, options) {
|
|
|
22
22
|
const P = FromMappedResult(T, R, options);
|
|
23
23
|
return (0, index_1.MappedResult)(P);
|
|
24
24
|
}
|
|
25
|
-
exports.IndexFromMappedResult = IndexFromMappedResult;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.IndexPropertyKeys =
|
|
4
|
+
exports.IndexPropertyKeys = IndexPropertyKeys;
|
|
5
5
|
const index_1 = require("../template-literal/index");
|
|
6
6
|
// ------------------------------------------------------------------
|
|
7
7
|
// TypeGuard
|
|
@@ -34,4 +34,3 @@ function IndexPropertyKeys(T) {
|
|
|
34
34
|
(0, kind_1.IsInteger)(T) ? ['[number]'] :
|
|
35
35
|
[]))];
|
|
36
36
|
}
|
|
37
|
-
exports.IndexPropertyKeys = IndexPropertyKeys;
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.IndexFromPropertyKey = IndexFromPropertyKey;
|
|
5
|
+
exports.IndexFromPropertyKeys = IndexFromPropertyKeys;
|
|
6
|
+
exports.Index = Index;
|
|
5
7
|
const index_1 = require("../never/index");
|
|
6
8
|
const index_2 = require("../intersect/index");
|
|
7
9
|
const index_3 = require("../union/index");
|
|
@@ -60,12 +62,10 @@ function IndexFromPropertyKey(T, K) {
|
|
|
60
62
|
(0, kind_1.IsObject)(T) ? FromProperty(T.properties, K) :
|
|
61
63
|
(0, index_1.Never)());
|
|
62
64
|
}
|
|
63
|
-
exports.IndexFromPropertyKey = IndexFromPropertyKey;
|
|
64
65
|
// prettier-ignore
|
|
65
66
|
function IndexFromPropertyKeys(T, K) {
|
|
66
67
|
return K.map(L => IndexFromPropertyKey(T, L));
|
|
67
68
|
}
|
|
68
|
-
exports.IndexFromPropertyKeys = IndexFromPropertyKeys;
|
|
69
69
|
// prettier-ignore
|
|
70
70
|
function FromSchema(T, K) {
|
|
71
71
|
return ((0, index_3.UnionEvaluated)(IndexFromPropertyKeys(T, K)));
|
|
@@ -78,4 +78,3 @@ function Index(T, K, options = {}) {
|
|
|
78
78
|
(0, kind_1.IsSchema)(K) ? (0, type_1.CloneType)(FromSchema(T, (0, indexed_property_keys_1.IndexPropertyKeys)(K)), options) :
|
|
79
79
|
(0, type_1.CloneType)(FromSchema(T, K), options));
|
|
80
80
|
}
|
|
81
|
-
exports.Index = Index;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.InstanceType =
|
|
4
|
+
exports.InstanceType = InstanceType;
|
|
5
5
|
const type_1 = require("../clone/type");
|
|
6
6
|
/** `[JavaScript]` Extracts the InstanceType from the given Constructor type */
|
|
7
7
|
function InstanceType(schema, options = {}) {
|
|
8
8
|
return (0, type_1.CloneType)(schema.returns, options);
|
|
9
9
|
}
|
|
10
|
-
exports.InstanceType = InstanceType;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Integer =
|
|
4
|
+
exports.Integer = Integer;
|
|
5
5
|
const index_1 = require("../symbols/index");
|
|
6
6
|
/** `[Json]` Creates an Integer type */
|
|
7
7
|
function Integer(options = {}) {
|
|
@@ -11,4 +11,3 @@ function Integer(options = {}) {
|
|
|
11
11
|
type: 'integer',
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
|
-
exports.Integer = Integer;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.IntersectCreate =
|
|
4
|
+
exports.IntersectCreate = IntersectCreate;
|
|
5
5
|
const index_1 = require("../symbols/index");
|
|
6
6
|
const type_1 = require("../clone/type");
|
|
7
7
|
// ------------------------------------------------------------------
|
|
@@ -21,4 +21,3 @@ function IntersectCreate(T, options) {
|
|
|
21
21
|
? { ...options, ...clonedUnevaluatedProperties, [index_1.Kind]: 'Intersect', type: 'object', allOf: (0, type_1.CloneRest)(T) }
|
|
22
22
|
: { ...options, ...clonedUnevaluatedProperties, [index_1.Kind]: 'Intersect', allOf: (0, type_1.CloneRest)(T) }));
|
|
23
23
|
}
|
|
24
|
-
exports.IntersectCreate = IntersectCreate;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.IntersectEvaluated =
|
|
4
|
+
exports.IntersectEvaluated = IntersectEvaluated;
|
|
5
5
|
const index_1 = require("../symbols/index");
|
|
6
6
|
const type_1 = require("../clone/type");
|
|
7
7
|
const index_2 = require("../discard/index");
|
|
@@ -40,4 +40,3 @@ function IntersectEvaluated(T, options = {}) {
|
|
|
40
40
|
throw new Error('Cannot intersect transform types');
|
|
41
41
|
return ResolveIntersect(T, options);
|
|
42
42
|
}
|
|
43
|
-
exports.IntersectEvaluated = IntersectEvaluated;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Intersect =
|
|
4
|
+
exports.Intersect = Intersect;
|
|
5
5
|
const type_1 = require("../clone/type");
|
|
6
6
|
const index_1 = require("../never/index");
|
|
7
7
|
const intersect_create_1 = require("./intersect-create");
|
|
@@ -19,4 +19,3 @@ function Intersect(T, options = {}) {
|
|
|
19
19
|
throw new Error('Cannot intersect transform types');
|
|
20
20
|
return (0, intersect_create_1.IntersectCreate)(T, options);
|
|
21
21
|
}
|
|
22
|
-
exports.Intersect = Intersect;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Capitalize =
|
|
4
|
+
exports.Capitalize = Capitalize;
|
|
5
5
|
const intrinsic_1 = require("./intrinsic");
|
|
6
6
|
/** `[Json]` Intrinsic function to Capitalize LiteralString types */
|
|
7
7
|
function Capitalize(T, options = {}) {
|
|
8
8
|
return (0, intrinsic_1.Intrinsic)(T, 'Capitalize', options);
|
|
9
9
|
}
|
|
10
|
-
exports.Capitalize = Capitalize;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.IntrinsicFromMappedKey =
|
|
4
|
+
exports.IntrinsicFromMappedKey = IntrinsicFromMappedKey;
|
|
5
5
|
const index_1 = require("../mapped/index");
|
|
6
6
|
const intrinsic_1 = require("./intrinsic");
|
|
7
7
|
const index_2 = require("../literal/index");
|
|
@@ -26,4 +26,3 @@ function IntrinsicFromMappedKey(T, M, options) {
|
|
|
26
26
|
const P = MappedIntrinsicProperties(T, M, options);
|
|
27
27
|
return (0, index_1.MappedResult)(P);
|
|
28
28
|
}
|
|
29
|
-
exports.IntrinsicFromMappedKey = IntrinsicFromMappedKey;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Intrinsic =
|
|
4
|
+
exports.Intrinsic = Intrinsic;
|
|
5
5
|
const index_1 = require("../template-literal/index");
|
|
6
6
|
const intrinsic_from_mapped_key_1 = require("./intrinsic-from-mapped-key");
|
|
7
7
|
const index_2 = require("../literal/index");
|
|
@@ -64,4 +64,3 @@ function Intrinsic(schema, mode, options = {}) {
|
|
|
64
64
|
(0, kind_1.IsLiteral)(schema) ? (0, index_2.Literal)(FromLiteralValue(schema.const, mode), options) :
|
|
65
65
|
schema);
|
|
66
66
|
}
|
|
67
|
-
exports.Intrinsic = Intrinsic;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Lowercase =
|
|
4
|
+
exports.Lowercase = Lowercase;
|
|
5
5
|
const intrinsic_1 = require("./intrinsic");
|
|
6
6
|
/** `[Json]` Intrinsic function to Lowercase LiteralString types */
|
|
7
7
|
function Lowercase(T, options = {}) {
|
|
8
8
|
return (0, intrinsic_1.Intrinsic)(T, 'Lowercase', options);
|
|
9
9
|
}
|
|
10
|
-
exports.Lowercase = Lowercase;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Uncapitalize =
|
|
4
|
+
exports.Uncapitalize = Uncapitalize;
|
|
5
5
|
const intrinsic_1 = require("./intrinsic");
|
|
6
6
|
/** `[Json]` Intrinsic function to Uncapitalize LiteralString types */
|
|
7
7
|
function Uncapitalize(T, options = {}) {
|
|
8
8
|
return (0, intrinsic_1.Intrinsic)(T, 'Uncapitalize', options);
|
|
9
9
|
}
|
|
10
|
-
exports.Uncapitalize = Uncapitalize;
|
|
@@ -1,10 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Uppercase =
|
|
4
|
+
exports.Uppercase = Uppercase;
|
|
5
5
|
const intrinsic_1 = require("./intrinsic");
|
|
6
6
|
/** `[Json]` Intrinsic function to Uppercase LiteralString types */
|
|
7
7
|
function Uppercase(T, options = {}) {
|
|
8
8
|
return (0, intrinsic_1.Intrinsic)(T, 'Uppercase', options);
|
|
9
9
|
}
|
|
10
|
-
exports.Uppercase = Uppercase;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Iterator =
|
|
4
|
+
exports.Iterator = Iterator;
|
|
5
5
|
const type_1 = require("../clone/type");
|
|
6
6
|
const index_1 = require("../symbols/index");
|
|
7
7
|
/** `[JavaScript]` Creates an Iterator type */
|
|
@@ -13,4 +13,3 @@ function Iterator(items, options = {}) {
|
|
|
13
13
|
items: (0, type_1.CloneType)(items),
|
|
14
14
|
};
|
|
15
15
|
}
|
|
16
|
-
exports.Iterator = Iterator;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.KeyOfFromMappedResult =
|
|
4
|
+
exports.KeyOfFromMappedResult = KeyOfFromMappedResult;
|
|
5
5
|
const index_1 = require("../mapped/index");
|
|
6
6
|
const keyof_1 = require("./keyof");
|
|
7
7
|
// prettier-ignore
|
|
@@ -20,4 +20,3 @@ function KeyOfFromMappedResult(R, options) {
|
|
|
20
20
|
const P = FromMappedResult(R, options);
|
|
21
21
|
return (0, index_1.MappedResult)(P);
|
|
22
22
|
}
|
|
23
|
-
exports.KeyOfFromMappedResult = KeyOfFromMappedResult;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.KeyOfPropertyEntries =
|
|
4
|
+
exports.KeyOfPropertyEntries = KeyOfPropertyEntries;
|
|
5
5
|
const indexed_1 = require("../indexed/indexed");
|
|
6
6
|
const keyof_property_keys_1 = require("./keyof-property-keys");
|
|
7
7
|
/**
|
|
@@ -14,4 +14,3 @@ function KeyOfPropertyEntries(schema) {
|
|
|
14
14
|
const schemas = (0, indexed_1.IndexFromPropertyKeys)(schema, keys);
|
|
15
15
|
return keys.map((_, index) => [keys[index], schemas[index]]);
|
|
16
16
|
}
|
|
17
|
-
exports.KeyOfPropertyEntries = KeyOfPropertyEntries;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.KeyOfPropertyKeys = KeyOfPropertyKeys;
|
|
5
|
+
exports.KeyOfPattern = KeyOfPattern;
|
|
5
6
|
const index_1 = require("../sets/index");
|
|
6
7
|
// ------------------------------------------------------------------
|
|
7
8
|
// TypeGuard
|
|
@@ -63,7 +64,6 @@ function KeyOfPropertyKeys(T) {
|
|
|
63
64
|
(0, kind_1.IsRecord)(T) ? FromPatternProperties(T.patternProperties) :
|
|
64
65
|
[]);
|
|
65
66
|
}
|
|
66
|
-
exports.KeyOfPropertyKeys = KeyOfPropertyKeys;
|
|
67
67
|
// ----------------------------------------------------------------
|
|
68
68
|
// KeyOfPattern
|
|
69
69
|
// ----------------------------------------------------------------
|
|
@@ -76,4 +76,3 @@ function KeyOfPattern(schema) {
|
|
|
76
76
|
const pattern = keys.map((key) => `(${key})`);
|
|
77
77
|
return `^(${pattern.join('|')})$`;
|
|
78
78
|
}
|
|
79
|
-
exports.KeyOfPattern = KeyOfPattern;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.KeyOfPropertyKeysToRest = KeyOfPropertyKeysToRest;
|
|
5
|
+
exports.KeyOf = KeyOf;
|
|
5
6
|
const index_1 = require("../literal/index");
|
|
6
7
|
const index_2 = require("../number/index");
|
|
7
8
|
const keyof_property_keys_1 = require("./keyof-property-keys");
|
|
@@ -16,7 +17,6 @@ const kind_1 = require("../guard/kind");
|
|
|
16
17
|
function KeyOfPropertyKeysToRest(T) {
|
|
17
18
|
return T.map(L => L === '[number]' ? (0, index_2.Number)() : (0, index_1.Literal)(L));
|
|
18
19
|
}
|
|
19
|
-
exports.KeyOfPropertyKeysToRest = KeyOfPropertyKeysToRest;
|
|
20
20
|
/** `[Json]` Creates a KeyOf type */
|
|
21
21
|
function KeyOf(T, options = {}) {
|
|
22
22
|
if ((0, kind_1.IsMappedResult)(T)) {
|
|
@@ -29,4 +29,3 @@ function KeyOf(T, options = {}) {
|
|
|
29
29
|
return (0, type_1.CloneType)(U, options);
|
|
30
30
|
}
|
|
31
31
|
}
|
|
32
|
-
exports.KeyOf = KeyOf;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Literal =
|
|
4
|
+
exports.Literal = Literal;
|
|
5
5
|
const index_1 = require("../symbols/index");
|
|
6
6
|
/** `[Json]` Creates a Literal type */
|
|
7
7
|
function Literal(value, options = {}) {
|
|
@@ -12,4 +12,3 @@ function Literal(value, options = {}) {
|
|
|
12
12
|
type: typeof value,
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
exports.Literal = Literal;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.MappedKey =
|
|
4
|
+
exports.MappedKey = MappedKey;
|
|
5
5
|
const index_1 = require("../symbols/index");
|
|
6
6
|
// prettier-ignore
|
|
7
7
|
function MappedKey(T) {
|
|
@@ -10,4 +10,3 @@ function MappedKey(T) {
|
|
|
10
10
|
keys: T
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
-
exports.MappedKey = MappedKey;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.MappedResult =
|
|
4
|
+
exports.MappedResult = MappedResult;
|
|
5
5
|
const index_1 = require("../symbols/index");
|
|
6
6
|
// prettier-ignore
|
|
7
7
|
function MappedResult(properties) {
|
|
@@ -10,4 +10,3 @@ function MappedResult(properties) {
|
|
|
10
10
|
properties
|
|
11
11
|
};
|
|
12
12
|
}
|
|
13
|
-
exports.MappedResult = MappedResult;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.
|
|
4
|
+
exports.MappedFunctionReturnType = MappedFunctionReturnType;
|
|
5
|
+
exports.Mapped = Mapped;
|
|
5
6
|
const index_1 = require("../symbols/index");
|
|
6
7
|
const type_1 = require("../clone/type");
|
|
7
8
|
const index_2 = require("../discard/index");
|
|
@@ -96,7 +97,6 @@ function MappedFunctionReturnType(K, T) {
|
|
|
96
97
|
Acc[L] = FromSchemaType(L, T);
|
|
97
98
|
return Acc;
|
|
98
99
|
}
|
|
99
|
-
exports.MappedFunctionReturnType = MappedFunctionReturnType;
|
|
100
100
|
/** `[Json]` Creates a Mapped object type */
|
|
101
101
|
function Mapped(key, map, options = {}) {
|
|
102
102
|
const K = (0, kind_1.IsSchema)(key) ? (0, index_7.IndexPropertyKeys)(key) : key;
|
|
@@ -104,4 +104,3 @@ function Mapped(key, map, options = {}) {
|
|
|
104
104
|
const R = MappedFunctionReturnType(K, RT);
|
|
105
105
|
return (0, type_1.CloneType)((0, index_11.Object)(R), options);
|
|
106
106
|
}
|
|
107
|
-
exports.Mapped = Mapped;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Never =
|
|
4
|
+
exports.Never = Never;
|
|
5
5
|
const index_1 = require("../symbols/index");
|
|
6
6
|
/** `[Json]` Creates a Never type */
|
|
7
7
|
function Never(options = {}) {
|
|
@@ -11,4 +11,3 @@ function Never(options = {}) {
|
|
|
11
11
|
not: {},
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
|
-
exports.Never = Never;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Not =
|
|
4
|
+
exports.Not = Not;
|
|
5
5
|
const type_1 = require("../clone/type");
|
|
6
6
|
const index_1 = require("../symbols/index");
|
|
7
7
|
/** `[Json]` Creates a Not type */
|
|
@@ -12,4 +12,3 @@ function Not(schema, options) {
|
|
|
12
12
|
not: (0, type_1.CloneType)(schema),
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
|
-
exports.Not = Not;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Null =
|
|
4
|
+
exports.Null = Null;
|
|
5
5
|
const index_1 = require("../symbols/index");
|
|
6
6
|
/** `[Json]` Creates a Null type */
|
|
7
7
|
function Null(options = {}) {
|
|
@@ -11,4 +11,3 @@ function Null(options = {}) {
|
|
|
11
11
|
type: 'null',
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
|
-
exports.Null = Null;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Number =
|
|
4
|
+
exports.Number = Number;
|
|
5
5
|
const index_1 = require("../symbols/index");
|
|
6
6
|
/** `[Json]` Creates a Number type */
|
|
7
7
|
function Number(options = {}) {
|
|
@@ -11,4 +11,3 @@ function Number(options = {}) {
|
|
|
11
11
|
type: 'number',
|
|
12
12
|
};
|
|
13
13
|
}
|
|
14
|
-
exports.Number = Number;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.OmitFromMappedKey =
|
|
4
|
+
exports.OmitFromMappedKey = OmitFromMappedKey;
|
|
5
5
|
const index_1 = require("../mapped/index");
|
|
6
6
|
const omit_1 = require("./omit");
|
|
7
7
|
// prettier-ignore
|
|
@@ -25,4 +25,3 @@ function OmitFromMappedKey(T, K, options) {
|
|
|
25
25
|
const P = FromMappedKey(T, K, options);
|
|
26
26
|
return (0, index_1.MappedResult)(P);
|
|
27
27
|
}
|
|
28
|
-
exports.OmitFromMappedKey = OmitFromMappedKey;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.OmitFromMappedResult =
|
|
4
|
+
exports.OmitFromMappedResult = OmitFromMappedResult;
|
|
5
5
|
const index_1 = require("../mapped/index");
|
|
6
6
|
const omit_1 = require("./omit");
|
|
7
7
|
// prettier-ignore
|
|
@@ -20,4 +20,3 @@ function OmitFromMappedResult(R, K, options) {
|
|
|
20
20
|
const P = FromMappedResult(R, K, options);
|
|
21
21
|
return (0, index_1.MappedResult)(P);
|
|
22
22
|
}
|
|
23
|
-
exports.OmitFromMappedResult = OmitFromMappedResult;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Omit =
|
|
4
|
+
exports.Omit = Omit;
|
|
5
5
|
const index_1 = require("../intersect/index");
|
|
6
6
|
const index_2 = require("../union/index");
|
|
7
7
|
const index_3 = require("../object/index");
|
|
@@ -57,4 +57,3 @@ function Omit(T, K, options = {}) {
|
|
|
57
57
|
const R = (0, type_1.CloneType)(OmitResolve(T, I), options);
|
|
58
58
|
return { ...D, ...R };
|
|
59
59
|
}
|
|
60
|
-
exports.Omit = Omit;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.OptionalFromMappedResult =
|
|
4
|
+
exports.OptionalFromMappedResult = OptionalFromMappedResult;
|
|
5
5
|
const index_1 = require("../mapped/index");
|
|
6
6
|
const optional_1 = require("./optional");
|
|
7
7
|
// prettier-ignore
|
|
@@ -20,4 +20,3 @@ function OptionalFromMappedResult(R, F) {
|
|
|
20
20
|
const P = FromMappedResult(R, F);
|
|
21
21
|
return (0, index_1.MappedResult)(P);
|
|
22
22
|
}
|
|
23
|
-
exports.OptionalFromMappedResult = OptionalFromMappedResult;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Optional =
|
|
4
|
+
exports.Optional = Optional;
|
|
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 Optional(schema, enable) {
|
|
|
24
24
|
const F = enable ?? true;
|
|
25
25
|
return (0, kind_1.IsMappedResult)(schema) ? (0, optional_from_mapped_result_1.OptionalFromMappedResult)(schema, F) : OptionalWithFlag(schema, F);
|
|
26
26
|
}
|
|
27
|
-
exports.Optional = Optional;
|
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Parameters =
|
|
4
|
+
exports.Parameters = Parameters;
|
|
5
5
|
const index_1 = require("../tuple/index");
|
|
6
6
|
const type_1 = require("../clone/type");
|
|
7
7
|
/** `[JavaScript]` Extracts the Parameters from the given Function type */
|
|
8
8
|
function Parameters(schema, options = {}) {
|
|
9
9
|
return (0, index_1.Tuple)((0, type_1.CloneRest)(schema.parameters), { ...options });
|
|
10
10
|
}
|
|
11
|
-
exports.Parameters = Parameters;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.PartialFromMappedResult =
|
|
4
|
+
exports.PartialFromMappedResult = PartialFromMappedResult;
|
|
5
5
|
const index_1 = require("../mapped/index");
|
|
6
6
|
const partial_1 = require("./partial");
|
|
7
7
|
// prettier-ignore
|
|
@@ -20,4 +20,3 @@ function PartialFromMappedResult(R, options) {
|
|
|
20
20
|
const P = FromMappedResult(R, options);
|
|
21
21
|
return (0, index_1.MappedResult)(P);
|
|
22
22
|
}
|
|
23
|
-
exports.PartialFromMappedResult = PartialFromMappedResult;
|