arktype 3.0.0-beta.0 → 3.0.0-beta.1
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 +162 -10
- package/out/attributes.d.ts +4 -2
- package/out/checkers.d.ts +37 -2
- package/out/{chunk-Z4F45ZTE.js → chunk-2U2AWCI3.js} +3 -3
- package/out/{chunk-5NJWD7CO.js → chunk-5U2ZMDNI.js} +215 -140
- package/out/{chunk-KJ3C5GTL.js → chunk-DLWCO4RV.js} +1 -1
- package/out/{chunk-H4VRNKMB.js → chunk-E3DZXEZK.js} +1 -1
- package/out/{chunk-EJZJUYPI.js → chunk-EVCML554.js} +2 -2
- package/out/{chunk-KI2MOYNT.js → chunk-GPNK5353.js} +184 -32
- package/out/{chunk-LUXERINN.js → chunk-RAZ3TXOE.js} +40 -38
- package/out/chunk-SWOOCAHN.js +4 -0
- package/out/{chunk-ARTS74PX.js → chunk-UETB6YE2.js} +1 -1
- package/out/{chunk-JHDPSG5Y.js → chunk-UK5UGFOX.js} +6 -6
- package/out/{chunk-WEPQK3AY.js → chunk-VV6YDN2D.js} +441 -145
- package/out/codecs.js +5 -5
- package/out/config.d.ts +6 -3
- package/out/i18n.d.ts +1 -1
- package/out/i18n.js +1 -1
- package/out/index.d.ts +1 -1
- package/out/index.js +5 -5
- package/out/internal.d.ts +1 -0
- package/out/internal.js +11 -11
- package/out/island.js +2 -2
- package/out/islandDependency.js +11 -11
- package/out/keywords/functions.d.ts +24 -24
- package/out/keywords/keywords.d.ts +2 -2
- package/out/keywords/phrases.d.ts +23 -23
- package/out/keywords/ts.js +2 -2
- package/out/locale.d.ts +1 -1
- package/out/locales/de.js +1 -1
- package/out/locales/en.js +3 -3
- package/out/match.d.ts +5 -3
- package/out/mutatesInput.js +2 -2
- package/out/parser/definition.d.ts +54 -3
- package/out/parser/shift/operand/unenclosed.d.ts +3 -1
- package/out/parser/shift/operand/unresolvable.d.ts +68 -0
- package/out/parser/shift/operator/bounds.d.ts +4 -1
- package/out/runtime.d.ts +34 -25
- package/out/runtime.js +2 -2
- package/out/runtimeDevelopment.js +63 -4
- package/out/scope.d.ts +4 -4
- package/out/standalone/artifact.d.ts +4 -0
- package/out/standalone/baking.d.ts +8 -1
- package/out/standalone/sites.d.ts +6 -3
- package/out/standalone/values.d.ts +2 -0
- package/out/type.d.ts +42 -5
- package/package.json +49 -6
- package/skills/arktype/SKILL.md +211 -92
- package/skills/arktype/references/migrating.md +990 -255
- package/skills/arktype/references/precompile.md +8 -5
- package/out/chunk-EDEN5UWG.js +0 -4
|
@@ -102,8 +102,8 @@ var isEpochString = (s, ctx) => {
|
|
|
102
102
|
};
|
|
103
103
|
var jsonString = "a JSON string";
|
|
104
104
|
var describeSyntaxError = ({ name, message }) => `${name}: ${message}`;
|
|
105
|
-
var
|
|
106
|
-
var
|
|
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
107
|
var jsonError = /* @__PURE__ */ keywordError("string.json", jsonString);
|
|
108
108
|
var isJsonString = (s, ctx) => {
|
|
109
109
|
try {
|
|
@@ -188,11 +188,11 @@ var isRegexPattern = (s, ctx) => {
|
|
|
188
188
|
}
|
|
189
189
|
};
|
|
190
190
|
var raisedErrorPhrases = {
|
|
191
|
-
"string.json": { noun: jsonString,
|
|
192
|
-
"string.json.parse": { noun: jsonString,
|
|
191
|
+
"string.json": { noun: jsonString, message: jsonMessage },
|
|
192
|
+
"string.json.parse": { noun: jsonString, message: jsonMessage },
|
|
193
193
|
"string.regex": {
|
|
194
194
|
noun: regexPattern,
|
|
195
|
-
|
|
195
|
+
message: (e, locale) => e.code === "predicate" && e.cause !== void 0 ? `must be ${regexPattern} (${describeSyntaxError(e.cause)})` : locale.message(e, locale)
|
|
196
196
|
}
|
|
197
197
|
};
|
|
198
198
|
var plainUrl = /^[Hh][Tt]{2}[Pp][Ss]?:\/\/(?:[\dA-Za-z]+(?:-[\dA-Za-z]+)*\.)*[A-Za-z]+(?::\d{1,4})?(?:[#/?]|$)/;
|
|
@@ -236,7 +236,7 @@ export {
|
|
|
236
236
|
maxEpoch,
|
|
237
237
|
epochDescriptions,
|
|
238
238
|
isEpochString,
|
|
239
|
-
|
|
239
|
+
writeJsonSyntaxErrorMessage,
|
|
240
240
|
isJsonString,
|
|
241
241
|
parseJson,
|
|
242
242
|
stringifyJson,
|