197 lines
6.1 KiB
JavaScript
197 lines
6.1 KiB
JavaScript
// Metro module 12127 (f12128).
|
|
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 c8359_2, error;
|
|
let c8359_0 = r2;
|
|
let c8359_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)) {
|
|
c8359_0(r15, a0, key);
|
|
}
|
|
}
|
|
}
|
|
c8359_1(r15, a0);
|
|
return r15;
|
|
};
|
|
export default function default_1() {
|
|
let c19584_0 = {
|
|
string: {
|
|
unit: "tecken",
|
|
verb: "att ha"
|
|
},
|
|
file: {
|
|
unit: "bytes",
|
|
verb: "att ha"
|
|
},
|
|
array: {
|
|
unit: "objekt",
|
|
verb: "att innehålla"
|
|
},
|
|
set: {
|
|
unit: "objekt",
|
|
verb: "att innehålla"
|
|
}
|
|
};
|
|
let c19584_1 = {
|
|
regex: "reguljärt uttryck",
|
|
email: "e-postadress",
|
|
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-datum och tid",
|
|
date: "ISO-datum",
|
|
time: "ISO-tid",
|
|
duration: "ISO-varaktighet",
|
|
ipv4: "IPv4-intervall",
|
|
ipv6: "IPv6-intervall",
|
|
cidrv4: "IPv4-spektrum",
|
|
cidrv6: "IPv6-spektrum",
|
|
base64: "base64-kodad sträng",
|
|
base64url: "base64url-kodad sträng",
|
|
json_string: "JSON-sträng",
|
|
e164: "E.164-nummer",
|
|
jwt: "JWT",
|
|
template_literal: "mall-literal"
|
|
};
|
|
let c19584_2 = {
|
|
nan: "NaN",
|
|
number: "antal",
|
|
array: "lista"
|
|
};
|
|
return {
|
|
localeError: (a0) => {
|
|
let r67, r102, r131;
|
|
L64: {
|
|
switch (a0.code) {
|
|
case "invalid_type":
|
|
let r171 = c19584_2[a0.expected];
|
|
if (r171 == null) {
|
|
r171 = a0.expected;
|
|
}
|
|
const r177 = c8359_2.parsedType(a0.input);
|
|
let r178 = c19584_2[r177];
|
|
if (r178 == null) {
|
|
r178 = r177;
|
|
}
|
|
return /^[A-Z]/.test(a0.expected) ? `Ogiltig inmatning: förväntat instanceof ${a0.expected}, fick ${r178}` : `Ogiltig inmatning: förväntat ${r171}, fick ${r178}`;
|
|
case "invalid_value":
|
|
return a0.values.length === 1 ? `Ogiltig inmatning: förväntat ${c8359_2.stringifyPrimitive(a0.values[0])}` : `Ogiltigt val: förväntade en av ${c8359_2.joinValues(a0.values, "|")}`;
|
|
case "too_big":
|
|
const r114 = a0.inclusive ? "<=" : "<";
|
|
let r117 = c19584_0[a0.origin];
|
|
if (r117 == null) {
|
|
r117 = null;
|
|
}
|
|
let origin4 = a0.origin;
|
|
if (r117) {
|
|
if (origin4 == null) {
|
|
origin4 = "värdet";
|
|
}
|
|
const r10 = a0.maximum.toString();
|
|
let unit = r117.unit;
|
|
if (unit == null) {
|
|
unit = "element";
|
|
}
|
|
r131 = `För stor(t): förväntade ${origin4} att ha ${r114}${r10} ${unit}`;
|
|
} else {
|
|
r131 = `För stor(t): förväntat ${origin4 == null ? "värdet" : origin4} att ha ${r114}${a0.maximum.toString()}`;
|
|
}
|
|
return r131;
|
|
case "too_small":
|
|
const r12 = a0.inclusive ? ">=" : ">";
|
|
let r95 = c19584_0[a0.origin];
|
|
if (r95 == null) {
|
|
r95 = null;
|
|
}
|
|
let origin2 = a0.origin;
|
|
if (r95) {
|
|
if (origin2 == null) {
|
|
origin2 = "värdet";
|
|
}
|
|
r102 = `För lite(t): förväntade ${origin2} att ha ${r12}${a0.minimum.toString()} ${r95.unit}`;
|
|
} else {
|
|
r102 = `För lite(t): förväntade ${origin2 == null ? "värdet" : origin2} att ha ${r12}${a0.minimum.toString()}`;
|
|
}
|
|
return r102;
|
|
case "invalid_format":
|
|
if (a0.format === "starts_with") {
|
|
r67 = `Ogiltig sträng: måste börja med "${a0.prefix}"`;
|
|
} else if (a0.format === "ends_with") {
|
|
r67 = `Ogiltig sträng: måste sluta med "${a0.suffix}"`;
|
|
} else if (a0.format === "includes") {
|
|
r67 = `Ogiltig sträng: måste innehålla "${a0.includes}"`;
|
|
} else if (a0.format === "regex") {
|
|
r67 = `Ogiltig sträng: måste matcha mönstret "${a0.pattern}"`;
|
|
} else {
|
|
let r61 = c19584_1[a0.format];
|
|
if (r61 == null) {
|
|
r61 = a0.format;
|
|
}
|
|
r67 = `Ogiltig(t) ${r61}`;
|
|
}
|
|
return r67;
|
|
case "not_multiple_of":
|
|
return `Ogiltigt tal: måste vara en multipel av ${a0.divisor}`;
|
|
case "unrecognized_keys":
|
|
return `${a0.keys.length > 1 ? "Okända nycklar" : "Okänd nyckel"}: ${c8359_2.joinValues(a0.keys, ", ")}`;
|
|
case "invalid_key":
|
|
let origin3 = a0.origin;
|
|
if (origin3 == null) {
|
|
origin3 = "värdet";
|
|
}
|
|
return `Ogiltig nyckel i ${origin3}`;
|
|
case "invalid_union":
|
|
default:
|
|
break L64;
|
|
case "invalid_element":
|
|
let origin = a0.origin;
|
|
if (origin == null) {
|
|
origin = "värdet";
|
|
}
|
|
return `Ogiltigt värde i ${origin}`;
|
|
}
|
|
}
|
|
return "Ogiltig input";
|
|
}
|
|
};
|
|
};
|
|
c8359_2 = r5(_mergeDefs);
|
|
error = () => {};
|
|
module.exports = exports.default;
|