@nhtio/validation 0.1.0-master-67185cae → 0.1.0-master-c7157b24
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/index.cjs +6 -5
- package/index.cjs.map +1 -1
- package/index.mjs +6 -5
- package/index.mjs.map +1 -1
- package/package.json +1 -1
- package/private/schemas.d.ts +1 -1
package/index.cjs
CHANGED
|
@@ -94028,8 +94028,9 @@ const toDateTime = (value, format) => {
|
|
|
94028
94028
|
const dateTime = DateTime.fromFormat(value, format, { zone: "utc" });
|
|
94029
94029
|
if (dateTime.isValid) return dateTime;
|
|
94030
94030
|
}
|
|
94031
|
+
const isoDateTime = DateTime.fromISO(value, { setZone: true });
|
|
94032
|
+
if (isoDateTime.isValid) return isoDateTime;
|
|
94031
94033
|
const luxonMethods = [
|
|
94032
|
-
DateTime.fromISO,
|
|
94033
94034
|
DateTime.fromRFC2822,
|
|
94034
94035
|
DateTime.fromHTTP,
|
|
94035
94036
|
DateTime.fromSQL
|
|
@@ -109523,7 +109524,7 @@ const encode = (schema) => {
|
|
|
109523
109524
|
});
|
|
109524
109525
|
}
|
|
109525
109526
|
const json$1 = JSON.stringify({
|
|
109526
|
-
version: "0.1.0-master-
|
|
109527
|
+
version: "0.1.0-master-c7157b24",
|
|
109527
109528
|
schema: description$1
|
|
109528
109529
|
}, (_, value) => {
|
|
109529
109530
|
if (typeof value === "bigint") return value.toString();
|
|
@@ -109539,9 +109540,9 @@ const decode = (base64) => {
|
|
|
109539
109540
|
const description$1 = JSON.parse(json$1);
|
|
109540
109541
|
if (!isPlainObject(description$1) || !("version" in description$1) || !("schema" in description$1) || typeof description$1.version !== "string" || !isPlainObject(description$1.schema)) throw new TypeError("Not a valid encoded schema");
|
|
109541
109542
|
const { version: schemaVersion, schema } = description$1;
|
|
109542
|
-
if (import_semver.valid("0.1.0-master-
|
|
109543
|
+
if (import_semver.valid("0.1.0-master-c7157b24")) {
|
|
109543
109544
|
if (!import_semver.valid(import_semver.coerce(schemaVersion))) throw new TypeError(`Invalid schema version: ${schemaVersion}`);
|
|
109544
|
-
if (import_semver.gt(import_semver.coerce(schemaVersion), "0.1.0-master-
|
|
109545
|
+
if (import_semver.gt(import_semver.coerce(schemaVersion), "0.1.0-master-c7157b24")) throw new TypeError(`Schema version ${schemaVersion} is not compatible with current version 0.1.0-master-c7157b24`);
|
|
109545
109546
|
}
|
|
109546
109547
|
return validator.build(schema);
|
|
109547
109548
|
};
|
|
@@ -112807,7 +112808,7 @@ const tlds = new Set(TLDS.map((tld) => tld.toLowerCase()));
|
|
|
112807
112808
|
var import_lib = __toESM(require_lib$1());
|
|
112808
112809
|
var import_lib$1 = __toESM(require_lib());
|
|
112809
112810
|
var import_lib$2 = __toESM(require_lib$2());
|
|
112810
|
-
const version = "0.1.0-master-
|
|
112811
|
+
const version = "0.1.0-master-c7157b24";
|
|
112811
112812
|
Object.defineProperty(exports, "ValidationError", {
|
|
112812
112813
|
enumerable: true,
|
|
112813
112814
|
get: function() {
|