188 lines
5.8 KiB
JavaScript
188 lines
5.8 KiB
JavaScript
// Metro module 12103 (f12104).
|
|
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 c8335_2, error;
|
|
let c8335_0 = r2;
|
|
let c8335_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)) {
|
|
c8335_0(r15, a0, key);
|
|
}
|
|
}
|
|
}
|
|
c8335_1(r15, a0);
|
|
return r15;
|
|
};
|
|
export default function default_1() {
|
|
let c19538_0 = {
|
|
string: {
|
|
unit: "caractères",
|
|
verb: "avoir"
|
|
},
|
|
file: {
|
|
unit: "octets",
|
|
verb: "avoir"
|
|
},
|
|
array: {
|
|
unit: "éléments",
|
|
verb: "avoir"
|
|
},
|
|
set: {
|
|
unit: "éléments",
|
|
verb: "avoir"
|
|
}
|
|
};
|
|
let c19538_1 = {
|
|
regex: "entrée",
|
|
email: "adresse e-mail",
|
|
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: "date et heure ISO",
|
|
date: "date ISO",
|
|
time: "heure ISO",
|
|
duration: "durée ISO",
|
|
ipv4: "adresse IPv4",
|
|
ipv6: "adresse IPv6",
|
|
cidrv4: "plage IPv4",
|
|
cidrv6: "plage IPv6",
|
|
base64: "chaîne encodée en base64",
|
|
base64url: "chaîne encodée en base64url",
|
|
json_string: "chaîne JSON",
|
|
e164: "numéro E.164",
|
|
jwt: "JWT",
|
|
template_literal: "entrée"
|
|
};
|
|
let c19538_2 = {
|
|
nan: "NaN",
|
|
number: "nombre",
|
|
array: "tableau"
|
|
};
|
|
return {
|
|
localeError: (a0) => {
|
|
let r69, r138;
|
|
L58: {
|
|
switch (a0.code) {
|
|
case "invalid_type":
|
|
let r184 = c19538_2[a0.expected];
|
|
if (r184 == null) {
|
|
r184 = a0.expected;
|
|
}
|
|
const r190 = c8335_2.parsedType(a0.input);
|
|
let r191 = c19538_2[r190];
|
|
if (r191 == null) {
|
|
r191 = r190;
|
|
}
|
|
return /^[A-Z]/.test(a0.expected) ? `Entrée invalide : instanceof ${a0.expected} attendu, ${r191} reçu` : `Entrée invalide : ${r184} attendu, ${r191} reçu`;
|
|
case "invalid_value":
|
|
return a0.values.length === 1 ? `Entrée invalide : ${c8335_2.stringifyPrimitive(a0.values[0])} attendu` : `Option invalide : une valeur parmi ${c8335_2.joinValues(a0.values, "|")} attendue`;
|
|
case "too_big":
|
|
const r121 = a0.inclusive ? "<=" : "<";
|
|
let r124 = c19538_0[a0.origin];
|
|
if (r124 == null) {
|
|
r124 = null;
|
|
}
|
|
let origin2 = a0.origin;
|
|
if (r124) {
|
|
if (origin2 == null) {
|
|
origin2 = "valeur";
|
|
}
|
|
const verb = r124.verb;
|
|
const r141 = a0.maximum.toString();
|
|
let unit = r124.unit;
|
|
if (unit == null) {
|
|
unit = "élément(s)";
|
|
}
|
|
r138 = `Trop grand : ${origin2} doit ${verb} ${r121}${r141} ${unit}`;
|
|
} else {
|
|
r138 = `Trop grand : ${origin2 == null ? "valeur" : origin2} doit être ${r121}${a0.maximum.toString()}`;
|
|
}
|
|
return r138;
|
|
case "too_small":
|
|
const r13 = a0.inclusive ? ">=" : ">";
|
|
let r95 = c19538_0[a0.origin];
|
|
if (r95 == null) {
|
|
r95 = null;
|
|
}
|
|
const origin = a0.origin;
|
|
return r95 ? `Trop petit : ${origin} doit ${r95.verb} ${r13}${a0.minimum.toString()} ${r95.unit}` : `Trop petit : ${origin} doit être ${r13}${a0.minimum.toString()}`;
|
|
case "invalid_format":
|
|
if (a0.format === "starts_with") {
|
|
r69 = `Chaîne invalide : doit commencer par "${a0.prefix}"`;
|
|
} else if (a0.format === "ends_with") {
|
|
r69 = `Chaîne invalide : doit se terminer par "${a0.suffix}"`;
|
|
} else if (a0.format === "includes") {
|
|
r69 = `Chaîne invalide : doit inclure "${a0.includes}"`;
|
|
} else if (a0.format === "regex") {
|
|
r69 = `Chaîne invalide : doit correspondre au modèle ${a0.pattern}`;
|
|
} else {
|
|
let r62 = c19538_1[a0.format];
|
|
if (r62 == null) {
|
|
r62 = a0.format;
|
|
}
|
|
r69 = `${r62} invalide`;
|
|
}
|
|
return r69;
|
|
case "not_multiple_of":
|
|
return `Nombre invalide : doit être un multiple de ${a0.divisor}`;
|
|
case "unrecognized_keys":
|
|
const r1 = a0.keys.length > 1;
|
|
let r10 = "";
|
|
const r9 = r1 ? "s" : "";
|
|
if (a0.keys.length > 1) {
|
|
r10 = "s";
|
|
}
|
|
return `Clé${r9} non reconnue${r10} : ${c8335_2.joinValues(a0.keys, ", ")}`;
|
|
case "invalid_key":
|
|
return `Clé invalide dans ${a0.origin}`;
|
|
case "invalid_union":
|
|
default:
|
|
break L58;
|
|
case "invalid_element":
|
|
return `Valeur invalide dans ${a0.origin}`;
|
|
}
|
|
}
|
|
return "Entrée invalide";
|
|
}
|
|
};
|
|
};
|
|
c8335_2 = r5(_mergeDefs);
|
|
error = () => {};
|
|
module.exports = exports.default;
|