191 lines
5.7 KiB
JavaScript
191 lines
5.7 KiB
JavaScript
// Metro module 12096 (f12097).
|
|
import * as _mergeDefs from "./mergeDefs";
|
|
const r2 = (this ? this.__createBinding : this) || (Object.create ? function(a0, a1, a2, a3) {
|
|
const r6 = a3 === void 0 ? a2 : a3;
|
|
let r9 = Object.getOwnPropertyDescriptor(a1, a2);
|
|
if (!(r9 ? !("get" in r9 ? !a1.__esModule : r9.writable || r9.configurable) : r9)) {
|
|
r9 = {
|
|
enumerable: true,
|
|
get: function get() {
|
|
return a1[a2];
|
|
}
|
|
};
|
|
}
|
|
Object.defineProperty(a0, r6, r9);
|
|
} : function(a0, a1, a2, a3) {
|
|
a0[a3 === void 0 ? a2 : a3] = a1[a2];
|
|
});
|
|
let c8328_2, error;
|
|
let c8328_0 = r2;
|
|
let c8328_1 = (this ? this.__setModuleDefault : this) || (Object.create ? function(a0, a1) {
|
|
Object.defineProperty(a0, "default", {
|
|
enumerable: true,
|
|
value: a1
|
|
});
|
|
} : function(a0, a1) {
|
|
a0.default = a1;
|
|
});
|
|
const r5 = (this ? this.__importStar : this) || function(a0) {
|
|
if (a0 && a0.__esModule) {
|
|
return a0;
|
|
}
|
|
const r15 = {};
|
|
if (a0 != null) {
|
|
for (const key in a0) {
|
|
if (key !== "default" && Object.prototype.hasOwnProperty.call(a0, key)) {
|
|
c8328_0(r15, a0, key);
|
|
}
|
|
}
|
|
}
|
|
c8328_1(r15, a0);
|
|
return r15;
|
|
};
|
|
export default function default_1() {
|
|
let c19524_0 = {
|
|
string: {
|
|
unit: "tegn",
|
|
verb: "havde"
|
|
},
|
|
file: {
|
|
unit: "bytes",
|
|
verb: "havde"
|
|
},
|
|
array: {
|
|
unit: "elementer",
|
|
verb: "indeholdt"
|
|
},
|
|
set: {
|
|
unit: "elementer",
|
|
verb: "indeholdt"
|
|
}
|
|
};
|
|
let c19524_1 = {
|
|
regex: "input",
|
|
email: "e-mailadresse",
|
|
url: "URL",
|
|
emoji: "emoji",
|
|
uuid: "UUID",
|
|
uuidv4: "UUIDv4",
|
|
uuidv6: "UUIDv6",
|
|
nanoid: "nanoid",
|
|
guid: "GUID",
|
|
cuid: "cuid",
|
|
cuid2: "cuid2",
|
|
ulid: "ULID",
|
|
xid: "XID",
|
|
ksuid: "KSUID",
|
|
datetime: "ISO dato- og klokkeslæt",
|
|
date: "ISO-dato",
|
|
time: "ISO-klokkeslæt",
|
|
duration: "ISO-varighed",
|
|
ipv4: "IPv4-område",
|
|
ipv6: "IPv6-område",
|
|
cidrv4: "IPv4-spektrum",
|
|
cidrv6: "IPv6-spektrum",
|
|
base64: "base64-kodet streng",
|
|
base64url: "base64url-kodet streng",
|
|
json_string: "JSON-streng",
|
|
e164: "E.164-nummer",
|
|
jwt: "JWT",
|
|
template_literal: "input"
|
|
};
|
|
let c19524_2 = {
|
|
nan: "NaN",
|
|
string: "streng",
|
|
number: "tal",
|
|
boolean: "boolean",
|
|
array: "liste",
|
|
object: "objekt",
|
|
set: "sæt",
|
|
file: "fil"
|
|
};
|
|
return {
|
|
localeError: (a0) => {
|
|
let r69, r138;
|
|
switch (a0.code) {
|
|
case "invalid_type":
|
|
let r183 = c19524_2[a0.expected];
|
|
if (r183 == null) {
|
|
r183 = a0.expected;
|
|
}
|
|
const r189 = c8328_2.parsedType(a0.input);
|
|
let r190 = c19524_2[r189];
|
|
if (r190 == null) {
|
|
r190 = r189;
|
|
}
|
|
return /^[A-Z]/.test(a0.expected) ? `Ugyldigt input: forventede instanceof ${a0.expected}, fik ${r190}` : `Ugyldigt input: forventede ${r183}, fik ${r190}`;
|
|
case "invalid_value":
|
|
return a0.values.length === 1 ? `Ugyldig værdi: forventede ${c8328_2.stringifyPrimitive(a0.values[0])}` : `Ugyldigt valg: forventede en af følgende ${c8328_2.joinValues(a0.values, "|")}`;
|
|
case "too_big":
|
|
const r119 = a0.inclusive ? "<=" : "<";
|
|
let r122 = c19524_0[a0.origin];
|
|
if (r122 == null) {
|
|
r122 = null;
|
|
}
|
|
let r126 = c19524_2[a0.origin];
|
|
if (r126 == null) {
|
|
r126 = a0.origin;
|
|
}
|
|
if (r122) {
|
|
if (r126 == null) {
|
|
r126 = "value";
|
|
}
|
|
const verb = r122.verb;
|
|
const r9 = a0.maximum.toString();
|
|
let unit = r122.unit;
|
|
if (unit == null) {
|
|
unit = "elementer";
|
|
}
|
|
r138 = `For stor: forventede ${r126} ${verb} ${r119} ${r9} ${unit}`;
|
|
} else {
|
|
r138 = `For stor: forventede ${r126 == null ? "value" : r126} havde ${r119} ${a0.maximum.toString()}`;
|
|
}
|
|
return r138;
|
|
case "too_small":
|
|
const r12 = a0.inclusive ? ">=" : ">";
|
|
let r96 = c19524_0[a0.origin];
|
|
if (r96 == null) {
|
|
r96 = null;
|
|
}
|
|
let r11 = c19524_2[a0.origin];
|
|
if (r11 == null) {
|
|
r11 = a0.origin;
|
|
}
|
|
return r96 ? `For lille: forventede ${r11} ${r96.verb} ${r12} ${a0.minimum.toString()} ${r96.unit}` : `For lille: forventede ${r11} havde ${r12} ${a0.minimum.toString()}`;
|
|
case "invalid_format":
|
|
if (a0.format === "starts_with") {
|
|
r69 = `Ugyldig streng: skal starte med "${a0.prefix}"`;
|
|
} else if (a0.format === "ends_with") {
|
|
r69 = `Ugyldig streng: skal ende med "${a0.suffix}"`;
|
|
} else if (a0.format === "includes") {
|
|
r69 = `Ugyldig streng: skal indeholde "${a0.includes}"`;
|
|
} else if (a0.format === "regex") {
|
|
r69 = `Ugyldig streng: skal matche mønsteret ${a0.pattern}`;
|
|
} else {
|
|
let r63 = c19524_1[a0.format];
|
|
if (r63 == null) {
|
|
r63 = a0.format;
|
|
}
|
|
r69 = `Ugyldig ${r63}`;
|
|
}
|
|
return r69;
|
|
case "not_multiple_of":
|
|
return `Ugyldigt tal: skal være deleligt med ${a0.divisor}`;
|
|
case "unrecognized_keys":
|
|
return `${a0.keys.length > 1 ? "Ukendte nøgler" : "Ukendt nøgle"}: ${c8328_2.joinValues(a0.keys, ", ")}`;
|
|
case "invalid_key":
|
|
return `Ugyldig nøgle i ${a0.origin}`;
|
|
case "invalid_union":
|
|
return "Ugyldigt input: matcher ingen af de tilladte typer";
|
|
case "invalid_element":
|
|
return `Ugyldig værdi i ${a0.origin}`;
|
|
default:
|
|
return "Ugyldigt input";
|
|
}
|
|
}
|
|
};
|
|
};
|
|
c8328_2 = r5(_mergeDefs);
|
|
error = () => {};
|
|
module.exports = exports.default;
|