arktype 3.0.0-beta.1 → 3.0.0-rc.0
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 +48 -144
- package/out/_internal/regex/charset.d.ts +24 -0
- package/out/_internal/regex/escape.d.ts +29 -0
- package/out/_internal/regex/execArray.d.ts +24 -0
- package/out/_internal/regex/group.d.ts +34 -0
- package/out/_internal/regex/index.d.ts +2 -0
- package/out/_internal/regex/internal.d.ts +9 -0
- package/out/_internal/regex/parse.d.ts +10 -0
- package/out/_internal/regex/quantify.d.ts +59 -0
- package/out/_internal/regex/regex.d.ts +38 -0
- package/out/_internal/regex/state.d.ts +383 -0
- package/out/_internal/schema/codecs.d.ts +2 -0
- package/out/_internal/schema/config.d.ts +103 -0
- package/out/_internal/schema/constraint.d.ts +78 -0
- package/out/_internal/schema/errors.d.ts +1 -0
- package/out/_internal/schema/generic.d.ts +85 -0
- package/out/_internal/schema/i18n.d.ts +3 -0
- package/out/_internal/schema/index.d.ts +54 -0
- package/out/_internal/schema/internal.d.ts +15 -0
- package/out/_internal/schema/intrinsic.d.ts +28 -0
- package/out/_internal/schema/kinds.d.ts +76 -0
- package/out/_internal/schema/module.d.ts +23 -0
- package/out/_internal/schema/mutatesInput.d.ts +2 -0
- package/out/_internal/schema/node.d.ts +349 -0
- package/out/_internal/schema/parse.d.ts +77 -0
- package/out/_internal/schema/parseSchema.d.ts +116 -0
- package/out/_internal/schema/predicate.d.ts +46 -0
- package/out/_internal/schema/refinements/after.d.ts +32 -0
- package/out/_internal/schema/refinements/before.d.ts +32 -0
- package/out/_internal/schema/refinements/divisor.d.ts +41 -0
- package/out/_internal/schema/refinements/exactLength.d.ts +43 -0
- package/out/_internal/schema/refinements/kinds.d.ts +40 -0
- package/out/_internal/schema/refinements/max.d.ts +33 -0
- package/out/_internal/schema/refinements/maxLength.d.ts +32 -0
- package/out/_internal/schema/refinements/min.d.ts +33 -0
- package/out/_internal/schema/refinements/minLength.d.ts +32 -0
- package/out/_internal/schema/refinements/notEqual.d.ts +38 -0
- package/out/_internal/schema/refinements/notEqualLength.d.ts +38 -0
- package/out/_internal/schema/refinements/pattern.d.ts +43 -0
- package/out/_internal/schema/refinements/range.d.ts +101 -0
- package/out/_internal/schema/roots/alias.d.ts +49 -0
- package/out/_internal/schema/roots/basis.d.ts +12 -0
- package/out/_internal/schema/roots/domain.d.ts +45 -0
- package/out/_internal/schema/roots/intersection.d.ts +72 -0
- package/out/_internal/schema/roots/morph.d.ts +59 -0
- package/out/_internal/schema/roots/proto.d.ts +42 -0
- package/out/_internal/schema/roots/root.d.ts +163 -0
- package/out/_internal/schema/roots/union.d.ts +146 -0
- package/out/_internal/schema/roots/unit.d.ts +36 -0
- package/out/_internal/schema/runtime.d.ts +29 -0
- package/out/_internal/schema/runtimeLean.d.ts +2 -0
- package/out/_internal/schema/runtimeNone.d.ts +2 -0
- package/out/_internal/schema/runtimeNoneLean.d.ts +2 -0
- package/out/_internal/schema/scope.d.ts +203 -0
- package/out/_internal/schema/shared/codecs.d.ts +5 -0
- package/out/_internal/schema/shared/compile.d.ts +144 -0
- package/out/_internal/schema/shared/configured.d.ts +14 -0
- package/out/_internal/schema/shared/declare.d.ts +100 -0
- package/out/_internal/schema/shared/disjoint.d.ts +45 -0
- package/out/_internal/schema/shared/enWriters.d.ts +30 -0
- package/out/_internal/schema/shared/errorModes.d.ts +25 -0
- package/out/_internal/schema/shared/errorWriters.d.ts +34 -0
- package/out/_internal/schema/shared/errors.d.ts +264 -0
- package/out/_internal/schema/shared/implement.d.ts +154 -0
- package/out/_internal/schema/shared/inPlace.d.ts +8 -0
- package/out/_internal/schema/shared/issueFeatures.d.ts +38 -0
- package/out/_internal/schema/shared/issues.d.ts +261 -0
- package/out/_internal/schema/shared/issuesLean.d.ts +80 -0
- package/out/_internal/schema/shared/issuesNone.d.ts +22 -0
- package/out/_internal/schema/shared/issuesNoneLean.d.ts +20 -0
- package/out/_internal/schema/shared/issuesUndetailed.d.ts +25 -0
- package/out/_internal/schema/shared/jsonSchema.d.ts +153 -0
- package/out/_internal/schema/shared/listed.d.ts +15 -0
- package/out/_internal/schema/shared/locale.d.ts +149 -0
- package/out/_internal/schema/shared/registry.d.ts +16 -0
- package/out/_internal/schema/shared/render.d.ts +3 -0
- package/out/_internal/schema/shared/rootApply.d.ts +19 -0
- package/out/_internal/schema/shared/sets.d.ts +26 -0
- package/out/_internal/schema/shared/standardFailure.d.ts +22 -0
- package/out/_internal/schema/shared/standardSchema.d.ts +124 -0
- package/out/_internal/schema/shared/toJsonSchema.d.ts +229 -0
- package/out/_internal/schema/shared/transform.d.ts +35 -0
- package/out/_internal/schema/shared/traversal.d.ts +288 -0
- package/out/_internal/schema/shared/utils.d.ts +59 -0
- package/out/_internal/schema/structure/index.d.ts +43 -0
- package/out/_internal/schema/structure/optional.d.ts +61 -0
- package/out/_internal/schema/structure/prop.d.ts +45 -0
- package/out/_internal/schema/structure/required.d.ts +49 -0
- package/out/_internal/schema/structure/sequence.d.ts +127 -0
- package/out/_internal/schema/structure/shared.d.ts +3 -0
- package/out/_internal/schema/structure/structure.d.ts +178 -0
- package/out/_internal/schema/units.d.ts +123 -0
- package/out/_internal/sets/algebra.d.ts +26 -0
- package/out/_internal/sets/constraint.d.ts +19 -0
- package/out/_internal/sets/engine.d.ts +2 -0
- package/out/_internal/sets/formats.d.ts +23 -0
- package/out/_internal/sets/fromJsonSchema.d.ts +15 -0
- package/out/_internal/sets/implement.d.ts +16 -0
- package/out/_internal/sets/index.d.ts +2 -0
- package/out/_internal/sets/internal.d.ts +20 -0
- package/out/_internal/sets/intersections.d.ts +5 -0
- package/out/_internal/sets/kinds.d.ts +3 -0
- package/out/_internal/sets/refinements.d.ts +14 -0
- package/out/_internal/sets/roots/alias.d.ts +3 -0
- package/out/_internal/sets/roots/domain.d.ts +3 -0
- package/out/_internal/sets/roots/intersection.d.ts +4 -0
- package/out/_internal/sets/roots/morph.d.ts +4 -0
- package/out/_internal/sets/roots/proto.d.ts +3 -0
- package/out/_internal/sets/roots/union.d.ts +16 -0
- package/out/_internal/sets/roots/unit.d.ts +3 -0
- package/out/_internal/sets/structure/index.d.ts +3 -0
- package/out/_internal/sets/structure/prop.d.ts +8 -0
- package/out/_internal/sets/structure/sequence.d.ts +3 -0
- package/out/_internal/sets/structure/structure.d.ts +3 -0
- package/out/_internal/sets/toJsonSchema.d.ts +25 -0
- package/out/_internal/util/arrays.d.ts +130 -0
- package/out/_internal/util/clone.d.ts +4 -0
- package/out/_internal/util/describe.d.ts +25 -0
- package/out/_internal/util/domain.d.ts +49 -0
- package/out/_internal/util/errors.d.ts +29 -0
- package/out/_internal/util/facts.d.ts +22 -0
- package/out/_internal/util/flatMorph.d.ts +41 -0
- package/out/_internal/util/formats.d.ts +8 -0
- package/out/_internal/util/functions.d.ts +33 -0
- package/out/_internal/util/generics.d.ts +65 -0
- package/out/_internal/util/get.d.ts +9 -0
- package/out/_internal/util/hkt.d.ts +27 -0
- package/out/_internal/util/i18n.d.ts +12 -0
- package/out/_internal/util/index.d.ts +28 -0
- package/out/_internal/util/internal.d.ts +2 -0
- package/out/_internal/util/intersections.d.ts +50 -0
- package/out/_internal/util/isomorphic.d.ts +8 -0
- package/out/_internal/util/keys.d.ts +18 -0
- package/out/_internal/util/lazily.d.ts +7 -0
- package/out/_internal/util/numbers.d.ts +82 -0
- package/out/_internal/util/objectKinds.d.ts +157 -0
- package/out/_internal/util/path.d.ts +16 -0
- package/out/_internal/util/primitive.d.ts +16 -0
- package/out/_internal/util/records.d.ts +173 -0
- package/out/_internal/util/registry.d.ts +13 -0
- package/out/_internal/util/scanner.d.ts +110 -0
- package/out/_internal/util/serialize.d.ts +40 -0
- package/out/_internal/util/strings.d.ts +35 -0
- package/out/_internal/util/traits.d.ts +89 -0
- package/out/_internal/util/unionToTuple.d.ts +14 -0
- package/out/_internal/util/weak.d.ts +8 -0
- package/out/attributes.d.ts +15 -11
- package/out/checkers.d.ts +1 -1
- package/out/chunk-22RQSVV3.js +0 -0
- package/out/chunk-3HZC67MT.js +965 -0
- package/out/chunk-3KBOPH3J.js +1564 -0
- package/out/chunk-3SH2BQ4T.js +15 -0
- package/out/chunk-46PLKNON.js +126 -0
- package/out/{chunk-G45P2CLE.js → chunk-4FTHWK63.js} +6 -1
- package/out/{chunk-UK5UGFOX.js → chunk-4HREHNIV.js} +23 -11
- package/out/chunk-4NZCLVBD.js +14 -0
- package/out/chunk-6FMBO47M.js +7 -0
- package/out/chunk-7TALAWYX.js +10 -0
- package/out/{chunk-DLWCO4RV.js → chunk-BCYKO54Z.js} +11 -2
- package/out/chunk-BDJVONP7.js +168 -0
- package/out/{chunk-E3DZXEZK.js → chunk-C2JOL5M2.js} +4 -2
- package/out/{chunk-2U2AWCI3.js → chunk-C2V6QPE3.js} +126 -97
- package/out/chunk-C3B4IFQL.js +6408 -0
- package/out/chunk-CWSF57VM.js +10 -0
- package/out/chunk-F5BACUJS.js +7 -0
- package/out/{chunk-EVCML554.js → chunk-FWRSDUJ2.js} +14 -5
- package/out/chunk-GID3FSQA.js +161 -0
- package/out/chunk-I2KLQ2HA.js +22 -0
- package/out/chunk-K7SLP5D2.js +84 -0
- package/out/chunk-KQPSKGUI.js +9 -0
- package/out/chunk-KXOC3JEX.js +8234 -0
- package/out/chunk-KXOSUYRA.js +405 -0
- package/out/chunk-LHNEY6QW.js +0 -0
- package/out/chunk-MTWKGAGO.js +323 -0
- package/out/chunk-NU73GNCX.js +170 -0
- package/out/{chunk-RAZ3TXOE.js → chunk-P5W67FQH.js} +34 -19
- package/out/chunk-PDLTEX6Z.js +1118 -0
- package/out/{chunk-VV6YDN2D.js → chunk-QUS4IAXJ.js} +304 -263
- package/out/chunk-R7WXIH5P.js +94 -0
- package/out/chunk-TACLEIDM.js +95 -0
- package/out/chunk-UJJGG4VQ.js +71 -0
- package/out/chunk-US6BWOGJ.js +109 -0
- package/out/chunk-VMMMOO4R.js +945 -0
- package/out/chunk-VYMXHSFR.js +439 -0
- package/out/chunk-W2XOI5DY.js +141 -0
- package/out/chunk-WC5L5YRP.js +25 -0
- package/out/{chunk-NRIGTMPM.js → chunk-WKOSL2G6.js} +4 -1
- package/out/chunk-XLG66ZDF.js +0 -0
- package/out/{chunk-5U2ZMDNI.js → chunk-XNUAQSJ4.js} +52 -30
- package/out/chunk-ZRYEHGSG.js +79 -0
- package/out/cli.d.ts +28 -0
- package/out/cli.js +636 -0
- package/out/codecs.d.ts +6 -5
- package/out/codecs.js +23 -7
- package/out/config.d.ts +5 -17
- package/out/config.js +11 -2
- package/out/declare.d.ts +40 -12
- package/out/deferred.d.ts +2 -2
- package/out/errors.d.ts +1 -1
- package/out/errors.js +10 -2
- package/out/fn.d.ts +20 -13
- package/out/fromJsonSchema.d.ts +18 -0
- package/out/generic.d.ts +9 -6
- package/out/i18n.d.ts +2 -2
- package/out/i18n.js +9 -2
- package/out/index.d.ts +16 -7
- package/out/index.js +25 -8
- package/out/internal.d.ts +4 -0
- package/out/internal.js +41 -17
- package/out/island.js +22 -6
- package/out/islandDependency.js +42 -18
- package/out/jsonSchema/infer.d.ts +805 -0
- package/out/jsonSchema/validate.d.ts +416 -0
- package/out/keywords/Array.d.ts +2 -2
- package/out/keywords/builtins.d.ts +3 -3
- package/out/keywords/constructors.d.ts +1 -1
- package/out/keywords/functions.d.ts +5 -192
- package/out/keywords/keywords.d.ts +3 -3
- package/out/keywords/number.d.ts +2 -2
- package/out/keywords/phrases.d.ts +4 -191
- package/out/keywords/string.d.ts +3 -3
- package/out/keywords/ts.d.ts +18 -18
- package/out/keywords/ts.js +19 -4
- package/out/locale.d.ts +6 -2
- package/out/locales/de.js +9 -2
- package/out/locales/en.js +21 -5
- package/out/match.d.ts +13 -10
- package/out/module.d.ts +2 -2
- package/out/mutatesInput.js +18 -3
- package/out/nary.d.ts +220 -194
- package/out/parser/ast/bounds.d.ts +2 -2
- package/out/parser/ast/default.d.ts +2 -2
- package/out/parser/ast/divisor.d.ts +2 -2
- package/out/parser/ast/generic.d.ts +2 -2
- package/out/parser/ast/infer.d.ts +1 -1
- package/out/parser/ast/keyof.d.ts +2 -2
- package/out/parser/ast/utils.d.ts +1 -1
- package/out/parser/ast/validate.d.ts +2 -2
- package/out/parser/definition.d.ts +4 -4
- package/out/parser/objectLiteral.d.ts +2 -2
- package/out/parser/property.d.ts +2 -2
- package/out/parser/reduce/dynamic.d.ts +2 -2
- package/out/parser/reduce/shared.d.ts +1 -1
- package/out/parser/reduce/static.d.ts +1 -1
- package/out/parser/shift/operand/enclosed.d.ts +2 -2
- package/out/parser/shift/operand/genericArgs.d.ts +2 -2
- package/out/parser/shift/operand/operand.d.ts +1 -1
- package/out/parser/shift/operand/unenclosed.d.ts +2 -2
- package/out/parser/shift/operand/unresolvable.d.ts +2 -2
- package/out/parser/shift/operator/bounds.d.ts +2 -2
- package/out/parser/shift/operator/brand.d.ts +2 -2
- package/out/parser/shift/operator/default.d.ts +4 -4
- package/out/parser/shift/operator/divisor.d.ts +1 -1
- package/out/parser/shift/operator/operator.d.ts +1 -1
- package/out/parser/shift/tokens.d.ts +1 -1
- package/out/parser/string.d.ts +2 -2
- package/out/parser/tupleExpressions.d.ts +6 -8
- package/out/parser/tupleLiteral.d.ts +2 -2
- package/out/precompiled.d.ts +1 -1
- package/out/precompiled.js +16 -2
- package/out/regex.d.ts +1 -0
- package/out/regex.js +2 -0
- package/out/runtime.d.ts +10 -8
- package/out/runtime.js +6 -4
- package/out/runtimeDevelopment.js +70 -52
- package/out/schema.d.ts +1 -0
- package/out/schema.js +15 -0
- package/out/schemaInternal.d.ts +1 -0
- package/out/schemaInternal.js +1401 -0
- package/out/schemaIssueFeatures.d.ts +1 -0
- package/out/schemaRuntime.d.ts +1 -0
- package/out/schemaRuntime.js +7 -0
- package/out/schemaRuntimeLean.d.ts +1 -0
- package/out/schemaRuntimeLean.js +1870 -0
- package/out/schemaRuntimeNone.d.ts +1 -0
- package/out/schemaRuntimeNone.js +1774 -0
- package/out/schemaRuntimeNoneLean.d.ts +1 -0
- package/out/schemaRuntimeNoneLean.js +1767 -0
- package/out/scope.d.ts +3 -4
- package/out/shared/issueFeatures.d.ts +38 -0
- package/out/shared/issueFeatures.js +40 -0
- package/out/standalone/artifact.d.ts +6 -6
- package/out/standalone/baking.d.ts +2 -2
- package/out/standalone/combinators.d.ts +1 -1
- package/out/standalone/compilers.d.ts +1 -1
- package/out/standalone/fallbacks.d.ts +1 -1
- package/out/standalone/keys.d.ts +1 -1
- package/out/standalone/sites.d.ts +3 -3
- package/out/standalone/units.d.ts +1 -1
- package/out/standalone/values.d.ts +1 -1
- package/out/type.d.ts +6 -6
- package/out/util.d.ts +1 -0
- package/out/util.js +137 -0
- package/out/variants/array.d.ts +6 -6
- package/out/variants/base.d.ts +61 -10
- package/out/variants/date.d.ts +5 -5
- package/out/variants/instantiate.d.ts +1 -1
- package/out/variants/number.d.ts +6 -6
- package/out/variants/object.d.ts +25 -12
- package/out/variants/string.d.ts +8 -8
- package/package.json +183 -8
- package/skills/arktype/SKILL.md +93 -93
- package/skills/arktype/references/migrating.md +144 -158
- package/skills/arktype/references/precompile.md +7 -7
- package/out/chunk-4CUA5XIP.js +0 -7
- package/out/chunk-GPNK5353.js +0 -2529
- package/out/chunk-MLKGABMK.js +0 -9
- package/out/chunk-PRTMQCHS.js +0 -3
- package/out/chunk-R5G57XC7.js +0 -7
- package/out/chunk-SWOOCAHN.js +0 -4
- package/out/chunk-TAHPKDNM.js +0 -3
- package/out/chunk-UETB6YE2.js +0 -14
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// ../util/out/i18n.js
|
|
2
|
+
var listPattern = (or, and) => (items, type) => {
|
|
3
|
+
const pattern = type === "or" ? or : and;
|
|
4
|
+
if (items.length < 2)
|
|
5
|
+
return items[0] ?? "";
|
|
6
|
+
if (items.length === 2)
|
|
7
|
+
return `${items[0]}${pattern.two}${items[1]}`;
|
|
8
|
+
return `${items.slice(0, -1).join(pattern.middle)}${pattern.end}${items[items.length - 1]}`;
|
|
9
|
+
};
|
|
10
|
+
var isolate = (text) => `${text}`;
|
|
11
|
+
|
|
12
|
+
export {
|
|
13
|
+
listPattern,
|
|
14
|
+
isolate
|
|
15
|
+
};
|
|
@@ -0,0 +1,126 @@
|
|
|
1
|
+
import {
|
|
2
|
+
copyConfig,
|
|
3
|
+
isSameConfig
|
|
4
|
+
} from "./chunk-W2XOI5DY.js";
|
|
5
|
+
import {
|
|
6
|
+
throwParseError
|
|
7
|
+
} from "./chunk-3HZC67MT.js";
|
|
8
|
+
|
|
9
|
+
// ../schema/out/runtime.js
|
|
10
|
+
export { appliesValues, discriminatesBooleans, failsInBranches, findsOnRead, holdsExpression, listsUnions, transformsBranches, traversesUnions } from "./shared/issueFeatures.js";
|
|
11
|
+
var runtimeConfig = {
|
|
12
|
+
// validation never generates code, so it never needs eval
|
|
13
|
+
jitless: true,
|
|
14
|
+
onFail: null
|
|
15
|
+
};
|
|
16
|
+
var runtimeScope = /* @__PURE__ */ Object.freeze({
|
|
17
|
+
cfg: runtimeConfig
|
|
18
|
+
});
|
|
19
|
+
var checkConfigured;
|
|
20
|
+
var programConfig;
|
|
21
|
+
var configureIslands;
|
|
22
|
+
var configure = (config, fingerprint) => {
|
|
23
|
+
if (Object.isFrozen(runtimeConfig) || checkConfigured) {
|
|
24
|
+
return isSameConfig(config, programConfig ?? {}) ? config : throwParseError(reconfiguredMessage);
|
|
25
|
+
}
|
|
26
|
+
const received = fingerprintOf(config);
|
|
27
|
+
if (fingerprint !== void 0 && fingerprint !== received)
|
|
28
|
+
return throwParseError(configuredUnlikeBuildMessage);
|
|
29
|
+
configureIslands?.(config);
|
|
30
|
+
if ("onFail" in config)
|
|
31
|
+
runtimeConfig.onFail = config.onFail;
|
|
32
|
+
let isRechecked = false;
|
|
33
|
+
checkConfigured = (built) => {
|
|
34
|
+
if (!isRechecked && fingerprintOf(config) !== received)
|
|
35
|
+
throwParseError(writtenConfigMessage);
|
|
36
|
+
isRechecked = true;
|
|
37
|
+
if (fingerprint === void 0 || built !== fingerprint)
|
|
38
|
+
throwParseError(configMismatchMessage);
|
|
39
|
+
};
|
|
40
|
+
programConfig = copyConfig(config);
|
|
41
|
+
return config;
|
|
42
|
+
};
|
|
43
|
+
var configuredWriterOf = (code, k) => (...args) => programConfig[code][k](...args);
|
|
44
|
+
var configuredFallbackOf = (code) => (ctx) => {
|
|
45
|
+
const { fallback } = programConfig.toJsonSchema;
|
|
46
|
+
return (typeof fallback === "function" ? fallback : fallback[code] ?? fallback.default)(ctx);
|
|
47
|
+
};
|
|
48
|
+
var fingerprintOf = (config) => {
|
|
49
|
+
const text = staticTextOf(config, []);
|
|
50
|
+
let a = 1;
|
|
51
|
+
let b = 2;
|
|
52
|
+
for (let i = 0; i < text.length; i++) {
|
|
53
|
+
a = Math.imul(a ^ text.charCodeAt(i), 2654435761);
|
|
54
|
+
b = Math.imul(b ^ text.charCodeAt(i), 1597334677);
|
|
55
|
+
}
|
|
56
|
+
return `${(a >>> 0).toString(36)}_${(b >>> 0).toString(36)}`;
|
|
57
|
+
};
|
|
58
|
+
var staticTextOf = (value, seen) => {
|
|
59
|
+
if (value === null || typeof value !== "object" && typeof value !== "function") {
|
|
60
|
+
return typeof value === "string" ? JSON.stringify(value) : typeof value === "bigint" ? `${value}n` : Object.is(value, -0) ? "-0" : String(value);
|
|
61
|
+
}
|
|
62
|
+
const index = seen.indexOf(value);
|
|
63
|
+
if (index !== -1)
|
|
64
|
+
return `#${index}`;
|
|
65
|
+
seen.push(value);
|
|
66
|
+
if (typeof value === "function")
|
|
67
|
+
return "function";
|
|
68
|
+
const tag = Object.prototype.toString.call(value);
|
|
69
|
+
const builtins = [
|
|
70
|
+
null,
|
|
71
|
+
Object.prototype,
|
|
72
|
+
Array.prototype,
|
|
73
|
+
Date.prototype,
|
|
74
|
+
RegExp.prototype
|
|
75
|
+
];
|
|
76
|
+
const enumerable = [];
|
|
77
|
+
for (const k in value)
|
|
78
|
+
enumerable.push(k);
|
|
79
|
+
let entries = "";
|
|
80
|
+
for (const k of /* @__PURE__ */ new Set([...enumerable, ...Reflect.ownKeys(value)])) {
|
|
81
|
+
entries += `${enumerable.includes(k) ? "" : "~"}${JSON.stringify(
|
|
82
|
+
// a symbol key prints as its registered name
|
|
83
|
+
typeof k === "symbol" ? [Symbol.keyFor(k)] : k
|
|
84
|
+
)}:${staticTextOf(value[k], seen)},`;
|
|
85
|
+
}
|
|
86
|
+
return `${tag}${builtins.indexOf(Object.getPrototypeOf(value))}${tag === "[object Date]" ? Number(value) : tag === "[object RegExp]" ? `${value}` : ""}{${entries}}`;
|
|
87
|
+
};
|
|
88
|
+
var fixConfig = (() => {
|
|
89
|
+
Object.freeze(runtimeConfig);
|
|
90
|
+
checkConfigured?.();
|
|
91
|
+
});
|
|
92
|
+
var fixConfigured = (fingerprint, path, config) => {
|
|
93
|
+
Object.freeze(runtimeConfig);
|
|
94
|
+
if (!checkConfigured)
|
|
95
|
+
return throwParseError(writeCreatedBeforeConfigureMessage(path, config));
|
|
96
|
+
checkConfigured(fingerprint);
|
|
97
|
+
};
|
|
98
|
+
var shareConfig = (configureArktype) => {
|
|
99
|
+
configureIslands = configureArktype;
|
|
100
|
+
if (programConfig)
|
|
101
|
+
configureArktype(programConfig);
|
|
102
|
+
};
|
|
103
|
+
var configuredUnlikeBuildMessage = "configure() received values other than its build's";
|
|
104
|
+
var reconfiguredMessage = "configure() must be called once, before any Type is created";
|
|
105
|
+
var writtenConfigMessage = "configure()'s argument was modified after it was called";
|
|
106
|
+
var configMismatchMessage = "An artifact must run under the configuration it was built with";
|
|
107
|
+
var writeCreatedBeforeConfigureMessage = (path, config) => `${path} creates a Type before configure() runs
|
|
108
|
+
Import the config module before any module that creates a Type: first in the entry or test setup file that loads ${path}, or at the top of ${path}:
|
|
109
|
+
import "${config}"`;
|
|
110
|
+
|
|
111
|
+
export {
|
|
112
|
+
runtimeConfig,
|
|
113
|
+
runtimeScope,
|
|
114
|
+
configure,
|
|
115
|
+
configuredWriterOf,
|
|
116
|
+
configuredFallbackOf,
|
|
117
|
+
fingerprintOf,
|
|
118
|
+
fixConfig,
|
|
119
|
+
fixConfigured,
|
|
120
|
+
shareConfig,
|
|
121
|
+
configuredUnlikeBuildMessage,
|
|
122
|
+
reconfiguredMessage,
|
|
123
|
+
writtenConfigMessage,
|
|
124
|
+
configMismatchMessage,
|
|
125
|
+
writeCreatedBeforeConfigureMessage
|
|
126
|
+
};
|
|
@@ -1,5 +1,10 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Callable,
|
|
3
|
+
functionNameOf,
|
|
4
|
+
throwParseError
|
|
5
|
+
} from "./chunk-3HZC67MT.js";
|
|
6
|
+
|
|
1
7
|
// out/fn.js
|
|
2
|
-
import { Callable, functionNameOf, throwParseError } from "@ark/util";
|
|
3
8
|
var InternalFnParser = class extends Callable {
|
|
4
9
|
constructor($) {
|
|
5
10
|
const parse = (...signature) => {
|
|
@@ -1,5 +1,13 @@
|
|
|
1
|
+
import {
|
|
2
|
+
iso8601Matcher
|
|
3
|
+
} from "./chunk-US6BWOGJ.js";
|
|
4
|
+
import {
|
|
5
|
+
FileConstructor,
|
|
6
|
+
hasOwn,
|
|
7
|
+
isDigitCode
|
|
8
|
+
} from "./chunk-3HZC67MT.js";
|
|
9
|
+
|
|
1
10
|
// out/keywords/functions.js
|
|
2
|
-
import { FileConstructor, hasOwn, isDigitCode, iso8601Matcher } from "@ark/util";
|
|
3
11
|
var keywordError = (alias, description) => ({
|
|
4
12
|
code: "predicate",
|
|
5
13
|
description,
|
|
@@ -58,11 +66,15 @@ var isoDateOf = (parts) => {
|
|
|
58
66
|
date.setUTCHours(+(hour ?? 0), +(minute ?? 0) + offset, +(second ?? 0), ms);
|
|
59
67
|
return date;
|
|
60
68
|
};
|
|
69
|
+
var lateDay = /^([+-]?\d{4}(-?)(?:0[1-9]|1[0-2])\2)(?:29|3[01])(?=T|$)/;
|
|
61
70
|
var readDate = (s) => {
|
|
62
71
|
if (iso8601Matcher.test(s)) {
|
|
63
72
|
const parts = isoDateParts.exec(s);
|
|
64
73
|
return parts ? isoDateOf(parts) : void 0;
|
|
65
74
|
}
|
|
75
|
+
const on28th = s.replace(lateDay, (_, monthOf) => `${monthOf}28`);
|
|
76
|
+
if (on28th !== s && iso8601Matcher.test(on28th))
|
|
77
|
+
return;
|
|
66
78
|
const date = new Date(s);
|
|
67
79
|
return Number.isNaN(date.valueOf()) ? void 0 : date;
|
|
68
80
|
};
|
|
@@ -101,9 +113,6 @@ var isEpochString = (s, ctx) => {
|
|
|
101
113
|
}) : true;
|
|
102
114
|
};
|
|
103
115
|
var jsonString = "a JSON string";
|
|
104
|
-
var describeSyntaxError = ({ name, message }) => `${name}: ${message}`;
|
|
105
|
-
var writeJsonSyntaxErrorMessage = (error) => `must be ${jsonString} (${describeSyntaxError(error)})`;
|
|
106
|
-
var jsonMessage = (e, locale) => e.code === "predicate" && e.cause !== void 0 ? writeJsonSyntaxErrorMessage(e.cause) : locale.message(e, locale);
|
|
107
116
|
var jsonError = /* @__PURE__ */ keywordError("string.json", jsonString);
|
|
108
117
|
var isJsonString = (s, ctx) => {
|
|
109
118
|
try {
|
|
@@ -188,12 +197,9 @@ var isRegexPattern = (s, ctx) => {
|
|
|
188
197
|
}
|
|
189
198
|
};
|
|
190
199
|
var raisedErrorPhrases = {
|
|
191
|
-
"string.json":
|
|
192
|
-
"string.json.parse":
|
|
193
|
-
"string.regex":
|
|
194
|
-
noun: regexPattern,
|
|
195
|
-
message: (e, locale) => e.code === "predicate" && e.cause !== void 0 ? `must be ${regexPattern} (${describeSyntaxError(e.cause)})` : locale.message(e, locale)
|
|
196
|
-
}
|
|
200
|
+
"string.json": jsonString,
|
|
201
|
+
"string.json.parse": jsonString,
|
|
202
|
+
"string.regex": regexPattern
|
|
197
203
|
};
|
|
198
204
|
var plainUrl = /^[Hh][Tt]{2}[Pp][Ss]?:\/\/(?:[\dA-Za-z]+(?:-[\dA-Za-z]+)*\.)*[A-Za-z]+(?::\d{1,4})?(?:[#/?]|$)/;
|
|
199
205
|
var isParsableUrl = ((s) => plainUrl.test(s) || s.includes(":") && URL.canParse(s));
|
|
@@ -214,6 +220,13 @@ var parseFormData = (data) => {
|
|
|
214
220
|
result[k] = [existing, v];
|
|
215
221
|
else
|
|
216
222
|
existing.push(v);
|
|
223
|
+
} else if (k === "__proto__") {
|
|
224
|
+
Object.defineProperty(result, k, {
|
|
225
|
+
value: v,
|
|
226
|
+
writable: true,
|
|
227
|
+
enumerable: true,
|
|
228
|
+
configurable: true
|
|
229
|
+
});
|
|
217
230
|
} else
|
|
218
231
|
result[k] = v;
|
|
219
232
|
}
|
|
@@ -236,7 +249,6 @@ export {
|
|
|
236
249
|
maxEpoch,
|
|
237
250
|
epochDescriptions,
|
|
238
251
|
isEpochString,
|
|
239
|
-
writeJsonSyntaxErrorMessage,
|
|
240
252
|
isJsonString,
|
|
241
253
|
parseJson,
|
|
242
254
|
stringifyJson,
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import {
|
|
2
|
+
noSuggest
|
|
3
|
+
} from "./chunk-3HZC67MT.js";
|
|
4
|
+
|
|
5
|
+
// ../util/out/generics.js
|
|
6
|
+
var brand = /* @__PURE__ */ noSuggest("brand");
|
|
7
|
+
var narrow = (t) => t;
|
|
8
|
+
var inferred = /* @__PURE__ */ noSuggest("arkInferred");
|
|
9
|
+
|
|
10
|
+
export {
|
|
11
|
+
brand,
|
|
12
|
+
narrow,
|
|
13
|
+
inferred
|
|
14
|
+
};
|
|
@@ -1,13 +1,22 @@
|
|
|
1
|
+
import {
|
|
2
|
+
inPlaceTransforms,
|
|
3
|
+
inputOnlyMorphs
|
|
4
|
+
} from "./chunk-MTWKGAGO.js";
|
|
1
5
|
import {
|
|
2
6
|
parseDate,
|
|
3
7
|
parseInteger,
|
|
4
8
|
parseIsoDate,
|
|
5
9
|
parseJson,
|
|
6
10
|
parseUrl
|
|
7
|
-
} from "./chunk-
|
|
11
|
+
} from "./chunk-4HREHNIV.js";
|
|
12
|
+
import {
|
|
13
|
+
$ark
|
|
14
|
+
} from "./chunk-PDLTEX6Z.js";
|
|
15
|
+
|
|
16
|
+
// ../schema/out/mutatesInput.js
|
|
17
|
+
$ark.inPlace = inPlaceTransforms;
|
|
8
18
|
|
|
9
19
|
// out/mutatesInput.js
|
|
10
|
-
import { inputOnlyMorphs } from "@ark/schema/mutatesInput";
|
|
11
20
|
for (const morph of [
|
|
12
21
|
parseDate,
|
|
13
22
|
parseInteger,
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Backslash,
|
|
3
|
+
whitespaceChars
|
|
4
|
+
} from "./chunk-TACLEIDM.js";
|
|
5
|
+
|
|
6
|
+
// ../util/out/hkt.js
|
|
7
|
+
var Hkt = class {
|
|
8
|
+
constructor() {
|
|
9
|
+
}
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
// ../util/out/scanner.js
|
|
13
|
+
var namedControlEscapes = {
|
|
14
|
+
b: "\b",
|
|
15
|
+
f: "\f",
|
|
16
|
+
n: "\n",
|
|
17
|
+
r: "\r",
|
|
18
|
+
t: " "
|
|
19
|
+
};
|
|
20
|
+
var controlEscapes = {
|
|
21
|
+
"0000": "\0",
|
|
22
|
+
"0001": "",
|
|
23
|
+
"0002": "",
|
|
24
|
+
"0003": "",
|
|
25
|
+
"0004": "",
|
|
26
|
+
"0005": "",
|
|
27
|
+
"0006": "",
|
|
28
|
+
"0007": "\x07",
|
|
29
|
+
"0008": "\b",
|
|
30
|
+
"0009": " ",
|
|
31
|
+
"000a": "\n",
|
|
32
|
+
"000b": "\v",
|
|
33
|
+
"000c": "\f",
|
|
34
|
+
"000d": "\r",
|
|
35
|
+
"000e": "",
|
|
36
|
+
"000f": "",
|
|
37
|
+
"0010": "",
|
|
38
|
+
"0011": "",
|
|
39
|
+
"0012": "",
|
|
40
|
+
"0013": "",
|
|
41
|
+
"0014": "",
|
|
42
|
+
"0015": "",
|
|
43
|
+
"0016": "",
|
|
44
|
+
"0017": "",
|
|
45
|
+
"0018": "",
|
|
46
|
+
"0019": "",
|
|
47
|
+
"001a": "",
|
|
48
|
+
"001b": "\x1B",
|
|
49
|
+
"001c": "",
|
|
50
|
+
"001d": "",
|
|
51
|
+
"001e": "",
|
|
52
|
+
"001f": ""
|
|
53
|
+
};
|
|
54
|
+
var Scanner = class {
|
|
55
|
+
chars;
|
|
56
|
+
i;
|
|
57
|
+
def;
|
|
58
|
+
constructor(def) {
|
|
59
|
+
this.def = def;
|
|
60
|
+
this.chars = [...def];
|
|
61
|
+
this.i = 0;
|
|
62
|
+
}
|
|
63
|
+
/** the next character, advancing past it */
|
|
64
|
+
shift() {
|
|
65
|
+
return this.chars[this.i++] ?? "";
|
|
66
|
+
}
|
|
67
|
+
/** the next character, or "" at the end */
|
|
68
|
+
get peek() {
|
|
69
|
+
return this.chars[this.i] ?? "";
|
|
70
|
+
}
|
|
71
|
+
/** the character after the next, or "" past the end */
|
|
72
|
+
get peekNext() {
|
|
73
|
+
return this.chars[this.i + 1] ?? "";
|
|
74
|
+
}
|
|
75
|
+
get length() {
|
|
76
|
+
return this.chars.length;
|
|
77
|
+
}
|
|
78
|
+
shiftUntil(condition) {
|
|
79
|
+
let shifted = "";
|
|
80
|
+
while (this.peek) {
|
|
81
|
+
if (condition(this, shifted))
|
|
82
|
+
break;
|
|
83
|
+
else
|
|
84
|
+
shifted += this.shift();
|
|
85
|
+
}
|
|
86
|
+
return shifted;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* shifts until condition holds, reading `\` before the terminator as the
|
|
90
|
+
* terminator and `\\` as escapeEscape followed by a backslash. Where
|
|
91
|
+
* escapeEscape is "", as in a literal, the escapes JSON writes for a
|
|
92
|
+
* control character are read as that character, so a literal's expression
|
|
93
|
+
* parses back to it
|
|
94
|
+
*/
|
|
95
|
+
shiftUntilEscapable(condition, escapeEscape = "") {
|
|
96
|
+
let shifted = "";
|
|
97
|
+
while (this.peek) {
|
|
98
|
+
if (this.peek === Backslash) {
|
|
99
|
+
this.shift();
|
|
100
|
+
if (condition(this, shifted))
|
|
101
|
+
shifted += this.shift();
|
|
102
|
+
else if (this.peek === Backslash)
|
|
103
|
+
shifted += `${escapeEscape}${this.shift()}`;
|
|
104
|
+
else if (escapeEscape === "")
|
|
105
|
+
shifted += this.shiftControlEscape();
|
|
106
|
+
else
|
|
107
|
+
shifted += `${Backslash}${this.shift()}`;
|
|
108
|
+
} else if (condition(this, shifted))
|
|
109
|
+
break;
|
|
110
|
+
else
|
|
111
|
+
shifted += this.shift();
|
|
112
|
+
}
|
|
113
|
+
return shifted;
|
|
114
|
+
}
|
|
115
|
+
/** the control character escaped after a backslash, or the backslash as written */
|
|
116
|
+
shiftControlEscape() {
|
|
117
|
+
const peek = this.peek;
|
|
118
|
+
if (peek in namedControlEscapes) {
|
|
119
|
+
this.shift();
|
|
120
|
+
return namedControlEscapes[peek];
|
|
121
|
+
}
|
|
122
|
+
if (peek === "u") {
|
|
123
|
+
const code = this.chars.slice(this.i + 1, this.i + 5).join("");
|
|
124
|
+
if (code.toLowerCase() in controlEscapes) {
|
|
125
|
+
this.jumpForward(5);
|
|
126
|
+
return controlEscapes[code.toLowerCase()];
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
return `${Backslash}${this.shift()}`;
|
|
130
|
+
}
|
|
131
|
+
shiftUntilNext(charOrSet) {
|
|
132
|
+
return typeof charOrSet === "string" ? this.shiftUntil((s) => s.peek === charOrSet) : this.shiftUntil((s) => s.peek in charOrSet);
|
|
133
|
+
}
|
|
134
|
+
/** shifts past whitespace, returning what it shifted */
|
|
135
|
+
skipSpace() {
|
|
136
|
+
return this.shiftUntil(() => !(this.peek in whitespaceChars));
|
|
137
|
+
}
|
|
138
|
+
jumpForward(count) {
|
|
139
|
+
this.i += count;
|
|
140
|
+
}
|
|
141
|
+
get location() {
|
|
142
|
+
return this.i;
|
|
143
|
+
}
|
|
144
|
+
get unscanned() {
|
|
145
|
+
return this.chars.slice(this.i, this.length).join("");
|
|
146
|
+
}
|
|
147
|
+
get scanned() {
|
|
148
|
+
return this.chars.slice(0, this.i).join("");
|
|
149
|
+
}
|
|
150
|
+
sliceChars(start, end) {
|
|
151
|
+
return this.chars.slice(start, end).join("");
|
|
152
|
+
}
|
|
153
|
+
peekIs(char) {
|
|
154
|
+
return this.peek === char;
|
|
155
|
+
}
|
|
156
|
+
peekIsIn(tokens) {
|
|
157
|
+
return this.peek in tokens;
|
|
158
|
+
}
|
|
159
|
+
};
|
|
160
|
+
var writeUnmatchedGroupCloseMessage = (char, unscanned) => `Unmatched ${char}${unscanned === "" ? "" : ` before ${unscanned}`}`;
|
|
161
|
+
var writeUnclosedGroupMessage = (missingChar) => `Missing ${missingChar}`;
|
|
162
|
+
|
|
163
|
+
export {
|
|
164
|
+
Hkt,
|
|
165
|
+
Scanner,
|
|
166
|
+
writeUnmatchedGroupCloseMessage,
|
|
167
|
+
writeUnclosedGroupMessage
|
|
168
|
+
};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import {
|
|
2
2
|
raisedErrorPhrases
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-4HREHNIV.js";
|
|
4
|
+
import {
|
|
5
|
+
en
|
|
6
|
+
} from "./chunk-KXOC3JEX.js";
|
|
4
7
|
|
|
5
8
|
// out/keywords/phrases.js
|
|
6
|
-
import { en } from "@ark/schema";
|
|
7
9
|
var epoch = "an integer representing a safe Unix timestamp";
|
|
8
10
|
var keywordPhrases = {
|
|
9
11
|
"FormData.parsed": "an object representing parsed form data",
|