180 lines
5.7 KiB
JavaScript
180 lines
5.7 KiB
JavaScript
// Metro module 12108 (f12109).
|
|
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 c8340_2, error;
|
|
let c8340_0 = r2;
|
|
let c8340_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)) {
|
|
c8340_0(r15, a0, key);
|
|
}
|
|
}
|
|
}
|
|
c8340_1(r15, a0);
|
|
return r15;
|
|
};
|
|
export default function default_1() {
|
|
let c19548_0 = {
|
|
string: {
|
|
unit: "karakter",
|
|
verb: "memiliki"
|
|
},
|
|
file: {
|
|
unit: "byte",
|
|
verb: "memiliki"
|
|
},
|
|
array: {
|
|
unit: "item",
|
|
verb: "memiliki"
|
|
},
|
|
set: {
|
|
unit: "item",
|
|
verb: "memiliki"
|
|
}
|
|
};
|
|
let c19548_1 = {
|
|
regex: "input",
|
|
email: "alamat 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: "tanggal dan waktu format ISO",
|
|
date: "tanggal format ISO",
|
|
time: "jam format ISO",
|
|
duration: "durasi format ISO",
|
|
ipv4: "alamat IPv4",
|
|
ipv6: "alamat IPv6",
|
|
cidrv4: "rentang alamat IPv4",
|
|
cidrv6: "rentang alamat IPv6",
|
|
base64: "string dengan enkode base64",
|
|
base64url: "string dengan enkode base64url",
|
|
json_string: "string JSON",
|
|
e164: "angka E.164",
|
|
jwt: "JWT",
|
|
template_literal: "input"
|
|
};
|
|
let c19548_2 = {
|
|
nan: "NaN"
|
|
};
|
|
return {
|
|
localeError: (a0) => {
|
|
let r66, r125;
|
|
L56: {
|
|
switch (a0.code) {
|
|
case "invalid_type":
|
|
let r166 = c19548_2[a0.expected];
|
|
if (r166 == null) {
|
|
r166 = a0.expected;
|
|
}
|
|
const r172 = c8340_2.parsedType(a0.input);
|
|
let r173 = c19548_2[r172];
|
|
if (r173 == null) {
|
|
r173 = r172;
|
|
}
|
|
return /^[A-Z]/.test(a0.expected) ? `Input tidak valid: diharapkan instanceof ${a0.expected}, diterima ${r173}` : `Input tidak valid: diharapkan ${r166}, diterima ${r173}`;
|
|
case "invalid_value":
|
|
return a0.values.length === 1 ? `Input tidak valid: diharapkan ${c8340_2.stringifyPrimitive(a0.values[0])}` : `Pilihan tidak valid: diharapkan salah satu dari ${c8340_2.joinValues(a0.values, "|")}`;
|
|
case "too_big":
|
|
const r109 = a0.inclusive ? "<=" : "<";
|
|
let r112 = c19548_0[a0.origin];
|
|
if (r112 == null) {
|
|
r112 = null;
|
|
}
|
|
let origin2 = a0.origin;
|
|
if (r112) {
|
|
if (origin2 == null) {
|
|
origin2 = "value";
|
|
}
|
|
const r128 = a0.maximum.toString();
|
|
let unit = r112.unit;
|
|
if (unit == null) {
|
|
unit = "elemen";
|
|
}
|
|
r125 = `Terlalu besar: diharapkan ${origin2} memiliki ${r109}${r128} ${unit}`;
|
|
} else {
|
|
r125 = `Terlalu besar: diharapkan ${origin2 == null ? "value" : origin2} menjadi ${r109}${a0.maximum.toString()}`;
|
|
}
|
|
return r125;
|
|
case "too_small":
|
|
const r12 = a0.inclusive ? ">=" : ">";
|
|
let r93 = c19548_0[a0.origin];
|
|
if (r93 == null) {
|
|
r93 = null;
|
|
}
|
|
const origin = a0.origin;
|
|
const r10 = a0.minimum.toString();
|
|
return r93 ? `Terlalu kecil: diharapkan ${origin} memiliki ${r12}${r10} ${r93.unit}` : `Terlalu kecil: diharapkan ${origin} menjadi ${r12}${r10}`;
|
|
case "invalid_format":
|
|
if (a0.format === "starts_with") {
|
|
r66 = `String tidak valid: harus dimulai dengan "${a0.prefix}"`;
|
|
} else if (a0.format === "ends_with") {
|
|
r66 = `String tidak valid: harus berakhir dengan "${a0.suffix}"`;
|
|
} else if (a0.format === "includes") {
|
|
r66 = `String tidak valid: harus menyertakan "${a0.includes}"`;
|
|
} else if (a0.format === "regex") {
|
|
r66 = `String tidak valid: harus sesuai pola ${a0.pattern}`;
|
|
} else {
|
|
let r59 = c19548_1[a0.format];
|
|
if (r59 == null) {
|
|
r59 = a0.format;
|
|
}
|
|
r66 = `${r59} tidak valid`;
|
|
}
|
|
return r66;
|
|
case "not_multiple_of":
|
|
return `Angka tidak valid: harus kelipatan dari ${a0.divisor}`;
|
|
case "unrecognized_keys":
|
|
return `Kunci tidak dikenali ${a0.keys.length > 1 ? "s" : ""}: ${c8340_2.joinValues(a0.keys, ", ")}`;
|
|
case "invalid_key":
|
|
return `Kunci tidak valid di ${a0.origin}`;
|
|
case "invalid_union":
|
|
default:
|
|
break L56;
|
|
case "invalid_element":
|
|
return `Nilai tidak valid di ${a0.origin}`;
|
|
}
|
|
}
|
|
return "Input tidak valid";
|
|
}
|
|
};
|
|
};
|
|
c8340_2 = r5(_mergeDefs);
|
|
error = () => {};
|
|
module.exports = exports.default;
|