182 lines
5.6 KiB
JavaScript
182 lines
5.6 KiB
JavaScript
// Metro module 12110 (f12111).
|
|
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 c8342_2, error;
|
|
let c8342_0 = r2;
|
|
let c8342_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)) {
|
|
c8342_0(r15, a0, key);
|
|
}
|
|
}
|
|
}
|
|
c8342_1(r15, a0);
|
|
return r15;
|
|
};
|
|
export default function default_1() {
|
|
let c19552_0 = {
|
|
string: {
|
|
unit: "caratteri",
|
|
verb: "avere"
|
|
},
|
|
file: {
|
|
unit: "byte",
|
|
verb: "avere"
|
|
},
|
|
array: {
|
|
unit: "elementi",
|
|
verb: "avere"
|
|
},
|
|
set: {
|
|
unit: "elementi",
|
|
verb: "avere"
|
|
}
|
|
};
|
|
let c19552_1 = {
|
|
regex: "input",
|
|
email: "indirizzo email",
|
|
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: "data e ora ISO",
|
|
date: "data ISO",
|
|
time: "ora ISO",
|
|
duration: "durata ISO",
|
|
ipv4: "indirizzo IPv4",
|
|
ipv6: "indirizzo IPv6",
|
|
cidrv4: "intervallo IPv4",
|
|
cidrv6: "intervallo IPv6",
|
|
base64: "stringa codificata in base64",
|
|
base64url: "URL codificata in base64",
|
|
json_string: "stringa JSON",
|
|
e164: "numero E.164",
|
|
jwt: "JWT",
|
|
template_literal: "input"
|
|
};
|
|
let c19552_2 = {
|
|
nan: "NaN",
|
|
number: "numero",
|
|
array: "vettore"
|
|
};
|
|
return {
|
|
localeError: (a0) => {
|
|
let r66, r132;
|
|
L58: {
|
|
switch (a0.code) {
|
|
case "invalid_type":
|
|
let r173 = c19552_2[a0.expected];
|
|
if (r173 == null) {
|
|
r173 = a0.expected;
|
|
}
|
|
const r179 = c8342_2.parsedType(a0.input);
|
|
let r180 = c19552_2[r179];
|
|
if (r180 == null) {
|
|
r180 = r179;
|
|
}
|
|
return /^[A-Z]/.test(a0.expected) ? `Input non valido: atteso instanceof ${a0.expected}, ricevuto ${r180}` : `Input non valido: atteso ${r173}, ricevuto ${r180}`;
|
|
case "invalid_value":
|
|
return a0.values.length === 1 ? `Input non valido: atteso ${c8342_2.stringifyPrimitive(a0.values[0])}` : `Opzione non valida: atteso uno tra ${c8342_2.joinValues(a0.values, "|")}`;
|
|
case "too_big":
|
|
const r115 = a0.inclusive ? "<=" : "<";
|
|
let r118 = c19552_0[a0.origin];
|
|
if (r118 == null) {
|
|
r118 = null;
|
|
}
|
|
let origin2 = a0.origin;
|
|
if (r118) {
|
|
if (origin2 == null) {
|
|
origin2 = "valore";
|
|
}
|
|
const r135 = a0.maximum.toString();
|
|
let unit = r118.unit;
|
|
if (unit == null) {
|
|
unit = "elementi";
|
|
}
|
|
r132 = `Troppo grande: ${origin2} deve avere ${r115}${r135} ${unit}`;
|
|
} else {
|
|
r132 = `Troppo grande: ${origin2 == null ? "valore" : origin2} deve essere ${r115}${a0.maximum.toString()}`;
|
|
}
|
|
return r132;
|
|
case "too_small":
|
|
const r12 = a0.inclusive ? ">=" : ">";
|
|
let r92 = c19552_0[a0.origin];
|
|
if (r92 == null) {
|
|
r92 = null;
|
|
}
|
|
const origin = a0.origin;
|
|
const r96 = a0.minimum.toString();
|
|
return r92 ? `Troppo piccolo: ${origin} deve avere ${r12}${r96} ${r92.unit}` : `Troppo piccolo: ${origin} deve essere ${r12}${r96}`;
|
|
case "invalid_format":
|
|
if (a0.format === "starts_with") {
|
|
r66 = `Stringa non valida: deve iniziare con "${a0.prefix}"`;
|
|
} else if (a0.format === "ends_with") {
|
|
r66 = `Stringa non valida: deve terminare con "${a0.suffix}"`;
|
|
} else if (a0.format === "includes") {
|
|
r66 = `Stringa non valida: deve includere "${a0.includes}"`;
|
|
} else if (a0.format === "regex") {
|
|
r66 = `Stringa non valida: deve corrispondere al pattern ${a0.pattern}`;
|
|
} else {
|
|
let r60 = c19552_1[a0.format];
|
|
if (r60 == null) {
|
|
r60 = a0.format;
|
|
}
|
|
r66 = `Invalid ${r60}`;
|
|
}
|
|
return r66;
|
|
case "not_multiple_of":
|
|
return `Numero non valido: deve essere un multiplo di ${a0.divisor}`;
|
|
case "unrecognized_keys":
|
|
return `Chiav${a0.keys.length > 1 ? "i" : "e"} non riconosciut${a0.keys.length > 1 ? "e" : "a"}: ${c8342_2.joinValues(a0.keys, ", ")}`;
|
|
case "invalid_key":
|
|
return `Chiave non valida in ${a0.origin}`;
|
|
case "invalid_union":
|
|
default:
|
|
break L58;
|
|
case "invalid_element":
|
|
return `Valore non valido in ${a0.origin}`;
|
|
}
|
|
}
|
|
return "Input non valido";
|
|
}
|
|
};
|
|
};
|
|
c8342_2 = r5(_mergeDefs);
|
|
error = () => {};
|
|
module.exports = exports.default;
|