arktype 1.0.13-alpha → 1.0.15-alpha
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/README.md +68 -11
- package/dist/main.js +29 -0
- package/dist/nodes/branch.js +135 -0
- package/dist/nodes/compose.js +99 -0
- package/dist/{cjs/nodes → nodes}/discriminate.js +100 -92
- package/dist/nodes/node.js +134 -0
- package/dist/nodes/predicate.js +88 -0
- package/dist/nodes/rules/class.js +23 -0
- package/dist/nodes/rules/collapsibleSet.js +34 -0
- package/dist/nodes/rules/divisor.js +19 -0
- package/dist/nodes/rules/props.js +130 -0
- package/dist/nodes/rules/range.js +108 -0
- package/dist/nodes/rules/regex.js +17 -0
- package/dist/nodes/rules/rules.js +102 -0
- package/dist/parse/ast/ast.js +2 -0
- package/dist/{types/parse → parse}/ast/bound.d.ts +4 -1
- package/dist/parse/ast/bound.js +7 -0
- package/dist/parse/ast/config.js +14 -0
- package/dist/parse/ast/distributableFunction.js +40 -0
- package/dist/parse/ast/divisor.js +5 -0
- package/dist/parse/ast/intersection.js +21 -0
- package/dist/parse/ast/keyof.js +107 -0
- package/dist/parse/ast/morph.js +50 -0
- package/dist/parse/ast/narrow.js +17 -0
- package/dist/{types/parse → parse}/ast/node.d.ts +3 -1
- package/dist/parse/ast/node.js +2 -0
- package/dist/parse/ast/tuple.js +72 -0
- package/dist/parse/ast/union.js +5 -0
- package/dist/parse/ast/utils.js +2 -0
- package/dist/parse/definition.js +47 -0
- package/dist/parse/record.js +31 -0
- package/dist/parse/string/reduce/dynamic.js +159 -0
- package/dist/parse/string/reduce/shared.js +13 -0
- package/dist/parse/string/reduce/static.js +2 -0
- package/dist/parse/string/shift/operand/enclosed.js +37 -0
- package/dist/parse/string/shift/operand/operand.js +15 -0
- package/dist/parse/string/shift/operand/unenclosed.js +45 -0
- package/dist/parse/string/shift/operator/bounds.js +83 -0
- package/dist/parse/string/shift/operator/divisor.js +23 -0
- package/dist/parse/string/shift/operator/operator.js +34 -0
- package/dist/parse/string/shift/scanner.js +97 -0
- package/dist/parse/string/string.js +35 -0
- package/dist/scopes/ark.js +27 -0
- package/dist/scopes/cache.js +28 -0
- package/dist/{mjs/scopes → scopes}/expressions.js +20 -9
- package/dist/scopes/jsObjects.js +20 -0
- package/dist/scopes/scope.js +184 -0
- package/dist/scopes/tsKeywords.js +49 -0
- package/dist/scopes/type.js +40 -0
- package/dist/{mjs/scopes → scopes}/validation/creditCard.js +15 -11
- package/dist/{mjs/scopes → scopes}/validation/date.js +21 -16
- package/dist/scopes/validation/validation.js +74 -0
- package/dist/traverse/problems.js +234 -0
- package/dist/traverse/traverse.js +330 -0
- package/dist/tsconfig.temp.tsbuildinfo +1 -1
- package/dist/{mjs/utils → utils}/chainableNoOpProxy.js +6 -2
- package/dist/utils/data.js +39 -0
- package/dist/utils/domains.js +27 -0
- package/dist/utils/errors.js +17 -0
- package/dist/utils/freeze.js +16 -0
- package/dist/utils/generics.js +53 -0
- package/dist/utils/numericLiterals.js +88 -0
- package/dist/utils/objectKinds.js +69 -0
- package/dist/{mjs/utils → utils}/paths.js +8 -3
- package/dist/utils/serialize.js +71 -0
- package/dist/utils/unionToTuple.js +2 -0
- package/package.json +25 -39
- package/dist/cjs/main.js +0 -38
- package/dist/cjs/nodes/branch.js +0 -140
- package/dist/cjs/nodes/compose.js +0 -157
- package/dist/cjs/nodes/node.js +0 -139
- package/dist/cjs/nodes/predicate.js +0 -86
- package/dist/cjs/nodes/rules/class.js +0 -25
- package/dist/cjs/nodes/rules/collapsibleSet.js +0 -48
- package/dist/cjs/nodes/rules/divisor.js +0 -29
- package/dist/cjs/nodes/rules/props.js +0 -160
- package/dist/cjs/nodes/rules/range.js +0 -105
- package/dist/cjs/nodes/rules/regex.js +0 -26
- package/dist/cjs/nodes/rules/rules.js +0 -123
- package/dist/cjs/package.json +0 -3
- package/dist/cjs/parse/ast/ast.js +0 -4
- package/dist/cjs/parse/ast/bound.js +0 -9
- package/dist/cjs/parse/ast/config.js +0 -13
- package/dist/cjs/parse/ast/distributableFunction.js +0 -48
- package/dist/cjs/parse/ast/divisor.js +0 -9
- package/dist/cjs/parse/ast/intersection.js +0 -30
- package/dist/cjs/parse/ast/keyof.js +0 -111
- package/dist/cjs/parse/ast/morph.js +0 -58
- package/dist/cjs/parse/ast/narrow.js +0 -22
- package/dist/cjs/parse/ast/node.js +0 -4
- package/dist/cjs/parse/ast/tuple.js +0 -94
- package/dist/cjs/parse/ast/union.js +0 -9
- package/dist/cjs/parse/ast/utils.js +0 -4
- package/dist/cjs/parse/definition.js +0 -61
- package/dist/cjs/parse/record.js +0 -37
- package/dist/cjs/parse/string/reduce/dynamic.js +0 -167
- package/dist/cjs/parse/string/reduce/shared.js +0 -23
- package/dist/cjs/parse/string/reduce/static.js +0 -4
- package/dist/cjs/parse/string/shift/operand/enclosed.js +0 -54
- package/dist/cjs/parse/string/shift/operand/operand.js +0 -11
- package/dist/cjs/parse/string/shift/operand/unenclosed.js +0 -53
- package/dist/cjs/parse/string/shift/operator/bounds.js +0 -87
- package/dist/cjs/parse/string/shift/operator/divisor.js +0 -35
- package/dist/cjs/parse/string/shift/operator/operator.js +0 -26
- package/dist/cjs/parse/string/shift/scanner.js +0 -114
- package/dist/cjs/parse/string/string.js +0 -43
- package/dist/cjs/scopes/ark.js +0 -45
- package/dist/cjs/scopes/cache.js +0 -52
- package/dist/cjs/scopes/expressions.js +0 -29
- package/dist/cjs/scopes/jsObjects.js +0 -93
- package/dist/cjs/scopes/scope.js +0 -323
- package/dist/cjs/scopes/tsKeywords.js +0 -113
- package/dist/cjs/scopes/type.js +0 -50
- package/dist/cjs/scopes/validation/creditCard.js +0 -47
- package/dist/cjs/scopes/validation/date.js +0 -62
- package/dist/cjs/scopes/validation/validation.js +0 -104
- package/dist/cjs/traverse/problems.js +0 -281
- package/dist/cjs/traverse/traverse.js +0 -387
- package/dist/cjs/utils/chainableNoOpProxy.js +0 -23
- package/dist/cjs/utils/data.js +0 -53
- package/dist/cjs/utils/domains.js +0 -30
- package/dist/cjs/utils/errors.js +0 -26
- package/dist/cjs/utils/freeze.js +0 -15
- package/dist/cjs/utils/generics.js +0 -63
- package/dist/cjs/utils/numericLiterals.js +0 -75
- package/dist/cjs/utils/objectKinds.js +0 -69
- package/dist/cjs/utils/paths.js +0 -32
- package/dist/cjs/utils/serialize.js +0 -74
- package/dist/cjs/utils/unionToTuple.js +0 -4
- package/dist/mjs/main.js +0 -8
- package/dist/mjs/nodes/branch.js +0 -123
- package/dist/mjs/nodes/compose.js +0 -135
- package/dist/mjs/nodes/discriminate.js +0 -247
- package/dist/mjs/nodes/node.js +0 -117
- package/dist/mjs/nodes/predicate.js +0 -69
- package/dist/mjs/nodes/rules/class.js +0 -11
- package/dist/mjs/nodes/rules/collapsibleSet.js +0 -34
- package/dist/mjs/nodes/rules/divisor.js +0 -15
- package/dist/mjs/nodes/rules/props.js +0 -142
- package/dist/mjs/nodes/rules/range.js +0 -86
- package/dist/mjs/nodes/rules/regex.js +0 -11
- package/dist/mjs/nodes/rules/rules.js +0 -106
- package/dist/mjs/package.json +0 -3
- package/dist/mjs/parse/ast/ast.js +0 -1
- package/dist/mjs/parse/ast/bound.js +0 -1
- package/dist/mjs/parse/ast/config.js +0 -9
- package/dist/mjs/parse/ast/distributableFunction.js +0 -34
- package/dist/mjs/parse/ast/divisor.js +0 -1
- package/dist/mjs/parse/ast/intersection.js +0 -16
- package/dist/mjs/parse/ast/keyof.js +0 -103
- package/dist/mjs/parse/ast/morph.js +0 -44
- package/dist/mjs/parse/ast/narrow.js +0 -14
- package/dist/mjs/parse/ast/node.js +0 -1
- package/dist/mjs/parse/ast/tuple.js +0 -80
- package/dist/mjs/parse/ast/union.js +0 -1
- package/dist/mjs/parse/ast/utils.js +0 -1
- package/dist/mjs/parse/definition.js +0 -46
- package/dist/mjs/parse/record.js +0 -29
- package/dist/mjs/parse/string/reduce/dynamic.js +0 -159
- package/dist/mjs/parse/string/reduce/shared.js +0 -6
- package/dist/mjs/parse/string/reduce/static.js +0 -1
- package/dist/mjs/parse/string/shift/operand/enclosed.js +0 -39
- package/dist/mjs/parse/string/shift/operand/operand.js +0 -3
- package/dist/mjs/parse/string/shift/operand/unenclosed.js +0 -36
- package/dist/mjs/parse/string/shift/operator/bounds.js +0 -70
- package/dist/mjs/parse/string/shift/operator/divisor.js +0 -21
- package/dist/mjs/parse/string/shift/operator/operator.js +0 -13
- package/dist/mjs/parse/string/shift/scanner.js +0 -106
- package/dist/mjs/parse/string/string.js +0 -28
- package/dist/mjs/scopes/ark.js +0 -28
- package/dist/mjs/scopes/cache.js +0 -38
- package/dist/mjs/scopes/jsObjects.js +0 -82
- package/dist/mjs/scopes/scope.js +0 -303
- package/dist/mjs/scopes/tsKeywords.js +0 -116
- package/dist/mjs/scopes/type.js +0 -35
- package/dist/mjs/scopes/validation/validation.js +0 -108
- package/dist/mjs/traverse/problems.js +0 -260
- package/dist/mjs/traverse/traverse.js +0 -370
- package/dist/mjs/utils/data.js +0 -38
- package/dist/mjs/utils/domains.js +0 -15
- package/dist/mjs/utils/errors.js +0 -10
- package/dist/mjs/utils/freeze.js +0 -7
- package/dist/mjs/utils/generics.js +0 -38
- package/dist/mjs/utils/numericLiterals.js +0 -72
- package/dist/mjs/utils/objectKinds.js +0 -55
- package/dist/mjs/utils/serialize.js +0 -58
- package/dist/mjs/utils/unionToTuple.js +0 -1
- /package/dist/{types/main.d.ts → main.d.ts} +0 -0
- /package/dist/{types/nodes → nodes}/branch.d.ts +0 -0
- /package/dist/{types/nodes → nodes}/compose.d.ts +0 -0
- /package/dist/{types/nodes → nodes}/discriminate.d.ts +0 -0
- /package/dist/{types/nodes → nodes}/node.d.ts +0 -0
- /package/dist/{types/nodes → nodes}/predicate.d.ts +0 -0
- /package/dist/{types/nodes → nodes}/rules/class.d.ts +0 -0
- /package/dist/{types/nodes → nodes}/rules/collapsibleSet.d.ts +0 -0
- /package/dist/{types/nodes → nodes}/rules/divisor.d.ts +0 -0
- /package/dist/{types/nodes → nodes}/rules/props.d.ts +0 -0
- /package/dist/{types/nodes → nodes}/rules/range.d.ts +0 -0
- /package/dist/{types/nodes → nodes}/rules/regex.d.ts +0 -0
- /package/dist/{types/nodes → nodes}/rules/rules.d.ts +0 -0
- /package/dist/{types/parse → parse}/ast/ast.d.ts +0 -0
- /package/dist/{types/parse → parse}/ast/config.d.ts +0 -0
- /package/dist/{types/parse → parse}/ast/distributableFunction.d.ts +0 -0
- /package/dist/{types/parse → parse}/ast/divisor.d.ts +0 -0
- /package/dist/{types/parse → parse}/ast/intersection.d.ts +0 -0
- /package/dist/{types/parse → parse}/ast/keyof.d.ts +0 -0
- /package/dist/{types/parse → parse}/ast/morph.d.ts +0 -0
- /package/dist/{types/parse → parse}/ast/narrow.d.ts +0 -0
- /package/dist/{types/parse → parse}/ast/tuple.d.ts +0 -0
- /package/dist/{types/parse → parse}/ast/union.d.ts +0 -0
- /package/dist/{types/parse → parse}/ast/utils.d.ts +0 -0
- /package/dist/{types/parse → parse}/definition.d.ts +0 -0
- /package/dist/{types/parse → parse}/record.d.ts +0 -0
- /package/dist/{types/parse → parse}/string/reduce/dynamic.d.ts +0 -0
- /package/dist/{types/parse → parse}/string/reduce/shared.d.ts +0 -0
- /package/dist/{types/parse → parse}/string/reduce/static.d.ts +0 -0
- /package/dist/{types/parse → parse}/string/shift/operand/enclosed.d.ts +0 -0
- /package/dist/{types/parse → parse}/string/shift/operand/operand.d.ts +0 -0
- /package/dist/{types/parse → parse}/string/shift/operand/unenclosed.d.ts +0 -0
- /package/dist/{types/parse → parse}/string/shift/operator/bounds.d.ts +0 -0
- /package/dist/{types/parse → parse}/string/shift/operator/divisor.d.ts +0 -0
- /package/dist/{types/parse → parse}/string/shift/operator/operator.d.ts +0 -0
- /package/dist/{types/parse → parse}/string/shift/scanner.d.ts +0 -0
- /package/dist/{types/parse → parse}/string/string.d.ts +0 -0
- /package/dist/{types/scopes → scopes}/ark.d.ts +0 -0
- /package/dist/{types/scopes → scopes}/cache.d.ts +0 -0
- /package/dist/{types/scopes → scopes}/expressions.d.ts +0 -0
- /package/dist/{types/scopes → scopes}/jsObjects.d.ts +0 -0
- /package/dist/{types/scopes → scopes}/scope.d.ts +0 -0
- /package/dist/{types/scopes → scopes}/tsKeywords.d.ts +0 -0
- /package/dist/{types/scopes → scopes}/type.d.ts +0 -0
- /package/dist/{types/scopes → scopes}/validation/creditCard.d.ts +0 -0
- /package/dist/{types/scopes → scopes}/validation/date.d.ts +0 -0
- /package/dist/{types/scopes → scopes}/validation/validation.d.ts +0 -0
- /package/dist/{types/traverse → traverse}/problems.d.ts +0 -0
- /package/dist/{types/traverse → traverse}/traverse.d.ts +0 -0
- /package/dist/{types/utils → utils}/chainableNoOpProxy.d.ts +0 -0
- /package/dist/{types/utils → utils}/data.d.ts +0 -0
- /package/dist/{types/utils → utils}/domains.d.ts +0 -0
- /package/dist/{types/utils → utils}/errors.d.ts +0 -0
- /package/dist/{types/utils → utils}/freeze.d.ts +0 -0
- /package/dist/{types/utils → utils}/generics.d.ts +0 -0
- /package/dist/{types/utils → utils}/numericLiterals.d.ts +0 -0
- /package/dist/{types/utils → utils}/objectKinds.d.ts +0 -0
- /package/dist/{types/utils → utils}/paths.d.ts +0 -0
- /package/dist/{types/utils → utils}/serialize.d.ts +0 -0
- /package/dist/{types/utils → utils}/unionToTuple.d.ts +0 -0
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DataWrapper = exports.unitsOf = exports.sizeOf = void 0;
|
|
4
|
+
const domains_js_1 = require("./domains.js");
|
|
5
|
+
const serialize_js_1 = require("./serialize.js");
|
|
6
|
+
const sizeOf = (data) => typeof data === "string" || Array.isArray(data)
|
|
7
|
+
? data.length
|
|
8
|
+
: typeof data === "number"
|
|
9
|
+
? data
|
|
10
|
+
: 0;
|
|
11
|
+
exports.sizeOf = sizeOf;
|
|
12
|
+
const unitsOf = (data) => typeof data === "string"
|
|
13
|
+
? "characters"
|
|
14
|
+
: Array.isArray(data)
|
|
15
|
+
? "items long"
|
|
16
|
+
: "";
|
|
17
|
+
exports.unitsOf = unitsOf;
|
|
18
|
+
class DataWrapper {
|
|
19
|
+
value;
|
|
20
|
+
constructor(value) {
|
|
21
|
+
this.value = value;
|
|
22
|
+
}
|
|
23
|
+
toString() {
|
|
24
|
+
return (0, serialize_js_1.stringify)(this.value);
|
|
25
|
+
}
|
|
26
|
+
get domain() {
|
|
27
|
+
return (0, domains_js_1.domainOf)(this.value);
|
|
28
|
+
}
|
|
29
|
+
get size() {
|
|
30
|
+
return (0, exports.sizeOf)(this.value);
|
|
31
|
+
}
|
|
32
|
+
get units() {
|
|
33
|
+
return (0, exports.unitsOf)(this.value);
|
|
34
|
+
}
|
|
35
|
+
get className() {
|
|
36
|
+
return Object(this.value).constructor.name;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.DataWrapper = DataWrapper;
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.domainDescriptions = exports.domainOf = exports.hasDomain = void 0;
|
|
4
|
+
const hasDomain = (data, domain) => (0, exports.domainOf)(data) === domain;
|
|
5
|
+
exports.hasDomain = hasDomain;
|
|
6
|
+
const domainOf = (data) => {
|
|
7
|
+
const builtinType = typeof data;
|
|
8
|
+
return (builtinType === "object"
|
|
9
|
+
? data === null
|
|
10
|
+
? "null"
|
|
11
|
+
: "object"
|
|
12
|
+
: builtinType === "function"
|
|
13
|
+
? "object"
|
|
14
|
+
: builtinType);
|
|
15
|
+
};
|
|
16
|
+
exports.domainOf = domainOf;
|
|
17
|
+
/** Each domain's completion for the phrase "Must be _____" */
|
|
18
|
+
exports.domainDescriptions = {
|
|
19
|
+
bigint: "a bigint",
|
|
20
|
+
boolean: "boolean",
|
|
21
|
+
null: "null",
|
|
22
|
+
number: "a number",
|
|
23
|
+
object: "an object",
|
|
24
|
+
string: "a string",
|
|
25
|
+
symbol: "a symbol",
|
|
26
|
+
undefined: "undefined"
|
|
27
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.throwParseError = exports.ParseError = exports.throwInternalError = exports.InternalArktypeError = void 0;
|
|
4
|
+
class InternalArktypeError extends Error {
|
|
5
|
+
}
|
|
6
|
+
exports.InternalArktypeError = InternalArktypeError;
|
|
7
|
+
const throwInternalError = (message) => {
|
|
8
|
+
throw new InternalArktypeError(message);
|
|
9
|
+
};
|
|
10
|
+
exports.throwInternalError = throwInternalError;
|
|
11
|
+
class ParseError extends Error {
|
|
12
|
+
}
|
|
13
|
+
exports.ParseError = ParseError;
|
|
14
|
+
const throwParseError = (message) => {
|
|
15
|
+
throw new ParseError(message);
|
|
16
|
+
};
|
|
17
|
+
exports.throwParseError = throwParseError;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deepFreeze = void 0;
|
|
4
|
+
const deepFreeze = (value) => (Object.isFrozen(value)
|
|
5
|
+
? value
|
|
6
|
+
: Array.isArray(value)
|
|
7
|
+
? Object.freeze(value.map(exports.deepFreeze))
|
|
8
|
+
: // Object.isFrozen will always be true for non-objects, so we can safely cast to Dictionary
|
|
9
|
+
deepFreezeDictionary(value));
|
|
10
|
+
exports.deepFreeze = deepFreeze;
|
|
11
|
+
const deepFreezeDictionary = (value) => {
|
|
12
|
+
for (const k in value) {
|
|
13
|
+
(0, exports.deepFreeze)(value[k]);
|
|
14
|
+
}
|
|
15
|
+
return value;
|
|
16
|
+
};
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.listFrom = exports.hasNominalId = exports.getNominalId = exports.nominal = exports.hasKeys = exports.keyCount = exports.hasSingleKey = exports.hasKey = exports.prototypeKeysOf = exports.objectKeysOf = exports.entriesOf = exports.isKeyOf = exports.asConst = void 0;
|
|
4
|
+
const domains_js_1 = require("./domains.js");
|
|
5
|
+
const asConst = (t) => t;
|
|
6
|
+
exports.asConst = asConst;
|
|
7
|
+
const isKeyOf = (k, obj) => k in obj;
|
|
8
|
+
exports.isKeyOf = isKeyOf;
|
|
9
|
+
const entriesOf = (o) => Object.entries(o);
|
|
10
|
+
exports.entriesOf = entriesOf;
|
|
11
|
+
const objectKeysOf = (o) => Object.keys(o);
|
|
12
|
+
exports.objectKeysOf = objectKeysOf;
|
|
13
|
+
/** Mimics output of TS's keyof operator at runtime */
|
|
14
|
+
const prototypeKeysOf = (value) => {
|
|
15
|
+
const result = [];
|
|
16
|
+
while (value !== Object.prototype &&
|
|
17
|
+
value !== null &&
|
|
18
|
+
value !== undefined) {
|
|
19
|
+
for (const k of Object.getOwnPropertyNames(value)) {
|
|
20
|
+
if (!result.includes(k)) {
|
|
21
|
+
result.push(k);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
for (const symbol of Object.getOwnPropertySymbols(value)) {
|
|
25
|
+
if (!result.includes(symbol)) {
|
|
26
|
+
result.push(symbol);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
value = Object.getPrototypeOf(value);
|
|
30
|
+
}
|
|
31
|
+
return result;
|
|
32
|
+
};
|
|
33
|
+
exports.prototypeKeysOf = prototypeKeysOf;
|
|
34
|
+
const hasKey = (o, k) => {
|
|
35
|
+
const valueAtKey = o?.[k];
|
|
36
|
+
return valueAtKey !== undefined && valueAtKey !== null;
|
|
37
|
+
};
|
|
38
|
+
exports.hasKey = hasKey;
|
|
39
|
+
const hasSingleKey = (o, k) => k in o && Object.keys(o).length === 1;
|
|
40
|
+
exports.hasSingleKey = hasSingleKey;
|
|
41
|
+
const keyCount = (o) => Object.keys(o).length;
|
|
42
|
+
exports.keyCount = keyCount;
|
|
43
|
+
const hasKeys = (value) => (0, domains_js_1.hasDomain)(value, "object") ? Object.keys(value).length !== 0 : false;
|
|
44
|
+
exports.hasKeys = hasKeys;
|
|
45
|
+
const id = Symbol("id");
|
|
46
|
+
const nominal = (o, name) => Object.assign(o, { [id]: name });
|
|
47
|
+
exports.nominal = nominal;
|
|
48
|
+
const getNominalId = (data) => (0, domains_js_1.hasDomain)(data, "object") && id in data ? data[id] : undefined;
|
|
49
|
+
exports.getNominalId = getNominalId;
|
|
50
|
+
const hasNominalId = (data, name) => (0, exports.getNominalId)(data) === name;
|
|
51
|
+
exports.hasNominalId = hasNominalId;
|
|
52
|
+
const listFrom = (data) => (Array.isArray(data) ? data : [data]);
|
|
53
|
+
exports.listFrom = listFrom;
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tryParseWellFormedBigint = exports.tryParseWellFormedInteger = exports.tryParseWellFormedNumber = exports.writeMalformedNumericLiteralMessage = exports.wellFormedNonNegativeIntegerMatcher = exports.isWellFormedInteger = exports.wellFormedIntegerMatcher = exports.wellFormedNumberMatcher = void 0;
|
|
4
|
+
const errors_js_1 = require("./errors.js");
|
|
5
|
+
/**
|
|
6
|
+
* The goal of the number literal and bigint literal regular expressions is to:
|
|
7
|
+
*
|
|
8
|
+
* 1. Ensure definitions form a bijection with the values they represent.
|
|
9
|
+
* 2. Attempt to mirror TypeScript's own format for stringification of numeric
|
|
10
|
+
* values such that the regex should match a given definition if any only if
|
|
11
|
+
* a precise literal type will be inferred (in TS4.8+).
|
|
12
|
+
*/
|
|
13
|
+
/**
|
|
14
|
+
* Matches a well-formatted numeric expression according to the following rules:
|
|
15
|
+
* 1. Must include an integer portion (i.e. '.321' must be written as '0.321')
|
|
16
|
+
* 2. The first digit of the value must not be 0, unless the entire integer portion is 0
|
|
17
|
+
* 3. If the value includes a decimal, its last digit may not be 0
|
|
18
|
+
* 4. The value may not be "-0"
|
|
19
|
+
*/
|
|
20
|
+
exports.wellFormedNumberMatcher = /^(?!^-0$)-?(?:0|[1-9]\d*)(?:\.\d*[1-9])?$/;
|
|
21
|
+
const isWellFormedNumber = (s) => exports.wellFormedNumberMatcher.test(s);
|
|
22
|
+
const numberLikeMatcher = /^-?\d*\.?\d*$/;
|
|
23
|
+
const isNumberLike = (s) => s.length !== 0 && numberLikeMatcher.test(s);
|
|
24
|
+
/**
|
|
25
|
+
* Matches a well-formatted integer according to the following rules:
|
|
26
|
+
* 1. Must begin with an integer, the first digit of which cannot be 0 unless the entire value is 0
|
|
27
|
+
* 2. The value may not be "-0"
|
|
28
|
+
*/
|
|
29
|
+
exports.wellFormedIntegerMatcher = /^(?:0|(?:-?[1-9]\d*))$/;
|
|
30
|
+
const isWellFormedInteger = (s) => exports.wellFormedIntegerMatcher.test(s);
|
|
31
|
+
exports.isWellFormedInteger = isWellFormedInteger;
|
|
32
|
+
exports.wellFormedNonNegativeIntegerMatcher = /^(?:0|(?:[1-9]\d*))$/;
|
|
33
|
+
const integerLikeMatcher = /^-?\d+$/;
|
|
34
|
+
const isIntegerLike = (s) => integerLikeMatcher.test(s);
|
|
35
|
+
const numericLiteralDescriptions = {
|
|
36
|
+
number: "a number",
|
|
37
|
+
bigint: "a bigint",
|
|
38
|
+
integer: "an integer"
|
|
39
|
+
};
|
|
40
|
+
const writeMalformedNumericLiteralMessage = (def, kind) => `'${def}' was parsed as ${numericLiteralDescriptions[kind]} but could not be narrowed to a literal value. Avoid unnecessary leading or trailing zeros and other abnormal notation`;
|
|
41
|
+
exports.writeMalformedNumericLiteralMessage = writeMalformedNumericLiteralMessage;
|
|
42
|
+
const isWellFormed = (def, kind) => kind === "number" ? isWellFormedNumber(def) : (0, exports.isWellFormedInteger)(def);
|
|
43
|
+
const parseKind = (def, kind) => kind === "number" ? Number(def) : Number.parseInt(def);
|
|
44
|
+
const isKindLike = (def, kind) => kind === "number" ? isNumberLike(def) : isIntegerLike(def);
|
|
45
|
+
const tryParseWellFormedNumber = (token, errorOnFail) => parseWellFormed(token, "number", errorOnFail);
|
|
46
|
+
exports.tryParseWellFormedNumber = tryParseWellFormedNumber;
|
|
47
|
+
const tryParseWellFormedInteger = (token, errorOnFail) => parseWellFormed(token, "integer", errorOnFail);
|
|
48
|
+
exports.tryParseWellFormedInteger = tryParseWellFormedInteger;
|
|
49
|
+
const parseWellFormed = (token, kind, errorOnFail) => {
|
|
50
|
+
const value = parseKind(token, kind);
|
|
51
|
+
if (!Number.isNaN(value)) {
|
|
52
|
+
if (isWellFormed(token, kind)) {
|
|
53
|
+
return value;
|
|
54
|
+
}
|
|
55
|
+
if (isKindLike(token, kind)) {
|
|
56
|
+
// If the definition looks like the correct numeric kind but is
|
|
57
|
+
// not well-formed, always throw.
|
|
58
|
+
return (0, errors_js_1.throwParseError)((0, exports.writeMalformedNumericLiteralMessage)(token, kind));
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
return (errorOnFail
|
|
62
|
+
? (0, errors_js_1.throwParseError)(errorOnFail === true
|
|
63
|
+
? `Failed to parse ${numericLiteralDescriptions[kind]} from '${token}'`
|
|
64
|
+
: errorOnFail)
|
|
65
|
+
: undefined);
|
|
66
|
+
};
|
|
67
|
+
const tryParseWellFormedBigint = (def) => {
|
|
68
|
+
if (def[def.length - 1] !== "n") {
|
|
69
|
+
return;
|
|
70
|
+
}
|
|
71
|
+
const maybeIntegerLiteral = def.slice(0, -1);
|
|
72
|
+
let value;
|
|
73
|
+
try {
|
|
74
|
+
value = BigInt(maybeIntegerLiteral);
|
|
75
|
+
}
|
|
76
|
+
catch {
|
|
77
|
+
return;
|
|
78
|
+
}
|
|
79
|
+
if (exports.wellFormedIntegerMatcher.test(maybeIntegerLiteral)) {
|
|
80
|
+
return value;
|
|
81
|
+
}
|
|
82
|
+
if (integerLikeMatcher.test(maybeIntegerLiteral)) {
|
|
83
|
+
// If the definition looks like a bigint but is
|
|
84
|
+
// not well-formed, throw.
|
|
85
|
+
return (0, errors_js_1.throwParseError)((0, exports.writeMalformedNumericLiteralMessage)(def, "bigint"));
|
|
86
|
+
}
|
|
87
|
+
};
|
|
88
|
+
exports.tryParseWellFormedBigint = tryParseWellFormedBigint;
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getExactConstructorObjectKind = exports.objectKindDescriptions = exports.isArray = exports.hasObjectKind = exports.objectKindOf = exports.defaultObjectKinds = void 0;
|
|
4
|
+
const domains_js_1 = require("./domains.js");
|
|
5
|
+
const generics_js_1 = require("./generics.js");
|
|
6
|
+
// Built-in object constructors based on a subset of:
|
|
7
|
+
// https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects
|
|
8
|
+
exports.defaultObjectKinds = {
|
|
9
|
+
Array,
|
|
10
|
+
Date,
|
|
11
|
+
Error,
|
|
12
|
+
Function,
|
|
13
|
+
Map,
|
|
14
|
+
RegExp,
|
|
15
|
+
Set,
|
|
16
|
+
Object,
|
|
17
|
+
String,
|
|
18
|
+
Number,
|
|
19
|
+
Boolean,
|
|
20
|
+
WeakMap,
|
|
21
|
+
WeakSet,
|
|
22
|
+
Promise
|
|
23
|
+
};
|
|
24
|
+
const objectKindOf = (data, kinds) => {
|
|
25
|
+
if ((0, domains_js_1.domainOf)(data) !== "object") {
|
|
26
|
+
return undefined;
|
|
27
|
+
}
|
|
28
|
+
const kindSet = kinds ?? exports.defaultObjectKinds;
|
|
29
|
+
let prototype = Object.getPrototypeOf(data);
|
|
30
|
+
while (prototype?.constructor &&
|
|
31
|
+
(!kindSet[prototype.constructor.name] ||
|
|
32
|
+
!(data instanceof kindSet[prototype.constructor.name]))) {
|
|
33
|
+
prototype = Object.getPrototypeOf(prototype);
|
|
34
|
+
}
|
|
35
|
+
return prototype?.constructor?.name;
|
|
36
|
+
};
|
|
37
|
+
exports.objectKindOf = objectKindOf;
|
|
38
|
+
const hasObjectKind = (data, kind, kinds) => (0, exports.objectKindOf)(data, kinds) === kind;
|
|
39
|
+
exports.hasObjectKind = hasObjectKind;
|
|
40
|
+
const isArray = (data) => Array.isArray(data);
|
|
41
|
+
exports.isArray = isArray;
|
|
42
|
+
/** Each defaultObjectKind's completion for the phrase "Must be _____" */
|
|
43
|
+
exports.objectKindDescriptions = {
|
|
44
|
+
Object: "an object",
|
|
45
|
+
Array: "an array",
|
|
46
|
+
Function: "a function",
|
|
47
|
+
Date: "a Date",
|
|
48
|
+
RegExp: "a RegExp",
|
|
49
|
+
Error: "an Error",
|
|
50
|
+
Map: "a Map",
|
|
51
|
+
Set: "a Set",
|
|
52
|
+
String: "a String object",
|
|
53
|
+
Number: "a Number object",
|
|
54
|
+
Boolean: "a Boolean object",
|
|
55
|
+
Promise: "a Promise",
|
|
56
|
+
WeakMap: "a WeakMap",
|
|
57
|
+
WeakSet: "a WeakSet"
|
|
58
|
+
};
|
|
59
|
+
// this will only return an object kind if it's the root constructor
|
|
60
|
+
// example TypeError would return undefined not 'Error'
|
|
61
|
+
const getExactConstructorObjectKind = (constructor) => {
|
|
62
|
+
const constructorName = Object(constructor).name;
|
|
63
|
+
return constructorName &&
|
|
64
|
+
(0, generics_js_1.isKeyOf)(constructorName, exports.defaultObjectKinds) &&
|
|
65
|
+
exports.defaultObjectKinds[constructorName] === constructor
|
|
66
|
+
? constructorName
|
|
67
|
+
: undefined;
|
|
68
|
+
};
|
|
69
|
+
exports.getExactConstructorObjectKind = getExactConstructorObjectKind;
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getPath = exports.Path = void 0;
|
|
4
|
+
class Path extends Array {
|
|
2
5
|
static fromString(s, delimiter = "/") {
|
|
3
6
|
return s === delimiter ? new Path() : new Path(...s.split(delimiter));
|
|
4
7
|
}
|
|
@@ -6,9 +9,10 @@ export class Path extends Array {
|
|
|
6
9
|
return this.length ? this.join(delimiter) : delimiter;
|
|
7
10
|
}
|
|
8
11
|
}
|
|
9
|
-
|
|
12
|
+
exports.Path = Path;
|
|
13
|
+
const getPath = (root, path) => {
|
|
10
14
|
let result = root;
|
|
11
|
-
for (const segment of path){
|
|
15
|
+
for (const segment of path) {
|
|
12
16
|
if (typeof result !== "object" || result === null) {
|
|
13
17
|
return undefined;
|
|
14
18
|
}
|
|
@@ -16,3 +20,4 @@ export const getPath = (root, path)=>{
|
|
|
16
20
|
}
|
|
17
21
|
return result;
|
|
18
22
|
};
|
|
23
|
+
exports.getPath = getPath;
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deserializePrimitive = exports.serializePrimitive = exports.stringify = exports.snapshot = void 0;
|
|
4
|
+
const domains_js_1 = require("./domains.js");
|
|
5
|
+
const generics_js_1 = require("./generics.js");
|
|
6
|
+
const numericLiterals_js_1 = require("./numericLiterals.js");
|
|
7
|
+
const snapshot = (data, opts = {}) => serializeRecurse(data, opts, []);
|
|
8
|
+
exports.snapshot = snapshot;
|
|
9
|
+
const stringify = (data, indent) => {
|
|
10
|
+
switch ((0, domains_js_1.domainOf)(data)) {
|
|
11
|
+
case "object":
|
|
12
|
+
return JSON.stringify(serializeRecurse(data, stringifyOpts, []), null, indent);
|
|
13
|
+
case "symbol":
|
|
14
|
+
return stringifyOpts.onSymbol(data);
|
|
15
|
+
default:
|
|
16
|
+
return (0, exports.serializePrimitive)(data);
|
|
17
|
+
}
|
|
18
|
+
};
|
|
19
|
+
exports.stringify = stringify;
|
|
20
|
+
const stringifyOpts = {
|
|
21
|
+
onCycle: () => "(cycle)",
|
|
22
|
+
onSymbol: (v) => `(symbol${v.description && ` ${v.description}`})`,
|
|
23
|
+
onFunction: (v) => `(function${v.name && ` ${v.name}`})`
|
|
24
|
+
};
|
|
25
|
+
const serializeRecurse = (data, context, seen) => {
|
|
26
|
+
switch ((0, domains_js_1.domainOf)(data)) {
|
|
27
|
+
case "object":
|
|
28
|
+
if (typeof data === "function") {
|
|
29
|
+
return stringifyOpts.onFunction(data);
|
|
30
|
+
}
|
|
31
|
+
if (seen.includes(data)) {
|
|
32
|
+
return "(cycle)";
|
|
33
|
+
}
|
|
34
|
+
const nextSeen = [...seen, data];
|
|
35
|
+
if (Array.isArray(data)) {
|
|
36
|
+
return data.map((item) => serializeRecurse(item, context, nextSeen));
|
|
37
|
+
}
|
|
38
|
+
const result = {};
|
|
39
|
+
for (const k in data) {
|
|
40
|
+
result[k] = serializeRecurse(data[k], context, nextSeen);
|
|
41
|
+
}
|
|
42
|
+
return result;
|
|
43
|
+
case "symbol":
|
|
44
|
+
return stringifyOpts.onSymbol(data);
|
|
45
|
+
case "bigint":
|
|
46
|
+
return `${data}n`;
|
|
47
|
+
case "undefined":
|
|
48
|
+
return "undefined";
|
|
49
|
+
default:
|
|
50
|
+
return data;
|
|
51
|
+
}
|
|
52
|
+
};
|
|
53
|
+
const serializePrimitive = (value) => (typeof value === "string"
|
|
54
|
+
? `'${value}'`
|
|
55
|
+
: typeof value === "bigint"
|
|
56
|
+
? `${value}n`
|
|
57
|
+
: `${value}`);
|
|
58
|
+
exports.serializePrimitive = serializePrimitive;
|
|
59
|
+
const deserializePrimitive = (serialized) => ((0, generics_js_1.isKeyOf)(serialized, serializedKeywords)
|
|
60
|
+
? serializedKeywords[serialized]
|
|
61
|
+
: serialized[0] === "'"
|
|
62
|
+
? serialized.slice(1, -1)
|
|
63
|
+
: (0, numericLiterals_js_1.tryParseWellFormedBigint)(serialized) ??
|
|
64
|
+
(0, numericLiterals_js_1.tryParseWellFormedNumber)(serialized, true));
|
|
65
|
+
exports.deserializePrimitive = deserializePrimitive;
|
|
66
|
+
const serializedKeywords = {
|
|
67
|
+
true: true,
|
|
68
|
+
false: false,
|
|
69
|
+
undefined,
|
|
70
|
+
null: null
|
|
71
|
+
};
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "arktype",
|
|
3
3
|
"description": "TypeScript's 1:1 validator, optimized from editor to runtime",
|
|
4
|
-
"version": "1.0.
|
|
4
|
+
"version": "1.0.15-alpha",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "David Blass",
|
|
7
7
|
"email": "david@arktype.io",
|
|
@@ -12,24 +12,17 @@
|
|
|
12
12
|
"url": "https://github.com/arktypeio/arktype.git"
|
|
13
13
|
},
|
|
14
14
|
"type": "module",
|
|
15
|
-
"main": "./dist/
|
|
16
|
-
"types": "./dist/
|
|
15
|
+
"main": "./dist/main.js",
|
|
16
|
+
"types": "./dist/main.d.ts",
|
|
17
17
|
"exports": {
|
|
18
|
-
".":
|
|
19
|
-
|
|
20
|
-
"import": "./dist/mjs/main.js",
|
|
21
|
-
"require": "./dist/cjs/main.js"
|
|
22
|
-
},
|
|
23
|
-
"./internal/*": {
|
|
24
|
-
"types": "./dist/types/*",
|
|
25
|
-
"import": "./dist/mjs/*",
|
|
26
|
-
"require": "./dist/cjs/*"
|
|
27
|
-
}
|
|
18
|
+
".": "./dist/main.js",
|
|
19
|
+
"./internal/*": "./dist/*"
|
|
28
20
|
},
|
|
29
21
|
"files": [
|
|
30
|
-
"dist"
|
|
22
|
+
"dist",
|
|
23
|
+
"!*.tsbuildinfo"
|
|
31
24
|
],
|
|
32
|
-
"packageManager": "pnpm@
|
|
25
|
+
"packageManager": "pnpm@8.3.1",
|
|
33
26
|
"devDependencies": {
|
|
34
27
|
"@changesets/changelog-github": "0.4.8",
|
|
35
28
|
"@changesets/cli": "2.26.1",
|
|
@@ -43,13 +36,11 @@
|
|
|
43
36
|
"eslint": "8.36.0",
|
|
44
37
|
"eslint-config-prettier": "8.8.0",
|
|
45
38
|
"eslint-define-config": "1.17.0",
|
|
39
|
+
"eslint-plugin-only-warn": "1.1.0",
|
|
46
40
|
"eslint-import-resolver-typescript": "3.5.3",
|
|
47
41
|
"eslint-plugin-import": "2.27.5",
|
|
48
|
-
"eslint-plugin-only-warn": "1.1.0",
|
|
49
42
|
"eslint-plugin-prefer-arrow": "1.2.3",
|
|
50
43
|
"eslint-plugin-unicorn": "46.0.0",
|
|
51
|
-
"fast-check": "3.7.1",
|
|
52
|
-
"get-current-line": "6.6.0",
|
|
53
44
|
"husky": "8.0.3",
|
|
54
45
|
"mocha": "10.2.0",
|
|
55
46
|
"prettier": "2.8.6",
|
|
@@ -57,12 +48,11 @@
|
|
|
57
48
|
"pretty-quick": "3.1.3",
|
|
58
49
|
"ts-morph": "18.0.0",
|
|
59
50
|
"ts-node": "10.9.1",
|
|
60
|
-
"typescript": "5.0.3"
|
|
61
|
-
"zod": "3.21.4"
|
|
51
|
+
"typescript": "5.0.3"
|
|
62
52
|
},
|
|
63
53
|
"c8": {
|
|
64
54
|
"checkCoverage": true,
|
|
65
|
-
"lines":
|
|
55
|
+
"lines": 96,
|
|
66
56
|
"src": "./src",
|
|
67
57
|
"exclude": [
|
|
68
58
|
"test/**",
|
|
@@ -78,8 +68,7 @@
|
|
|
78
68
|
},
|
|
79
69
|
"mocha": {
|
|
80
70
|
"spec": [
|
|
81
|
-
"dev/test/*.test
|
|
82
|
-
"test/*.test.ts"
|
|
71
|
+
"./dev/test/*.test.*"
|
|
83
72
|
],
|
|
84
73
|
"ignore": "**/node_modules/*",
|
|
85
74
|
"node-option": [
|
|
@@ -91,25 +80,22 @@
|
|
|
91
80
|
"extends": "./dev/configs/.eslintrc.cjs"
|
|
92
81
|
},
|
|
93
82
|
"scripts": {
|
|
94
|
-
"prChecks": "pnpm install && pnpm
|
|
83
|
+
"prChecks": "pnpm install && pnpm lint && pnpm checkFormat && pnpm testRepo && pnpm buildRepo",
|
|
84
|
+
"build": "pnpm ts ./dev/scripts/build.ts",
|
|
85
|
+
"buildRepo": "pnpm build && pnpm run -r build",
|
|
86
|
+
"test": "pnpm ts ./dev/scripts/test.ts",
|
|
87
|
+
"tnt": "pnpm ts ./dev/scripts/test.ts --skipTypes",
|
|
88
|
+
"testRepo": "pnpm -r test && pnpm testTsVersions",
|
|
89
|
+
"testTsVersions": "pnpm ts ./dev/scripts/testTsVersions.ts",
|
|
95
90
|
"typecheck": "tsc --noEmit",
|
|
96
|
-
"
|
|
97
|
-
"buildRepo": "pnpm build && pnpm docgen && pnpm buildSite",
|
|
98
|
-
"buildSite": "cd dev/arktype.io && pnpm install && pnpm build",
|
|
99
|
-
"docgen": "ts-node ./dev/scripts/docgen.ts",
|
|
100
|
-
"test": "ts-node ./dev/attest/cli.ts --coverage --cmd mocha",
|
|
101
|
-
"tnt": "ts-node ./dev/attest/cli.ts --coverage --skipTypes --cmd mocha",
|
|
102
|
-
"testRepo": " pnpm testBuild && pnpm testTsVersions && pnpm testAttest",
|
|
103
|
-
"testBuild": "ts-node ./dev/scripts/testBuild.ts",
|
|
104
|
-
"testAttest": "ts-node ./dev/scripts/testAttest.ts",
|
|
105
|
-
"testTsVersions": "ts-node ./dev/scripts/testTsVersions.ts",
|
|
106
|
-
"bench": "ts-node ./dev/attest/cli.ts bench --benchmarksPath ./test/benchmarks.json",
|
|
91
|
+
"ts": "node --loader=ts-node/esm --no-warnings=ExperimentalWarning",
|
|
107
92
|
"lint": "eslint --max-warnings=0 .",
|
|
108
93
|
"format": "prettier --write --ignore-path ./dev/configs/.prettierignore .",
|
|
109
|
-
"
|
|
94
|
+
"checkFormat": "prettier --check --ignore-path ./dev/configs/.prettierignore .",
|
|
95
|
+
"findUnused": "pnpm ts ./dev/scripts/findUnusedExports.ts",
|
|
110
96
|
"preinstall": "npx only-allow pnpm",
|
|
111
|
-
"changeset": "ts
|
|
112
|
-
"ci:version": "ts
|
|
113
|
-
"ci:publish": "ts
|
|
97
|
+
"changeset": "pnpm ts ./dev/scripts/changeset.ts",
|
|
98
|
+
"ci:version": "pnpm ts ./dev/scripts/updateVersions.ts",
|
|
99
|
+
"ci:publish": "pnpm ts ./dev/scripts/changeset.ts publish"
|
|
114
100
|
}
|
|
115
101
|
}
|
package/dist/cjs/main.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", {
|
|
3
|
-
value: true
|
|
4
|
-
});
|
|
5
|
-
function _export(target, all) {
|
|
6
|
-
for(var name in all)Object.defineProperty(target, name, {
|
|
7
|
-
enumerable: true,
|
|
8
|
-
get: all[name]
|
|
9
|
-
});
|
|
10
|
-
}
|
|
11
|
-
_export(exports, {
|
|
12
|
-
scope: ()=>_scopeJs.scope,
|
|
13
|
-
type: ()=>_arkJs.type,
|
|
14
|
-
ark: ()=>_arkJs.ark,
|
|
15
|
-
arkScope: ()=>_arkJs.arkScope,
|
|
16
|
-
arrayOf: ()=>_expressionsJs.arrayOf,
|
|
17
|
-
instanceOf: ()=>_expressionsJs.instanceOf,
|
|
18
|
-
intersection: ()=>_expressionsJs.intersection,
|
|
19
|
-
keyOf: ()=>_expressionsJs.keyOf,
|
|
20
|
-
morph: ()=>_expressionsJs.morph,
|
|
21
|
-
narrow: ()=>_expressionsJs.narrow,
|
|
22
|
-
union: ()=>_expressionsJs.union,
|
|
23
|
-
valueOf: ()=>_expressionsJs.valueOf,
|
|
24
|
-
jsObjectsScope: ()=>_jsObjectsJs.jsObjectsScope,
|
|
25
|
-
tsKeywordsScope: ()=>_tsKeywordsJs.tsKeywordsScope,
|
|
26
|
-
validationScope: ()=>_validationJs.validationScope,
|
|
27
|
-
Problems: ()=>_problemsJs.Problems,
|
|
28
|
-
Problem: ()=>_problemsJs.Problem,
|
|
29
|
-
parseConfigTuple: ()=>_configJs.parseConfigTuple
|
|
30
|
-
});
|
|
31
|
-
const _scopeJs = require("./scopes/scope.js");
|
|
32
|
-
const _arkJs = require("./scopes/ark.js");
|
|
33
|
-
const _expressionsJs = require("./scopes/expressions.js");
|
|
34
|
-
const _jsObjectsJs = require("./scopes/jsObjects.js");
|
|
35
|
-
const _tsKeywordsJs = require("./scopes/tsKeywords.js");
|
|
36
|
-
const _validationJs = require("./scopes/validation/validation.js");
|
|
37
|
-
const _problemsJs = require("./traverse/problems.js");
|
|
38
|
-
const _configJs = require("./parse/ast/config.js");
|