@bastani/atomic-schema 0.0.0-stage → 0.9.88-alpha.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/CHANGELOG.md +11 -0
- package/LICENSE +22 -0
- package/NOTICE.md +13 -0
- package/README.md +63 -2
- package/THIRD_PARTY_NOTICES/typebox-LICENSE +23 -0
- package/dist/annotations.d.ts +44 -0
- package/dist/annotations.d.ts.map +1 -0
- package/dist/annotations.js +193 -0
- package/dist/annotations.js.map +1 -0
- package/dist/builders.d.ts +143 -0
- package/dist/builders.d.ts.map +1 -0
- package/dist/builders.js +126 -0
- package/dist/builders.js.map +1 -0
- package/dist/checks.d.ts +114 -0
- package/dist/checks.d.ts.map +1 -0
- package/dist/checks.js +578 -0
- package/dist/checks.js.map +1 -0
- package/dist/coerce.d.ts +53 -0
- package/dist/coerce.d.ts.map +1 -0
- package/dist/coerce.js +624 -0
- package/dist/coerce.js.map +1 -0
- package/dist/compiler.d.ts +53 -0
- package/dist/compiler.d.ts.map +1 -0
- package/dist/compiler.js +551 -0
- package/dist/compiler.js.map +1 -0
- package/dist/explain.d.ts +29 -0
- package/dist/explain.d.ts.map +1 -0
- package/dist/explain.js +392 -0
- package/dist/explain.js.map +1 -0
- package/dist/formats/index.d.ts +7 -0
- package/dist/formats/index.d.ts.map +1 -0
- package/dist/formats/index.js +51 -0
- package/dist/formats/index.js.map +1 -0
- package/dist/formats/typebox/date.d.ts +7 -0
- package/dist/formats/typebox/date.d.ts.map +1 -0
- package/dist/formats/typebox/date.js +47 -0
- package/dist/formats/typebox/date.js.map +1 -0
- package/dist/formats/typebox/date_time.d.ts +7 -0
- package/dist/formats/typebox/date_time.d.ts.map +1 -0
- package/dist/formats/typebox/date_time.js +39 -0
- package/dist/formats/typebox/date_time.js.map +1 -0
- package/dist/formats/typebox/duration.d.ts +6 -0
- package/dist/formats/typebox/duration.d.ts.map +1 -0
- package/dist/formats/typebox/duration.js +36 -0
- package/dist/formats/typebox/duration.js.map +1 -0
- package/dist/formats/typebox/email.d.ts +6 -0
- package/dist/formats/typebox/email.d.ts.map +1 -0
- package/dist/formats/typebox/email.js +36 -0
- package/dist/formats/typebox/email.js.map +1 -0
- package/dist/formats/typebox/hostname.d.ts +8 -0
- package/dist/formats/typebox/hostname.d.ts.map +1 -0
- package/dist/formats/typebox/hostname.js +38 -0
- package/dist/formats/typebox/hostname.js.map +1 -0
- package/dist/formats/typebox/idn_email.d.ts +6 -0
- package/dist/formats/typebox/idn_email.d.ts.map +1 -0
- package/dist/formats/typebox/idn_email.js +36 -0
- package/dist/formats/typebox/idn_email.js.map +1 -0
- package/dist/formats/typebox/idn_hostname.d.ts +9 -0
- package/dist/formats/typebox/idn_hostname.d.ts.map +1 -0
- package/dist/formats/typebox/idn_hostname.js +39 -0
- package/dist/formats/typebox/idn_hostname.js.map +1 -0
- package/dist/formats/typebox/idna/format/bidi.d.ts +4 -0
- package/dist/formats/typebox/idna/format/bidi.d.ts.map +1 -0
- package/dist/formats/typebox/idna/format/bidi.js +132 -0
- package/dist/formats/typebox/idna/format/bidi.js.map +1 -0
- package/dist/formats/typebox/idna/format/puny.d.ts +4 -0
- package/dist/formats/typebox/idna/format/puny.d.ts.map +1 -0
- package/dist/formats/typebox/idna/format/puny.js +172 -0
- package/dist/formats/typebox/idna/format/puny.js.map +1 -0
- package/dist/formats/typebox/idna/hostname.d.ts +2 -0
- package/dist/formats/typebox/idna/hostname.d.ts.map +1 -0
- package/dist/formats/typebox/idna/hostname.js +43 -0
- package/dist/formats/typebox/idna/hostname.js.map +1 -0
- package/dist/formats/typebox/idna/idn-hostname.d.ts +2 -0
- package/dist/formats/typebox/idna/idn-hostname.d.ts.map +1 -0
- package/dist/formats/typebox/idna/idn-hostname.js +71 -0
- package/dist/formats/typebox/idna/idn-hostname.js.map +1 -0
- package/dist/formats/typebox/idna/index.d.ts +3 -0
- package/dist/formats/typebox/idna/index.d.ts.map +1 -0
- package/dist/formats/typebox/idna/index.js +30 -0
- package/dist/formats/typebox/idna/index.js.map +1 -0
- package/dist/formats/typebox/idna/label/ascii.d.ts +2 -0
- package/dist/formats/typebox/idna/label/ascii.d.ts.map +1 -0
- package/dist/formats/typebox/idna/label/ascii.js +37 -0
- package/dist/formats/typebox/idna/label/ascii.js.map +1 -0
- package/dist/formats/typebox/idna/label/puny.d.ts +2 -0
- package/dist/formats/typebox/idna/label/puny.d.ts.map +1 -0
- package/dist/formats/typebox/idna/label/puny.js +56 -0
- package/dist/formats/typebox/idna/label/puny.js.map +1 -0
- package/dist/formats/typebox/idna/label/unicode.d.ts +2 -0
- package/dist/formats/typebox/idna/label/unicode.d.ts.map +1 -0
- package/dist/formats/typebox/idna/label/unicode.js +134 -0
- package/dist/formats/typebox/idna/label/unicode.js.map +1 -0
- package/dist/formats/typebox/idna/pattern/pattern.d.ts +31 -0
- package/dist/formats/typebox/idna/pattern/pattern.d.ts.map +1 -0
- package/dist/formats/typebox/idna/pattern/pattern.js +98 -0
- package/dist/formats/typebox/idna/pattern/pattern.js.map +1 -0
- package/dist/formats/typebox/ipv4.d.ts +6 -0
- package/dist/formats/typebox/ipv4.d.ts.map +1 -0
- package/dist/formats/typebox/ipv4.js +36 -0
- package/dist/formats/typebox/ipv4.js.map +1 -0
- package/dist/formats/typebox/ipv6.d.ts +6 -0
- package/dist/formats/typebox/ipv6.d.ts.map +1 -0
- package/dist/formats/typebox/ipv6.js +36 -0
- package/dist/formats/typebox/ipv6.js.map +1 -0
- package/dist/formats/typebox/iri.d.ts +6 -0
- package/dist/formats/typebox/iri.d.ts.map +1 -0
- package/dist/formats/typebox/iri.js +63 -0
- package/dist/formats/typebox/iri.js.map +1 -0
- package/dist/formats/typebox/iri_reference.d.ts +6 -0
- package/dist/formats/typebox/iri_reference.d.ts.map +1 -0
- package/dist/formats/typebox/iri_reference.js +40 -0
- package/dist/formats/typebox/iri_reference.js.map +1 -0
- package/dist/formats/typebox/json_pointer.d.ts +7 -0
- package/dist/formats/typebox/json_pointer.d.ts.map +1 -0
- package/dist/formats/typebox/json_pointer.js +37 -0
- package/dist/formats/typebox/json_pointer.js.map +1 -0
- package/dist/formats/typebox/json_pointer_uri_fragment.d.ts +7 -0
- package/dist/formats/typebox/json_pointer_uri_fragment.d.ts.map +1 -0
- package/dist/formats/typebox/json_pointer_uri_fragment.js +37 -0
- package/dist/formats/typebox/json_pointer_uri_fragment.js.map +1 -0
- package/dist/formats/typebox/regex.d.ts +6 -0
- package/dist/formats/typebox/regex.d.ts.map +1 -0
- package/dist/formats/typebox/regex.js +41 -0
- package/dist/formats/typebox/regex.js.map +1 -0
- package/dist/formats/typebox/relative_json_pointer.d.ts +7 -0
- package/dist/formats/typebox/relative_json_pointer.d.ts.map +1 -0
- package/dist/formats/typebox/relative_json_pointer.js +37 -0
- package/dist/formats/typebox/relative_json_pointer.js.map +1 -0
- package/dist/formats/typebox/time.d.ts +6 -0
- package/dist/formats/typebox/time.d.ts.map +1 -0
- package/dist/formats/typebox/time.js +60 -0
- package/dist/formats/typebox/time.js.map +1 -0
- package/dist/formats/typebox/uri.d.ts +6 -0
- package/dist/formats/typebox/uri.d.ts.map +1 -0
- package/dist/formats/typebox/uri.js +36 -0
- package/dist/formats/typebox/uri.js.map +1 -0
- package/dist/formats/typebox/uri_reference.d.ts +6 -0
- package/dist/formats/typebox/uri_reference.d.ts.map +1 -0
- package/dist/formats/typebox/uri_reference.js +36 -0
- package/dist/formats/typebox/uri_reference.js.map +1 -0
- package/dist/formats/typebox/uri_template.d.ts +6 -0
- package/dist/formats/typebox/uri_template.d.ts.map +1 -0
- package/dist/formats/typebox/uri_template.js +37 -0
- package/dist/formats/typebox/uri_template.js.map +1 -0
- package/dist/formats/typebox/url.d.ts +7 -0
- package/dist/formats/typebox/url.d.ts.map +1 -0
- package/dist/formats/typebox/url.js +36 -0
- package/dist/formats/typebox/url.js.map +1 -0
- package/dist/formats/typebox/uuid.d.ts +7 -0
- package/dist/formats/typebox/uuid.d.ts.map +1 -0
- package/dist/formats/typebox/uuid.js +37 -0
- package/dist/formats/typebox/uuid.js.map +1 -0
- package/dist/index.d.ts +5 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +6 -0
- package/dist/index.js.map +1 -0
- package/dist/resolver.d.ts +58 -0
- package/dist/resolver.d.ts.map +1 -0
- package/dist/resolver.js +209 -0
- package/dist/resolver.js.map +1 -0
- package/dist/shared.d.ts +9 -0
- package/dist/shared.d.ts.map +1 -0
- package/dist/shared.js +33 -0
- package/dist/shared.js.map +1 -0
- package/dist/typebox-static.d.ts +56 -0
- package/dist/typebox-static.d.ts.map +1 -0
- package/dist/typebox-static.js +7 -0
- package/dist/typebox-static.js.map +1 -0
- package/dist/types.d.ts +48 -0
- package/dist/types.d.ts.map +1 -0
- package/dist/types.js +3 -0
- package/dist/types.js.map +1 -0
- package/dist/validator.d.ts +48 -0
- package/dist/validator.d.ts.map +1 -0
- package/dist/validator.js +81 -0
- package/dist/validator.js.map +1 -0
- package/package.json +64 -4
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"explain.js","sourceRoot":"","sources":["../src/explain.ts"],"names":[],"mappings":"AAAA,gHAAgH;AAChH,6FAA6F;AAE7F,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAEN,UAAU,EACV,UAAU,EACV,aAAa,EACb,SAAS,EACT,UAAU,EACV,QAAQ,EACR,KAAK,EACL,WAAW,EACX,WAAW,GACX,MAAM,aAAa,CAAC;AAErB,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAG1C,gDAAgD;AAChD,MAAM,OAAO,SAAS;IACJ,CAAC,CAAW;IACZ,MAAM,CAAU;IACjC;;;OAGG;IACK,IAAI,GAAsF,SAAS,CAAC;IAE5G,YAAY,QAAkB,EAAE,MAAe;QAC9C,IAAI,CAAC,CAAC,GAAG,QAAQ,CAAC;QAClB,IAAI,CAAC,MAAM,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E,OAAO,SAAS,CAAC;IACnE,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;QAAE,OAAO,MAAM,CAAC,CAAC,CAAC,CAAC;IACnE,OAAO,OAAO,CAAC,CAAC;AACjB,CAAC","sourcesContent":["// Errors of a failed value: a walk over the schema that reports each failing keyword at the value it failed on.\n// It runs only for values that failed the check, using the compiler's checks for subschemas.\n\nimport { newAnnotations } from \"./annotations.ts\";\nimport {\n\ttype Bound,\n\tcodePoints,\n\tconstCheck,\n\tcontainsCheck,\n\tenumCheck,\n\tisMultiple,\n\tisObject,\n\tNEVER,\n\tTYPE_CHECKS,\n\tuniqueCheck,\n} from \"./checks.ts\";\nimport type { Compiler } from \"./compiler.ts\";\nimport { isSchemaObject } from \"./resolver.ts\";\nimport { sharedRegex } from \"./shared.ts\";\nimport type { SchemaObject, ValidationError } from \"./types.ts\";\n\n/** Explains failures of one compiled schema. */\nexport class Explainer {\n\tprivate readonly c: Compiler;\n\tprivate readonly schema: unknown;\n\t/**\n\t * The errors of `$ref` targets for object values, within one errors() call: a recursive union explains each branch\n\t * to pick the one to blame, and every branch would explain the same children again, exponentially in the depth.\n\t */\n\tprivate memo: Map<object, Map<object, { path: string; errors: ValidationError[] }>> | undefined = undefined;\n\n\tconstructor(compiler: Compiler, schema: unknown) {\n\t\tthis.c = compiler;\n\t\tthis.schema = schema;\n\t\tcompiler.root();\n\t}\n\n\t/** The errors of `value`, at least one (`value` failed the check). */\n\terrors(value: unknown): ValidationError[] {\n\t\tconst out: ValidationError[] = [];\n\t\ttry {\n\t\t\tthis.walk(this.schema, this.c.r.rootBase, value, \"\", out);\n\t\t} finally {\n\t\t\tthis.memo = undefined;\n\t\t}\n\t\tif (out.length === 0) out.push({ path: \"\", keyword: \"schema\", message: \"invalid\" });\n\t\treturn out;\n\t}\n\n\tprivate ok(node: unknown, base: string, v: unknown): boolean {\n\t\treturn this.c.check(node, base)(v);\n\t}\n\n\t// For $dynamicRef schemas this check runs outside the original dynamic scope, so their errors are approximate.\n\tprivate walk(node: unknown, base: string, v: unknown, path: string, out: ValidationError[]): void {\n\t\tif (node === true) return;\n\t\tif (node === false) {\n\t\t\tout.push({ path, keyword: \"false\", message: \"no value is allowed here\" });\n\t\t\treturn;\n\t\t}\n\t\tif (!isSchemaObject(node)) return;\n\t\tconst b = this.c.r.baseFor(node, base);\n\t\tif (this.ok(node, b, v)) return;\n\t\tconst start = out.length;\n\t\tconst push = (keyword: string, message: string, at = path) => {\n\t\t\tout.push({ path: at, keyword, message });\n\t\t};\n\t\tif (this.c.draft === \"7\" && typeof node.$ref === \"string\") {\n\t\t\tthis.walkRef(node.$ref, b, v, path, out);\n\t\t\treturn;\n\t\t}\n\t\tif (node.type !== undefined) {\n\t\t\tconst types = Array.isArray(node.type) ? node.type : [node.type];\n\t\t\tconst checks = types.map((t) => (typeof t === \"string\" ? TYPE_CHECKS.get(t) : undefined) ?? NEVER);\n\t\t\tif (!checks.some((check) => check(v))) {\n\t\t\t\tpush(\"type\", `expected ${types.join(\" or \")}, got ${typeName(v)}`);\n\t\t\t\treturn;\n\t\t\t}\n\t\t}\n\t\tif (Array.isArray(node.enum) && !enumCheck(node.enum)(v))\n\t\t\tpush(\"enum\", `expected one of ${listValues(node.enum)}`);\n\t\tif (Object.hasOwn(node, \"const\") && !constCheck(node.const)(v))\n\t\t\tpush(\"const\", `expected ${JSON.stringify(node.const)}`);\n\t\tif (typeof v === \"string\" && node.type !== \"bytes\") this.walkString(node, v, push);\n\t\tif (v instanceof Uint8Array && node.type === \"bytes\") this.walkBytes(node, v, push);\n\t\tif (typeof v === \"number\" || typeof v === \"bigint\") this.walkNumber(node, v, push);\n\t\tif (isObject(v)) this.walkObject(node, b, v, path, out, push);\n\t\tif (Array.isArray(v)) this.walkArray(node, b, v, path, out, push);\n\t\tif (Array.isArray(node.allOf)) for (const s of node.allOf) this.walk(s, b, v, path, out);\n\t\tif (Array.isArray(node.anyOf)) this.walkUnion(node.anyOf, b, v, path, out, false);\n\t\tif (Array.isArray(node.oneOf)) this.walkUnion(node.oneOf, b, v, path, out, true);\n\t\tif (node.not !== undefined && this.ok(node.not, b, v)) push(\"not\", \"must not match the schema in not\");\n\t\tif (node.if !== undefined) {\n\t\t\tconst branch = this.ok(node.if, b, v) ? node.then : node.else;\n\t\t\tif (branch !== undefined) this.walk(branch, b, v, path, out);\n\t\t}\n\t\tif (typeof node.$ref === \"string\") this.walkRef(node.$ref, b, v, path, out);\n\t\tif (out.length === start && (node.unevaluatedProperties !== undefined || node.unevaluatedItems !== undefined)) {\n\t\t\tthis.walkUnevaluated(node, b, v, path, out);\n\t\t}\n\t\tif (out.length === start && typeof node.$dynamicRef === \"string\") {\n\t\t\tpush(\"$dynamicRef\", \"does not match the dynamically referenced schema\");\n\t\t}\n\t}\n\n\tprivate walkRef(ref: string, base: string, v: unknown, path: string, out: ValidationError[]): void {\n\t\tconst target = this.c.r.resolve(ref, base);\n\t\tif (target.node === false && this.c.r.isUnresolved(ref, base)) {\n\t\t\tout.push({ path, keyword: \"$ref\", message: `unresolved reference ${ref}` });\n\t\t\treturn;\n\t\t}\n\t\tif (!isSchemaObject(target.node) || typeof v !== \"object\" || v === null) {\n\t\t\tthis.walk(target.node, target.base, v, path, out);\n\t\t\treturn;\n\t\t}\n\t\tthis.memo ??= new Map();\n\t\tlet values = this.memo.get(target.node);\n\t\tconst known = values?.get(v);\n\t\tif (known !== undefined && known.path === path) {\n\t\t\tout.push(...known.errors);\n\t\t\treturn;\n\t\t}\n\t\tconst errors: ValidationError[] = [];\n\t\tthis.walk(target.node, target.base, v, path, errors);\n\t\tif (values === undefined) {\n\t\t\tvalues = new Map();\n\t\t\tthis.memo.set(target.node, values);\n\t\t}\n\t\tvalues.set(v, { path, errors });\n\t\tout.push(...errors);\n\t}\n\n\tprivate walkString(node: SchemaObject, v: string, push: Push): void {\n\t\tconst n = codePoints(v);\n\t\tif (typeof node.minLength === \"number\" && n < node.minLength) {\n\t\t\tpush(\"minLength\", `expected at least ${node.minLength} characters`);\n\t\t}\n\t\tif (typeof node.maxLength === \"number\" && n > node.maxLength) {\n\t\t\tpush(\"maxLength\", `expected at most ${node.maxLength} characters`);\n\t\t}\n\t\tif (typeof node.pattern === \"string\" && !sharedRegex(node.pattern).test(v)) {\n\t\t\tpush(\"pattern\", `expected to match ${node.pattern}`);\n\t\t}\n\t\tconst formats = this.c.formats;\n\t\tconst format =\n\t\t\tformats !== undefined && typeof node.format === \"string\" && Object.hasOwn(formats, node.format)\n\t\t\t\t? formats[node.format]\n\t\t\t\t: undefined;\n\t\tif (format !== undefined && !format(v)) push(\"format\", `expected format ${node.format}`);\n\t}\n\n\tprivate walkBytes(node: SchemaObject, v: Uint8Array, push: Push): void {\n\t\tif (typeof node.minLength === \"number\" && v.length < node.minLength) {\n\t\t\tpush(\"minLength\", `expected at least ${node.minLength} bytes`);\n\t\t}\n\t\tif (typeof node.maxLength === \"number\" && v.length > node.maxLength) {\n\t\t\tpush(\"maxLength\", `expected at most ${node.maxLength} bytes`);\n\t\t}\n\t}\n\n\t// Numbers and bigints alike: bounds of either kind compare with values of either kind.\n\tprivate walkNumber(node: SchemaObject, v: Bound, push: Push): void {\n\t\tconst { minimum, maximum, exclusiveMinimum, exclusiveMaximum, multipleOf } = node;\n\t\tif (isBound(minimum) && v < minimum) push(\"minimum\", `expected >= ${minimum}`);\n\t\tif (isBound(maximum) && v > maximum) push(\"maximum\", `expected <= ${maximum}`);\n\t\tif (isBound(exclusiveMinimum) && v <= exclusiveMinimum)\n\t\t\tpush(\"exclusiveMinimum\", `expected > ${exclusiveMinimum}`);\n\t\tif (isBound(exclusiveMaximum) && v >= exclusiveMaximum)\n\t\t\tpush(\"exclusiveMaximum\", `expected < ${exclusiveMaximum}`);\n\t\tif (isBound(multipleOf) && !isMultiple(v, multipleOf)) push(\"multipleOf\", `expected a multiple of ${multipleOf}`);\n\t}\n\n\tprivate walkObject(\n\t\tnode: SchemaObject,\n\t\tb: string,\n\t\tv: Record<string, unknown>,\n\t\tpath: string,\n\t\tout: ValidationError[],\n\t\tpush: Push,\n\t): void {\n\t\tconst properties = isSchemaObject(node.properties) ? node.properties : {};\n\t\tconst required = Array.isArray(node.required) ? node.required : [];\n\t\tfor (const k of required) {\n\t\t\tif (typeof k !== \"string\") continue;\n\t\t\t// Present and set to undefined: missing unless its schema takes undefined (see declaredObject).\n\t\t\tconst accepted = v[k] === undefined && Object.hasOwn(properties, k) && this.ok(properties[k], b, undefined);\n\t\t\tif (!Object.hasOwn(v, k) || (v[k] === undefined && !accepted)) push(\"required\", \"missing\", pointer(path, k));\n\t\t}\n\t\tfor (const k of Object.keys(properties)) {\n\t\t\tif (Object.hasOwn(v, k) && v[k] !== undefined) this.walk(properties[k], b, v[k], pointer(path, k), out);\n\t\t}\n\t\tconst patterns = isSchemaObject(node.patternProperties) ? Object.entries(node.patternProperties) : [];\n\t\tfor (const k of Object.keys(v)) {\n\t\t\tlet matched = Object.hasOwn(properties, k);\n\t\t\tfor (const [p, s] of patterns) {\n\t\t\t\tif (sharedRegex(p).test(k)) {\n\t\t\t\t\tmatched = true;\n\t\t\t\t\tthis.walk(s, b, v[k], pointer(path, k), out);\n\t\t\t\t}\n\t\t\t}\n\t\t\tif (!matched && node.additionalProperties !== undefined) {\n\t\t\t\tif (node.additionalProperties === false) push(\"additionalProperties\", \"unknown field\", pointer(path, k));\n\t\t\t\telse this.walk(node.additionalProperties, b, v[k], pointer(path, k), out);\n\t\t\t}\n\t\t\tif (node.propertyNames !== undefined && !this.ok(node.propertyNames, b, k)) {\n\t\t\t\tpush(\"propertyNames\", \"invalid property name\", pointer(path, k));\n\t\t\t}\n\t\t}\n\t\tconst count = Object.keys(v).length;\n\t\tif (typeof node.minProperties === \"number\" && count < node.minProperties) {\n\t\t\tpush(\"minProperties\", `expected at least ${node.minProperties} properties`);\n\t\t}\n\t\tif (typeof node.maxProperties === \"number\" && count > node.maxProperties) {\n\t\t\tpush(\"maxProperties\", `expected at most ${node.maxProperties} properties`);\n\t\t}\n\t\tconst dependencies = {\n\t\t\t...(this.c.draft === \"7\" || !isSchemaObject(node.dependentRequired) ? {} : node.dependentRequired),\n\t\t\t...(isSchemaObject(node.dependencies) ? node.dependencies : {}),\n\t\t};\n\t\tfor (const [k, d] of Object.entries(dependencies)) {\n\t\t\tif (!Object.hasOwn(v, k)) continue;\n\t\t\tif (!Array.isArray(d)) this.walk(d, b, v, path, out);\n\t\t\telse\n\t\t\t\tfor (const r of d)\n\t\t\t\t\tif (!Object.hasOwn(v, r)) push(\"dependentRequired\", `required when ${k} is present`, pointer(path, r));\n\t\t}\n\t\tif (this.c.draft !== \"7\" && isSchemaObject(node.dependentSchemas)) {\n\t\t\tfor (const [k, s] of Object.entries(node.dependentSchemas))\n\t\t\t\tif (Object.hasOwn(v, k)) this.walk(s, b, v, path, out);\n\t\t}\n\t}\n\n\tprivate walkArray(\n\t\tnode: SchemaObject,\n\t\tb: string,\n\t\tv: unknown[],\n\t\tpath: string,\n\t\tout: ValidationError[],\n\t\tpush: Push,\n\t): void {\n\t\tlet prefix: readonly unknown[] = [];\n\t\tlet rest: unknown;\n\t\tif (Array.isArray(node.items)) {\n\t\t\tprefix = node.items;\n\t\t\trest = node.additionalItems;\n\t\t} else {\n\t\t\tif (this.c.draft !== \"7\" && Array.isArray(node.prefixItems)) prefix = node.prefixItems;\n\t\t\trest = node.items;\n\t\t}\n\t\tfor (let i = 0; i < v.length; i++) {\n\t\t\tconst s = i < prefix.length ? prefix[i] : rest;\n\t\t\tif (s !== undefined) this.walk(s, b, v[i], `${path}/${i}`, out);\n\t\t}\n\t\tif (typeof node.minItems === \"number\" && v.length < node.minItems) {\n\t\t\tpush(\"minItems\", `expected at least ${node.minItems} items`);\n\t\t}\n\t\tif (typeof node.maxItems === \"number\" && v.length > node.maxItems) {\n\t\t\tpush(\"maxItems\", `expected at most ${node.maxItems} items`);\n\t\t}\n\t\tif (node.uniqueItems === true && !uniqueCheck(v)) push(\"uniqueItems\", \"expected unique items\");\n\t\tif (node.contains !== undefined) {\n\t\t\tconst draft7 = this.c.draft === \"7\";\n\t\t\tconst min = draft7 || typeof node.minContains !== \"number\" ? 1 : node.minContains;\n\t\t\tconst max = draft7 || typeof node.maxContains !== \"number\" ? Number.POSITIVE_INFINITY : node.maxContains;\n\t\t\tif (!containsCheck(this.c.check(node.contains, b), min, max)(v)) {\n\t\t\t\tpush(\"contains\", containsMessage(min, max));\n\t\t\t}\n\t\t}\n\t}\n\n\tprivate walkUnion(\n\t\tbranches: readonly unknown[],\n\t\tb: string,\n\t\tv: unknown,\n\t\tpath: string,\n\t\tout: ValidationError[],\n\t\texactlyOne: boolean,\n\t): void {\n\t\tconst matches = branches.filter((s) => this.ok(s, b, v)).length;\n\t\tif (matches === 1 || (!exactlyOne && matches > 0)) return;\n\t\tconst keyword = exactlyOne ? \"oneOf\" : \"anyOf\";\n\t\tif (matches > 1) {\n\t\t\tout.push({ path, keyword, message: \"matches more than one alternative\" });\n\t\t\treturn;\n\t\t}\n\t\t// A tagged union reports the branch its tag selects; otherwise the branch whose first error is deepest.\n\t\tconst tag = this.tagOf(branches, b);\n\t\tif (tag !== undefined && isObject(v)) {\n\t\t\tconst i = tag.values.indexOf(v[tag.key]);\n\t\t\tif (i < 0)\n\t\t\t\tout.push({\n\t\t\t\t\tpath: pointer(path, tag.key),\n\t\t\t\t\tkeyword,\n\t\t\t\t\tmessage: `expected one of ${listValues(tag.values)}`,\n\t\t\t\t});\n\t\t\telse this.walk(branches[i], b, v, path, out);\n\t\t\treturn;\n\t\t}\n\t\t// An object is blamed on the branch that declares most of its properties (the one it was most likely meant for),\n\t\t// then on the branch whose first error is deepest.\n\t\tlet best: { errors: ValidationError[]; declared: number } | undefined;\n\t\tfor (const s of branches) {\n\t\t\tconst errors: ValidationError[] = [];\n\t\t\tthis.walk(s, b, v, path, errors);\n\t\t\tif (errors.length === 0) continue;\n\t\t\tconst declared = isObject(v) ? this.declaredKeys(s, b, v) : 0;\n\t\t\tconst better =\n\t\t\t\tbest === undefined ||\n\t\t\t\tdeclared > best.declared ||\n\t\t\t\t(declared === best.declared && errors[0].path.length > best.errors[0].path.length);\n\t\t\tif (better) best = { errors, declared };\n\t\t}\n\t\tout.push(...(best?.errors ?? [{ path, keyword, message: \"matches no alternative\" }]));\n\t}\n\n\t/** How many of the keys of `v` the branch `s` (through a `$ref`) declares in `properties`. */\n\tprivate declaredKeys(s: unknown, b: string, v: Record<string, unknown>): number {\n\t\tconst node =\n\t\t\tisSchemaObject(s) && typeof s.$ref === \"string\" ? this.c.r.resolve(s.$ref, this.c.r.baseFor(s, b)).node : s;\n\t\tconst properties = isSchemaObject(node) && isSchemaObject(node.properties) ? node.properties : {};\n\t\treturn Object.keys(v).filter((k) => Object.hasOwn(properties, k)).length;\n\t}\n\n\tprivate tagOf(branches: readonly unknown[], b: string): { key: string; values: unknown[] } | undefined {\n\t\tconst resolved = branches.map((s) =>\n\t\t\tisSchemaObject(s) && typeof s.$ref === \"string\" ? this.c.r.resolve(s.$ref, this.c.r.baseFor(s, b)).node : s,\n\t\t);\n\t\tconst first = resolved[0];\n\t\tif (!isSchemaObject(first) || !isSchemaObject(first.properties)) return undefined;\n\t\tfor (const key of Object.keys(first.properties)) {\n\t\t\tconst values = resolved.map((s) => {\n\t\t\t\tconst tag = isSchemaObject(s) && isSchemaObject(s.properties) ? s.properties[key] : undefined;\n\t\t\t\treturn isSchemaObject(tag) ? tag.const : undefined;\n\t\t\t});\n\t\t\tconst primitive = values.every((x) => x !== undefined && (typeof x !== \"object\" || x === null));\n\t\t\tif (primitive && new Set(values).size === values.length) return { key, values };\n\t\t}\n\t\treturn undefined;\n\t}\n\n\tprivate walkUnevaluated(node: SchemaObject, b: string, v: unknown, path: string, out: ValidationError[]): void {\n\t\t// `b` already applies the node's `$id`; the copy must not apply it again.\n\t\tconst { unevaluatedProperties, unevaluatedItems, $id: _id, ...rest } = node;\n\t\tconst a = newAnnotations();\n\t\tthis.c.annotating(rest, b)(v, a);\n\t\tif (isObject(v) && unevaluatedProperties !== undefined && !a.allProps) {\n\t\t\tfor (const k of Object.keys(v)) {\n\t\t\t\tif (a.props?.has(k)) continue;\n\t\t\t\tif (unevaluatedProperties === false) {\n\t\t\t\t\tout.push({ path: pointer(path, k), keyword: \"unevaluatedProperties\", message: \"unknown field\" });\n\t\t\t\t} else this.walk(unevaluatedProperties, b, v[k], pointer(path, k), out);\n\t\t\t}\n\t\t}\n\t\tif (Array.isArray(v) && unevaluatedItems !== undefined && !a.allItems) {\n\t\t\tfor (let i = a.items; i < v.length; i++) {\n\t\t\t\tif (a.indexes?.has(i)) continue;\n\t\t\t\tif (unevaluatedItems === false) {\n\t\t\t\t\tout.push({ path: `${path}/${i}`, keyword: \"unevaluatedItems\", message: \"unexpected item\" });\n\t\t\t\t} else this.walk(unevaluatedItems, b, v[i], `${path}/${i}`, out);\n\t\t\t}\n\t\t}\n\t}\n}\n\ntype Push = (keyword: string, message: string, at?: string) => void;\n\n// Enum errors name the allowed values; a long list (an enum of thousands) is cut, so the message stays readable.\nconst LISTED_VALUES = 20;\n\n/** `values` as JSON, at most LISTED_VALUES of them, then how many more there are. */\nfunction listValues(values: readonly unknown[]): string {\n\tif (values.length <= LISTED_VALUES) return JSON.stringify(values);\n\tconst listed = JSON.stringify(values.slice(0, LISTED_VALUES));\n\treturn `${listed.slice(0, -1)}, ... and ${values.length - LISTED_VALUES} more]`;\n}\n\nfunction containsMessage(min: number, max: number): string {\n\tif (max === Number.POSITIVE_INFINITY) return `expected at least ${min} matching ${min === 1 ? \"item\" : \"items\"}`;\n\tif (min === 0) return `expected at most ${max} matching ${max === 1 ? \"item\" : \"items\"}`;\n\treturn `expected between ${min} and ${max} matching items`;\n}\n\nfunction isBound(value: unknown): value is Bound {\n\treturn typeof value === \"number\" || typeof value === \"bigint\";\n}\n\nfunction pointer(path: string, key: string | number): string {\n\treturn `${path}/${String(key).replace(/~/g, \"~0\").replace(/\\//g, \"~1\")}`;\n}\n\nfunction typeName(v: unknown): string {\n\tif (v === null) return \"null\";\n\tif (Array.isArray(v)) return \"array\";\n\tif (v instanceof Uint8Array) return \"bytes\";\n\tif (typeof v === \"bigint\") return \"bigint\";\n\tif (typeof v === \"number\" && Number.isInteger(v)) return \"integer\";\n\tif (typeof v === \"number\" && !Number.isFinite(v)) return String(v);\n\treturn typeof v;\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { FormatCheck } from "../types.ts";
|
|
2
|
+
/**
|
|
3
|
+
* Every format JSON Schema 2020-12 defines, by name, plus `url` and `json-pointer-uri-fragment`, which TypeBox and
|
|
4
|
+
* ajv-formats also check. The checks are adapted from TypeBox 1.3.27 (MIT).
|
|
5
|
+
*/
|
|
6
|
+
export declare const formats: Readonly<Record<string, FormatCheck>>;
|
|
7
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/formats/index.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAuB/C;;;GAGG;AACH,eAAO,MAAM,OAAO,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,WAAW,CAAC,CAsBxD,CAAC"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// The format checks of JSON Schema 2020-12, for compile()'s `formats` option. An optional entry point: schemas
|
|
2
|
+
// compiled without it treat `format` as an annotation and do not bundle these checks.
|
|
3
|
+
import { IsDate } from "./typebox/date.js";
|
|
4
|
+
import { IsDateTime } from "./typebox/date_time.js";
|
|
5
|
+
import { IsDuration } from "./typebox/duration.js";
|
|
6
|
+
import { IsEmail } from "./typebox/email.js";
|
|
7
|
+
import { IsHostname } from "./typebox/hostname.js";
|
|
8
|
+
import { IsIdnEmail } from "./typebox/idn_email.js";
|
|
9
|
+
import { IsIdnHostname } from "./typebox/idn_hostname.js";
|
|
10
|
+
import { IsIPv4 } from "./typebox/ipv4.js";
|
|
11
|
+
import { IsIPv6 } from "./typebox/ipv6.js";
|
|
12
|
+
import { IsIri } from "./typebox/iri.js";
|
|
13
|
+
import { IsIriReference } from "./typebox/iri_reference.js";
|
|
14
|
+
import { IsJsonPointer } from "./typebox/json_pointer.js";
|
|
15
|
+
import { IsJsonPointerUriFragment } from "./typebox/json_pointer_uri_fragment.js";
|
|
16
|
+
import { IsRegex } from "./typebox/regex.js";
|
|
17
|
+
import { IsRelativeJsonPointer } from "./typebox/relative_json_pointer.js";
|
|
18
|
+
import { IsTime } from "./typebox/time.js";
|
|
19
|
+
import { IsUri } from "./typebox/uri.js";
|
|
20
|
+
import { IsUriReference } from "./typebox/uri_reference.js";
|
|
21
|
+
import { IsUriTemplate } from "./typebox/uri_template.js";
|
|
22
|
+
import { IsUrl } from "./typebox/url.js";
|
|
23
|
+
import { IsUuid } from "./typebox/uuid.js";
|
|
24
|
+
/**
|
|
25
|
+
* Every format JSON Schema 2020-12 defines, by name, plus `url` and `json-pointer-uri-fragment`, which TypeBox and
|
|
26
|
+
* ajv-formats also check. The checks are adapted from TypeBox 1.3.27 (MIT).
|
|
27
|
+
*/
|
|
28
|
+
export const formats = Object.freeze({
|
|
29
|
+
date: IsDate,
|
|
30
|
+
"date-time": IsDateTime,
|
|
31
|
+
duration: IsDuration,
|
|
32
|
+
email: IsEmail,
|
|
33
|
+
hostname: IsHostname,
|
|
34
|
+
"idn-email": IsIdnEmail,
|
|
35
|
+
"idn-hostname": IsIdnHostname,
|
|
36
|
+
ipv4: IsIPv4,
|
|
37
|
+
ipv6: IsIPv6,
|
|
38
|
+
iri: IsIri,
|
|
39
|
+
"iri-reference": IsIriReference,
|
|
40
|
+
"json-pointer": IsJsonPointer,
|
|
41
|
+
"json-pointer-uri-fragment": IsJsonPointerUriFragment,
|
|
42
|
+
regex: IsRegex,
|
|
43
|
+
"relative-json-pointer": IsRelativeJsonPointer,
|
|
44
|
+
time: IsTime,
|
|
45
|
+
uri: IsUri,
|
|
46
|
+
"uri-reference": IsUriReference,
|
|
47
|
+
"uri-template": IsUriTemplate,
|
|
48
|
+
url: IsUrl,
|
|
49
|
+
uuid: IsUuid,
|
|
50
|
+
});
|
|
51
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/formats/index.ts"],"names":[],"mappings":"AAAA,+GAA+G;AAC/G,sFAAsF;AAGtF,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AACnD,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AACpD,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,wBAAwB,EAAE,MAAM,wCAAwC,CAAC;AAClF,OAAO,EAAE,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAC7C,OAAO,EAAE,qBAAqB,EAAE,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,aAAa,EAAE,MAAM,2BAA2B,CAAC;AAC1D,OAAO,EAAE,KAAK,EAAE,MAAM,kBAAkB,CAAC;AACzC,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAE3C;;;GAGG;AACH,MAAM,CAAC,MAAM,OAAO,GAA0C,MAAM,CAAC,MAAM,CAAC;IAC3E,IAAI,EAAE,MAAM;IACZ,WAAW,EAAE,UAAU;IACvB,QAAQ,EAAE,UAAU;IACpB,KAAK,EAAE,OAAO;IACd,QAAQ,EAAE,UAAU;IACpB,WAAW,EAAE,UAAU;IACvB,cAAc,EAAE,aAAa;IAC7B,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;IACV,eAAe,EAAE,cAAc;IAC/B,cAAc,EAAE,aAAa;IAC7B,2BAA2B,EAAE,wBAAwB;IACrD,KAAK,EAAE,OAAO;IACd,uBAAuB,EAAE,qBAAqB;IAC9C,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;IACV,eAAe,EAAE,cAAc;IAC/B,cAAc,EAAE,aAAa;IAC7B,GAAG,EAAE,KAAK;IACV,IAAI,EAAE,MAAM;CACZ,CAAC,CAAC","sourcesContent":["// The format checks of JSON Schema 2020-12, for compile()'s `formats` option. An optional entry point: schemas\n// compiled without it treat `format` as an annotation and do not bundle these checks.\n\nimport type { FormatCheck } from \"../types.ts\";\nimport { IsDate } from \"./typebox/date.ts\";\nimport { IsDateTime } from \"./typebox/date_time.ts\";\nimport { IsDuration } from \"./typebox/duration.ts\";\nimport { IsEmail } from \"./typebox/email.ts\";\nimport { IsHostname } from \"./typebox/hostname.ts\";\nimport { IsIdnEmail } from \"./typebox/idn_email.ts\";\nimport { IsIdnHostname } from \"./typebox/idn_hostname.ts\";\nimport { IsIPv4 } from \"./typebox/ipv4.ts\";\nimport { IsIPv6 } from \"./typebox/ipv6.ts\";\nimport { IsIri } from \"./typebox/iri.ts\";\nimport { IsIriReference } from \"./typebox/iri_reference.ts\";\nimport { IsJsonPointer } from \"./typebox/json_pointer.ts\";\nimport { IsJsonPointerUriFragment } from \"./typebox/json_pointer_uri_fragment.ts\";\nimport { IsRegex } from \"./typebox/regex.ts\";\nimport { IsRelativeJsonPointer } from \"./typebox/relative_json_pointer.ts\";\nimport { IsTime } from \"./typebox/time.ts\";\nimport { IsUri } from \"./typebox/uri.ts\";\nimport { IsUriReference } from \"./typebox/uri_reference.ts\";\nimport { IsUriTemplate } from \"./typebox/uri_template.ts\";\nimport { IsUrl } from \"./typebox/url.ts\";\nimport { IsUuid } from \"./typebox/uuid.ts\";\n\n/**\n * Every format JSON Schema 2020-12 defines, by name, plus `url` and `json-pointer-uri-fragment`, which TypeBox and\n * ajv-formats also check. The checks are adapted from TypeBox 1.3.27 (MIT).\n */\nexport const formats: Readonly<Record<string, FormatCheck>> = Object.freeze({\n\tdate: IsDate,\n\t\"date-time\": IsDateTime,\n\tduration: IsDuration,\n\temail: IsEmail,\n\thostname: IsHostname,\n\t\"idn-email\": IsIdnEmail,\n\t\"idn-hostname\": IsIdnHostname,\n\tipv4: IsIPv4,\n\tipv6: IsIPv6,\n\tiri: IsIri,\n\t\"iri-reference\": IsIriReference,\n\t\"json-pointer\": IsJsonPointer,\n\t\"json-pointer-uri-fragment\": IsJsonPointerUriFragment,\n\tregex: IsRegex,\n\t\"relative-json-pointer\": IsRelativeJsonPointer,\n\ttime: IsTime,\n\turi: IsUri,\n\t\"uri-reference\": IsUriReference,\n\t\"uri-template\": IsUriTemplate,\n\turl: IsUrl,\n\tuuid: IsUuid,\n});\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date.d.ts","sourceRoot":"","sources":["../../../src/formats/typebox/date.ts"],"names":[],"mappings":"AAkCA;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAO7C"}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
/*--------------------------------------------------------------------------
|
|
2
|
+
|
|
3
|
+
TypeBox
|
|
4
|
+
|
|
5
|
+
The MIT License (MIT)
|
|
6
|
+
|
|
7
|
+
Copyright (c) 2017-2026 Haydn Paterson
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
in the Software without restriction, including without limitation the rights
|
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
furnished to do so, subject to the following conditions:
|
|
15
|
+
|
|
16
|
+
The above copyright notice and this permission notice shall be included in
|
|
17
|
+
all copies or substantial portions of the Software.
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
25
|
+
THE SOFTWARE.
|
|
26
|
+
|
|
27
|
+
---------------------------------------------------------------------------*/
|
|
28
|
+
const DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];
|
|
29
|
+
const DATE = /^(\d\d\d\d)-(\d\d)-(\d\d)$/;
|
|
30
|
+
function IsLeapYear(year) {
|
|
31
|
+
return year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Returns true if the value is a ISO8601 Date component string
|
|
35
|
+
* @description https://datatracker.ietf.org/doc/html/rfc3339
|
|
36
|
+
* @example `2020-12-12`
|
|
37
|
+
*/
|
|
38
|
+
export function IsDate(value) {
|
|
39
|
+
const matches = DATE.exec(value);
|
|
40
|
+
if (!matches)
|
|
41
|
+
return false;
|
|
42
|
+
const year = +matches[1];
|
|
43
|
+
const month = +matches[2];
|
|
44
|
+
const day = +matches[3];
|
|
45
|
+
return month >= 1 && month <= 12 && day >= 1 && day <= (month === 2 && IsLeapYear(year) ? 29 : DAYS[month]);
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=date.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date.js","sourceRoot":"","sources":["../../../src/formats/typebox/date.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;6EA0B6E;AAE7E,MAAM,IAAI,GAAG,CAAC,CAAC,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;AACjE,MAAM,IAAI,GAAG,4BAA4B,CAAC;AAE1C,SAAS,UAAU,CAAC,IAAY;IAC/B,OAAO,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,GAAG,KAAK,CAAC,IAAI,IAAI,GAAG,GAAG,KAAK,CAAC,CAAC,CAAC;AACjE,CAAC;AACD;;;;GAIG;AACH,MAAM,UAAU,MAAM,CAAC,KAAa;IACnC,MAAM,OAAO,GAAoB,IAAI,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAClD,IAAI,CAAC,OAAO;QAAE,OAAO,KAAK,CAAC;IAC3B,MAAM,IAAI,GAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IACjC,MAAM,KAAK,GAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAClC,MAAM,GAAG,GAAW,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC;IAChC,OAAO,KAAK,IAAI,CAAC,IAAI,KAAK,IAAI,EAAE,IAAI,GAAG,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,KAAK,KAAK,CAAC,IAAI,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC;AAC7G,CAAC","sourcesContent":["/*--------------------------------------------------------------------------\n\nTypeBox\n\nThe MIT License (MIT)\n\nCopyright (c) 2017-2026 Haydn Paterson\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n---------------------------------------------------------------------------*/\n\nconst DAYS = [0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31];\nconst DATE = /^(\\d\\d\\d\\d)-(\\d\\d)-(\\d\\d)$/;\n\nfunction IsLeapYear(year: number): boolean {\n\treturn year % 4 === 0 && (year % 100 !== 0 || year % 400 === 0);\n}\n/**\n * Returns true if the value is a ISO8601 Date component string\n * @description https://datatracker.ietf.org/doc/html/rfc3339\n * @example `2020-12-12`\n */\nexport function IsDate(value: string): boolean {\n\tconst matches: string[] | null = DATE.exec(value);\n\tif (!matches) return false;\n\tconst year: number = +matches[1];\n\tconst month: number = +matches[2];\n\tconst day: number = +matches[3];\n\treturn month >= 1 && month <= 12 && day >= 1 && day <= (month === 2 && IsLeapYear(year) ? 29 : DAYS[month]);\n}\n"]}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns true if the value is a ISO8601 DateTime string
|
|
3
|
+
* @specification https://datatracker.ietf.org/doc/html/rfc3339
|
|
4
|
+
* @example `2020-12-12T20:20:40+00:00`
|
|
5
|
+
*/
|
|
6
|
+
export declare function IsDateTime(value: string): boolean;
|
|
7
|
+
//# sourceMappingURL=date_time.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date_time.d.ts","sourceRoot":"","sources":["../../../src/formats/typebox/date_time.ts"],"names":[],"mappings":"AA+BA;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAGjD"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*--------------------------------------------------------------------------
|
|
2
|
+
|
|
3
|
+
TypeBox
|
|
4
|
+
|
|
5
|
+
The MIT License (MIT)
|
|
6
|
+
|
|
7
|
+
Copyright (c) 2017-2026 Haydn Paterson
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
in the Software without restriction, including without limitation the rights
|
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
furnished to do so, subject to the following conditions:
|
|
15
|
+
|
|
16
|
+
The above copyright notice and this permission notice shall be included in
|
|
17
|
+
all copies or substantial portions of the Software.
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
25
|
+
THE SOFTWARE.
|
|
26
|
+
|
|
27
|
+
---------------------------------------------------------------------------*/
|
|
28
|
+
import { IsDate } from "./date.js";
|
|
29
|
+
import { IsTime } from "./time.js";
|
|
30
|
+
/**
|
|
31
|
+
* Returns true if the value is a ISO8601 DateTime string
|
|
32
|
+
* @specification https://datatracker.ietf.org/doc/html/rfc3339
|
|
33
|
+
* @example `2020-12-12T20:20:40+00:00`
|
|
34
|
+
*/
|
|
35
|
+
export function IsDateTime(value) {
|
|
36
|
+
const dateTime = value.split(/T/i);
|
|
37
|
+
return dateTime.length === 2 && IsDate(dateTime[0]) && IsTime(dateTime[1]);
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=date_time.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"date_time.js","sourceRoot":"","sources":["../../../src/formats/typebox/date_time.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;6EA0B6E;AAE7E,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AACnC,OAAO,EAAE,MAAM,EAAE,MAAM,WAAW,CAAC;AAEnC;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,KAAa;IACvC,MAAM,QAAQ,GAAa,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IAC7C,OAAO,QAAQ,CAAC,MAAM,KAAK,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,IAAI,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC;AAC5E,CAAC","sourcesContent":["/*--------------------------------------------------------------------------\n\nTypeBox\n\nThe MIT License (MIT)\n\nCopyright (c) 2017-2026 Haydn Paterson\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n---------------------------------------------------------------------------*/\n\nimport { IsDate } from \"./date.ts\";\nimport { IsTime } from \"./time.ts\";\n\n/**\n * Returns true if the value is a ISO8601 DateTime string\n * @specification https://datatracker.ietf.org/doc/html/rfc3339\n * @example `2020-12-12T20:20:40+00:00`\n */\nexport function IsDateTime(value: string): boolean {\n\tconst dateTime: string[] = value.split(/T/i);\n\treturn dateTime.length === 2 && IsDate(dateTime[0]) && IsTime(dateTime[1]);\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duration.d.ts","sourceRoot":"","sources":["../../../src/formats/typebox/duration.ts"],"names":[],"mappings":"AA+BA;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEjD"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*--------------------------------------------------------------------------
|
|
2
|
+
|
|
3
|
+
TypeBox
|
|
4
|
+
|
|
5
|
+
The MIT License (MIT)
|
|
6
|
+
|
|
7
|
+
Copyright (c) 2017-2026 Haydn Paterson
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
in the Software without restriction, including without limitation the rights
|
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
furnished to do so, subject to the following conditions:
|
|
15
|
+
|
|
16
|
+
The above copyright notice and this permission notice shall be included in
|
|
17
|
+
all copies or substantial portions of the Software.
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
25
|
+
THE SOFTWARE.
|
|
26
|
+
|
|
27
|
+
---------------------------------------------------------------------------*/
|
|
28
|
+
const Duration = /^P((\d+Y(\d+M(\d+D)?)?|\d+M(\d+D)?|\d+D)(T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S))?|T(\d+H(\d+M(\d+S)?)?|\d+M(\d+S)?|\d+S)|\d+W)$/;
|
|
29
|
+
/**
|
|
30
|
+
* Returns true if the value is a valid ISO-8601 duration.
|
|
31
|
+
* @specification https://tools.ietf.org/html/rfc3339
|
|
32
|
+
*/
|
|
33
|
+
export function IsDuration(value) {
|
|
34
|
+
return Duration.test(value);
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=duration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"duration.js","sourceRoot":"","sources":["../../../src/formats/typebox/duration.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;6EA0B6E;AAE7E,MAAM,QAAQ,GACb,iIAAiI,CAAC;AAEnI;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,KAAa;IACvC,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC7B,CAAC","sourcesContent":["/*--------------------------------------------------------------------------\n\nTypeBox\n\nThe MIT License (MIT)\n\nCopyright (c) 2017-2026 Haydn Paterson\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n---------------------------------------------------------------------------*/\n\nconst Duration =\n\t/^P((\\d+Y(\\d+M(\\d+D)?)?|\\d+M(\\d+D)?|\\d+D)(T(\\d+H(\\d+M(\\d+S)?)?|\\d+M(\\d+S)?|\\d+S))?|T(\\d+H(\\d+M(\\d+S)?)?|\\d+M(\\d+S)?|\\d+S)|\\d+W)$/;\n\n/**\n * Returns true if the value is a valid ISO-8601 duration.\n * @specification https://tools.ietf.org/html/rfc3339\n */\nexport function IsDuration(value: string): boolean {\n\treturn Duration.test(value);\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email.d.ts","sourceRoot":"","sources":["../../../src/formats/typebox/email.ts"],"names":[],"mappings":"AA+BA;;;GAGG;AACH,wBAAgB,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAE9C"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*--------------------------------------------------------------------------
|
|
2
|
+
|
|
3
|
+
TypeBox
|
|
4
|
+
|
|
5
|
+
The MIT License (MIT)
|
|
6
|
+
|
|
7
|
+
Copyright (c) 2017-2026 Haydn Paterson
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
in the Software without restriction, including without limitation the rights
|
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
furnished to do so, subject to the following conditions:
|
|
15
|
+
|
|
16
|
+
The above copyright notice and this permission notice shall be included in
|
|
17
|
+
all copies or substantial portions of the Software.
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
25
|
+
THE SOFTWARE.
|
|
26
|
+
|
|
27
|
+
---------------------------------------------------------------------------*/
|
|
28
|
+
const Email = /^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|"(?:[^"\\]|\\[\x20-\x7e])*")@(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*|\[(?:IPv6:[a-f0-9:]+|(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3})\])$/i;
|
|
29
|
+
/**
|
|
30
|
+
* Returns true if the value is an Email
|
|
31
|
+
* @specification https://datatracker.ietf.org/doc/html/rfc5322
|
|
32
|
+
*/
|
|
33
|
+
export function IsEmail(value) {
|
|
34
|
+
return Email.test(value);
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=email.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"email.js","sourceRoot":"","sources":["../../../src/formats/typebox/email.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;6EA0B6E;AAE7E,MAAM,KAAK,GACV,oTAAoT,CAAC;AAEtT;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAC,KAAa;IACpC,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AAC1B,CAAC","sourcesContent":["/*--------------------------------------------------------------------------\n\nTypeBox\n\nThe MIT License (MIT)\n\nCopyright (c) 2017-2026 Haydn Paterson\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n---------------------------------------------------------------------------*/\n\nconst Email =\n\t/^(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[^\"\\\\]|\\\\[\\x20-\\x7e])*\")@(?:[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]{0,61}[a-z0-9])?)*|\\[(?:IPv6:[a-f0-9:]+|(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])(?:\\.(?:25[0-5]|2[0-4][0-9]|1[0-9]{2}|[1-9]?[0-9])){3})\\])$/i;\n\n/**\n * Returns true if the value is an Email\n * @specification https://datatracker.ietf.org/doc/html/rfc5322\n */\nexport function IsEmail(value: string): boolean {\n\treturn Email.test(value);\n}\n"]}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns true if the value is a valid hostname.
|
|
3
|
+
* @specification https://tools.ietf.org/html/rfc1123
|
|
4
|
+
* @specification https://tools.ietf.org/html/rfc5891
|
|
5
|
+
* @specification https://tools.ietf.org/html/rfc5892
|
|
6
|
+
*/
|
|
7
|
+
export declare function IsHostname(value: string): boolean;
|
|
8
|
+
//# sourceMappingURL=hostname.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hostname.d.ts","sourceRoot":"","sources":["../../../src/formats/typebox/hostname.ts"],"names":[],"mappings":"AA8BA;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEjD"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*--------------------------------------------------------------------------
|
|
2
|
+
|
|
3
|
+
TypeBox
|
|
4
|
+
|
|
5
|
+
The MIT License (MIT)
|
|
6
|
+
|
|
7
|
+
Copyright (c) 2017-2026 Haydn Paterson
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
in the Software without restriction, including without limitation the rights
|
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
furnished to do so, subject to the following conditions:
|
|
15
|
+
|
|
16
|
+
The above copyright notice and this permission notice shall be included in
|
|
17
|
+
all copies or substantial portions of the Software.
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
25
|
+
THE SOFTWARE.
|
|
26
|
+
|
|
27
|
+
---------------------------------------------------------------------------*/
|
|
28
|
+
import * as Idna from "./idna/index.js";
|
|
29
|
+
/**
|
|
30
|
+
* Returns true if the value is a valid hostname.
|
|
31
|
+
* @specification https://tools.ietf.org/html/rfc1123
|
|
32
|
+
* @specification https://tools.ietf.org/html/rfc5891
|
|
33
|
+
* @specification https://tools.ietf.org/html/rfc5892
|
|
34
|
+
*/
|
|
35
|
+
export function IsHostname(value) {
|
|
36
|
+
return Idna.IsHostname(value);
|
|
37
|
+
}
|
|
38
|
+
//# sourceMappingURL=hostname.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"hostname.js","sourceRoot":"","sources":["../../../src/formats/typebox/hostname.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;6EA0B6E;AAE7E,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAExC;;;;;GAKG;AACH,MAAM,UAAU,UAAU,CAAC,KAAa;IACvC,OAAO,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC","sourcesContent":["/*--------------------------------------------------------------------------\n\nTypeBox\n\nThe MIT License (MIT)\n\nCopyright (c) 2017-2026 Haydn Paterson\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n---------------------------------------------------------------------------*/\n\nimport * as Idna from \"./idna/index.ts\";\n\n/**\n * Returns true if the value is a valid hostname.\n * @specification https://tools.ietf.org/html/rfc1123\n * @specification https://tools.ietf.org/html/rfc5891\n * @specification https://tools.ietf.org/html/rfc5892\n */\nexport function IsHostname(value: string): boolean {\n\treturn Idna.IsHostname(value);\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"idn_email.d.ts","sourceRoot":"","sources":["../../../src/formats/typebox/idn_email.ts"],"names":[],"mappings":"AA+BA;;;GAGG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEjD"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/*--------------------------------------------------------------------------
|
|
2
|
+
|
|
3
|
+
TypeBox
|
|
4
|
+
|
|
5
|
+
The MIT License (MIT)
|
|
6
|
+
|
|
7
|
+
Copyright (c) 2017-2026 Haydn Paterson
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
in the Software without restriction, including without limitation the rights
|
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
furnished to do so, subject to the following conditions:
|
|
15
|
+
|
|
16
|
+
The above copyright notice and this permission notice shall be included in
|
|
17
|
+
all copies or substantial portions of the Software.
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
25
|
+
THE SOFTWARE.
|
|
26
|
+
|
|
27
|
+
---------------------------------------------------------------------------*/
|
|
28
|
+
const IdnEmail = /^(?:[A-Za-z0-9!#$%&'*+/=?^_`{|}~\u{0080}-\u{10FFFF}-]+(?:\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~\u{0080}-\u{10FFFF}-]+)*|"(?:[^"\\]|\\.)*")@[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,62})(?<!-)(?:\.[\p{L}\p{N}](?:[\p{L}\p{N}-]{0,62})(?<!-))*$/iu;
|
|
29
|
+
/**
|
|
30
|
+
* Returns true if the value is an IdnEmail
|
|
31
|
+
* @specification https://datatracker.ietf.org/doc/html/rfc4952
|
|
32
|
+
*/
|
|
33
|
+
export function IsIdnEmail(value) {
|
|
34
|
+
return IdnEmail.test(value.normalize("NFC"));
|
|
35
|
+
}
|
|
36
|
+
//# sourceMappingURL=idn_email.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"idn_email.js","sourceRoot":"","sources":["../../../src/formats/typebox/idn_email.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;6EA0B6E;AAE7E,MAAM,QAAQ,GACb,iOAAiO,CAAC;AAEnO;;;GAGG;AACH,MAAM,UAAU,UAAU,CAAC,KAAa;IACvC,OAAO,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,CAAC;AAC9C,CAAC","sourcesContent":["/*--------------------------------------------------------------------------\n\nTypeBox\n\nThe MIT License (MIT)\n\nCopyright (c) 2017-2026 Haydn Paterson\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n---------------------------------------------------------------------------*/\n\nconst IdnEmail =\n\t/^(?:[A-Za-z0-9!#$%&'*+/=?^_`{|}~\\u{0080}-\\u{10FFFF}-]+(?:\\.[A-Za-z0-9!#$%&'*+/=?^_`{|}~\\u{0080}-\\u{10FFFF}-]+)*|\"(?:[^\"\\\\]|\\\\.)*\")@[\\p{L}\\p{N}](?:[\\p{L}\\p{N}-]{0,62})(?<!-)(?:\\.[\\p{L}\\p{N}](?:[\\p{L}\\p{N}-]{0,62})(?<!-))*$/iu;\n\n/**\n * Returns true if the value is an IdnEmail\n * @specification https://datatracker.ietf.org/doc/html/rfc4952\n */\nexport function IsIdnEmail(value: string): boolean {\n\treturn IdnEmail.test(value.normalize(\"NFC\"));\n}\n"]}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Returns true if the value is a valid internationalized (IDN) hostname.
|
|
3
|
+
* @specification https://tools.ietf.org/html/rfc3490
|
|
4
|
+
* @specification https://tools.ietf.org/html/rfc5891
|
|
5
|
+
* @specification https://tools.ietf.org/html/rfc5892
|
|
6
|
+
* @specification https://tools.ietf.org/html/rfc5893
|
|
7
|
+
*/
|
|
8
|
+
export declare function IsIdnHostname(value: string): boolean;
|
|
9
|
+
//# sourceMappingURL=idn_hostname.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"idn_hostname.d.ts","sourceRoot":"","sources":["../../../src/formats/typebox/idn_hostname.ts"],"names":[],"mappings":"AA8BA;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAEpD"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/*--------------------------------------------------------------------------
|
|
2
|
+
|
|
3
|
+
TypeBox
|
|
4
|
+
|
|
5
|
+
The MIT License (MIT)
|
|
6
|
+
|
|
7
|
+
Copyright (c) 2017-2026 Haydn Paterson
|
|
8
|
+
|
|
9
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
10
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
11
|
+
in the Software without restriction, including without limitation the rights
|
|
12
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
13
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
14
|
+
furnished to do so, subject to the following conditions:
|
|
15
|
+
|
|
16
|
+
The above copyright notice and this permission notice shall be included in
|
|
17
|
+
all copies or substantial portions of the Software.
|
|
18
|
+
|
|
19
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
20
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
21
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
22
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
23
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
24
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
25
|
+
THE SOFTWARE.
|
|
26
|
+
|
|
27
|
+
---------------------------------------------------------------------------*/
|
|
28
|
+
import * as Idna from "./idna/index.js";
|
|
29
|
+
/**
|
|
30
|
+
* Returns true if the value is a valid internationalized (IDN) hostname.
|
|
31
|
+
* @specification https://tools.ietf.org/html/rfc3490
|
|
32
|
+
* @specification https://tools.ietf.org/html/rfc5891
|
|
33
|
+
* @specification https://tools.ietf.org/html/rfc5892
|
|
34
|
+
* @specification https://tools.ietf.org/html/rfc5893
|
|
35
|
+
*/
|
|
36
|
+
export function IsIdnHostname(value) {
|
|
37
|
+
return Idna.IsIdnHostname(value);
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=idn_hostname.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"idn_hostname.js","sourceRoot":"","sources":["../../../src/formats/typebox/idn_hostname.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;6EA0B6E;AAE7E,OAAO,KAAK,IAAI,MAAM,iBAAiB,CAAC;AAExC;;;;;;GAMG;AACH,MAAM,UAAU,aAAa,CAAC,KAAa;IAC1C,OAAO,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC;AAClC,CAAC","sourcesContent":["/*--------------------------------------------------------------------------\n\nTypeBox\n\nThe MIT License (MIT)\n\nCopyright (c) 2017-2026 Haydn Paterson\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n\n---------------------------------------------------------------------------*/\n\nimport * as Idna from \"./idna/index.ts\";\n\n/**\n * Returns true if the value is a valid internationalized (IDN) hostname.\n * @specification https://tools.ietf.org/html/rfc3490\n * @specification https://tools.ietf.org/html/rfc5891\n * @specification https://tools.ietf.org/html/rfc5892\n * @specification https://tools.ietf.org/html/rfc5893\n */\nexport function IsIdnHostname(value: string): boolean {\n\treturn Idna.IsIdnHostname(value);\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bidi.d.ts","sourceRoot":"","sources":["../../../../../src/formats/typebox/idna/format/bidi.ts"],"names":[],"mappings":"AA8CA,wBAAgB,YAAY,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CASnD;AA8BD,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAG/D;AAID,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO,CAkCxD"}
|