@github/copilot-language-server 1.552.0 → 1.553.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +94 -1
- package/dist/main.js +1021 -1011
- package/dist/node_modules/@github/copilot-sdk/dist/cjs/cliVersion.js +1 -1
- package/dist/node_modules/@github/copilot-sdk/dist/cjs/client.js +499 -36
- package/dist/node_modules/@github/copilot-sdk/dist/cjs/copilotRequestHandler.js +156 -20
- package/dist/node_modules/@github/copilot-sdk/dist/cjs/extension.js +11 -9
- package/dist/node_modules/@github/copilot-sdk/dist/cjs/ffiRuntimeHost.js +14 -3
- package/dist/node_modules/@github/copilot-sdk/dist/cjs/generated/rpc.js +1305 -304
- package/dist/node_modules/@github/copilot-sdk/dist/cjs/host.js +67 -0
- package/dist/node_modules/@github/copilot-sdk/dist/cjs/index.js +12 -7
- package/dist/node_modules/@github/copilot-sdk/dist/cjs/installationConfirmation.js +98 -0
- package/dist/node_modules/@github/copilot-sdk/dist/cjs/runtimeArtifacts.js +1 -0
- package/dist/node_modules/@github/copilot-sdk/dist/cjs/schema.js +40 -0
- package/dist/node_modules/@github/copilot-sdk/dist/cjs/session.js +474 -151
- package/dist/node_modules/@github/copilot-sdk/dist/cjs/sessionFsProvider.js +57 -0
- package/dist/node_modules/@github/copilot-sdk/dist/cjs/types.js +5 -2
- package/dist/node_modules/@github/copilot-sdk/dist/cjs/{factory.js → workflow.js} +33 -33
- package/dist/node_modules/@github/copilot-sdk/package.json +27 -16
- package/dist/node_modules/zod/locales/package.json +1 -2
- package/dist/node_modules/zod/mini/package.json +1 -2
- package/dist/node_modules/zod/package.json +1 -1
- package/dist/node_modules/zod/v3/package.json +1 -2
- package/dist/node_modules/zod/v4/classic/errors.js +2 -2
- package/dist/node_modules/zod/v4/classic/from-json-schema.cjs +16 -31
- package/dist/node_modules/zod/v4/classic/from-json-schema.js +16 -31
- package/dist/node_modules/zod/v4/classic/package.json +1 -2
- package/dist/node_modules/zod/v4/classic/schemas.cjs +119 -358
- package/dist/node_modules/zod/v4/classic/schemas.js +118 -356
- package/dist/node_modules/zod/v4/core/api.cjs +2 -7
- package/dist/node_modules/zod/v4/core/api.js +2 -7
- package/dist/node_modules/zod/v4/core/core.cjs +1 -3
- package/dist/node_modules/zod/v4/core/core.js +2 -4
- package/dist/node_modules/zod/v4/core/errors.cjs +23 -26
- package/dist/node_modules/zod/v4/core/errors.js +23 -26
- package/dist/node_modules/zod/v4/core/json-schema-processors.cjs +20 -16
- package/dist/node_modules/zod/v4/core/json-schema-processors.js +20 -16
- package/dist/node_modules/zod/v4/core/package.json +1 -2
- package/dist/node_modules/zod/v4/core/parse.cjs +7 -7
- package/dist/node_modules/zod/v4/core/parse.js +7 -7
- package/dist/node_modules/zod/v4/core/regexes.cjs +3 -9
- package/dist/node_modules/zod/v4/core/regexes.js +1 -7
- package/dist/node_modules/zod/v4/core/schemas.cjs +65 -211
- package/dist/node_modules/zod/v4/core/schemas.js +64 -210
- package/dist/node_modules/zod/v4/core/to-json-schema.cjs +1 -12
- package/dist/node_modules/zod/v4/core/to-json-schema.js +1 -12
- package/dist/node_modules/zod/v4/core/util.cjs +30 -54
- package/dist/node_modules/zod/v4/core/util.js +32 -55
- package/dist/node_modules/zod/v4/core/versions.cjs +2 -2
- package/dist/node_modules/zod/v4/core/versions.js +2 -2
- package/dist/node_modules/zod/v4/locales/en.cjs +0 -4
- package/dist/node_modules/zod/v4/locales/en.js +0 -4
- package/dist/node_modules/zod/v4/locales/fr.cjs +7 -24
- package/dist/node_modules/zod/v4/locales/fr.js +7 -24
- package/dist/node_modules/zod/v4/locales/index.cjs +1 -8
- package/dist/node_modules/zod/v4/locales/index.js +0 -3
- package/dist/node_modules/zod/v4/locales/it.cjs +1 -1
- package/dist/node_modules/zod/v4/locales/it.js +1 -1
- package/dist/node_modules/zod/v4/locales/ka.cjs +8 -8
- package/dist/node_modules/zod/v4/locales/ka.js +8 -8
- package/dist/node_modules/zod/v4/locales/package.json +1 -2
- package/dist/node_modules/zod/v4/locales/uz.cjs +0 -1
- package/dist/node_modules/zod/v4/locales/uz.js +0 -1
- package/dist/node_modules/zod/v4/mini/package.json +1 -2
- package/dist/node_modules/zod/v4/mini/schemas.cjs +4 -41
- package/dist/node_modules/zod/v4/mini/schemas.js +4 -40
- package/dist/node_modules/zod/v4/package.json +1 -2
- package/dist/node_modules/zod/v4-mini/package.json +1 -2
- package/package.json +20 -20
- package/dist/node_modules/zod/v4/locales/el.cjs +0 -136
- package/dist/node_modules/zod/v4/locales/el.js +0 -109
- package/dist/node_modules/zod/v4/locales/hr.cjs +0 -149
- package/dist/node_modules/zod/v4/locales/hr.js +0 -122
- package/dist/node_modules/zod/v4/locales/ro.cjs +0 -146
- package/dist/node_modules/zod/v4/locales/ro.js +0 -119
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import * as util from "../core/util.js";
|
|
2
|
-
const error = () => {
|
|
3
|
-
const Sizable = {
|
|
4
|
-
string: { unit: "znakova", verb: "imati" },
|
|
5
|
-
file: { unit: "bajtova", verb: "imati" },
|
|
6
|
-
array: { unit: "stavki", verb: "imati" },
|
|
7
|
-
set: { unit: "stavki", verb: "imati" },
|
|
8
|
-
};
|
|
9
|
-
function getSizing(origin) {
|
|
10
|
-
return Sizable[origin] ?? null;
|
|
11
|
-
}
|
|
12
|
-
const FormatDictionary = {
|
|
13
|
-
regex: "unos",
|
|
14
|
-
email: "email adresa",
|
|
15
|
-
url: "URL",
|
|
16
|
-
emoji: "emoji",
|
|
17
|
-
uuid: "UUID",
|
|
18
|
-
uuidv4: "UUIDv4",
|
|
19
|
-
uuidv6: "UUIDv6",
|
|
20
|
-
nanoid: "nanoid",
|
|
21
|
-
guid: "GUID",
|
|
22
|
-
cuid: "cuid",
|
|
23
|
-
cuid2: "cuid2",
|
|
24
|
-
ulid: "ULID",
|
|
25
|
-
xid: "XID",
|
|
26
|
-
ksuid: "KSUID",
|
|
27
|
-
datetime: "ISO datum i vrijeme",
|
|
28
|
-
date: "ISO datum",
|
|
29
|
-
time: "ISO vrijeme",
|
|
30
|
-
duration: "ISO trajanje",
|
|
31
|
-
ipv4: "IPv4 adresa",
|
|
32
|
-
ipv6: "IPv6 adresa",
|
|
33
|
-
cidrv4: "IPv4 raspon",
|
|
34
|
-
cidrv6: "IPv6 raspon",
|
|
35
|
-
base64: "base64 kodirani tekst",
|
|
36
|
-
base64url: "base64url kodirani tekst",
|
|
37
|
-
json_string: "JSON tekst",
|
|
38
|
-
e164: "E.164 broj",
|
|
39
|
-
jwt: "JWT",
|
|
40
|
-
template_literal: "unos",
|
|
41
|
-
};
|
|
42
|
-
const TypeDictionary = {
|
|
43
|
-
nan: "NaN",
|
|
44
|
-
string: "tekst",
|
|
45
|
-
number: "broj",
|
|
46
|
-
boolean: "boolean",
|
|
47
|
-
array: "niz",
|
|
48
|
-
object: "objekt",
|
|
49
|
-
set: "skup",
|
|
50
|
-
file: "datoteka",
|
|
51
|
-
date: "datum",
|
|
52
|
-
bigint: "bigint",
|
|
53
|
-
symbol: "simbol",
|
|
54
|
-
undefined: "undefined",
|
|
55
|
-
null: "null",
|
|
56
|
-
function: "funkcija",
|
|
57
|
-
map: "mapa",
|
|
58
|
-
};
|
|
59
|
-
return (issue) => {
|
|
60
|
-
switch (issue.code) {
|
|
61
|
-
case "invalid_type": {
|
|
62
|
-
const expected = TypeDictionary[issue.expected] ?? issue.expected;
|
|
63
|
-
const receivedType = util.parsedType(issue.input);
|
|
64
|
-
const received = TypeDictionary[receivedType] ?? receivedType;
|
|
65
|
-
if (/^[A-Z]/.test(issue.expected)) {
|
|
66
|
-
return `Neispravan unos: očekuje se instanceof ${issue.expected}, a primljeno je ${received}`;
|
|
67
|
-
}
|
|
68
|
-
return `Neispravan unos: očekuje se ${expected}, a primljeno je ${received}`;
|
|
69
|
-
}
|
|
70
|
-
case "invalid_value":
|
|
71
|
-
if (issue.values.length === 1)
|
|
72
|
-
return `Neispravna vrijednost: očekivano ${util.stringifyPrimitive(issue.values[0])}`;
|
|
73
|
-
return `Neispravna opcija: očekivano jedno od ${util.joinValues(issue.values, "|")}`;
|
|
74
|
-
case "too_big": {
|
|
75
|
-
const adj = issue.inclusive ? "<=" : "<";
|
|
76
|
-
const sizing = getSizing(issue.origin);
|
|
77
|
-
const origin = TypeDictionary[issue.origin] ?? issue.origin;
|
|
78
|
-
if (sizing)
|
|
79
|
-
return `Preveliko: očekivano da ${origin ?? "vrijednost"} ima ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elemenata"}`;
|
|
80
|
-
return `Preveliko: očekivano da ${origin ?? "vrijednost"} bude ${adj}${issue.maximum.toString()}`;
|
|
81
|
-
}
|
|
82
|
-
case "too_small": {
|
|
83
|
-
const adj = issue.inclusive ? ">=" : ">";
|
|
84
|
-
const sizing = getSizing(issue.origin);
|
|
85
|
-
const origin = TypeDictionary[issue.origin] ?? issue.origin;
|
|
86
|
-
if (sizing) {
|
|
87
|
-
return `Premalo: očekivano da ${origin} ima ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
|
88
|
-
}
|
|
89
|
-
return `Premalo: očekivano da ${origin} bude ${adj}${issue.minimum.toString()}`;
|
|
90
|
-
}
|
|
91
|
-
case "invalid_format": {
|
|
92
|
-
const _issue = issue;
|
|
93
|
-
if (_issue.format === "starts_with")
|
|
94
|
-
return `Neispravan tekst: mora započinjati s "${_issue.prefix}"`;
|
|
95
|
-
if (_issue.format === "ends_with")
|
|
96
|
-
return `Neispravan tekst: mora završavati s "${_issue.suffix}"`;
|
|
97
|
-
if (_issue.format === "includes")
|
|
98
|
-
return `Neispravan tekst: mora sadržavati "${_issue.includes}"`;
|
|
99
|
-
if (_issue.format === "regex")
|
|
100
|
-
return `Neispravan tekst: mora odgovarati uzorku ${_issue.pattern}`;
|
|
101
|
-
return `Neispravna ${FormatDictionary[_issue.format] ?? issue.format}`;
|
|
102
|
-
}
|
|
103
|
-
case "not_multiple_of":
|
|
104
|
-
return `Neispravan broj: mora biti višekratnik od ${issue.divisor}`;
|
|
105
|
-
case "unrecognized_keys":
|
|
106
|
-
return `Neprepoznat${issue.keys.length > 1 ? "i ključevi" : " ključ"}: ${util.joinValues(issue.keys, ", ")}`;
|
|
107
|
-
case "invalid_key":
|
|
108
|
-
return `Neispravan ključ u ${TypeDictionary[issue.origin] ?? issue.origin}`;
|
|
109
|
-
case "invalid_union":
|
|
110
|
-
return "Neispravan unos";
|
|
111
|
-
case "invalid_element":
|
|
112
|
-
return `Neispravna vrijednost u ${TypeDictionary[issue.origin] ?? issue.origin}`;
|
|
113
|
-
default:
|
|
114
|
-
return `Neispravan unos`;
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
};
|
|
118
|
-
export default function () {
|
|
119
|
-
return {
|
|
120
|
-
localeError: error(),
|
|
121
|
-
};
|
|
122
|
-
}
|
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
-
exports.default = default_1;
|
|
27
|
-
const util = __importStar(require("../core/util.cjs"));
|
|
28
|
-
const error = () => {
|
|
29
|
-
const Sizable = {
|
|
30
|
-
string: { unit: "caractere", verb: "să aibă" },
|
|
31
|
-
file: { unit: "octeți", verb: "să aibă" },
|
|
32
|
-
array: { unit: "elemente", verb: "să aibă" },
|
|
33
|
-
set: { unit: "elemente", verb: "să aibă" },
|
|
34
|
-
map: { unit: "intrări", verb: "să aibă" },
|
|
35
|
-
};
|
|
36
|
-
function getSizing(origin) {
|
|
37
|
-
return Sizable[origin] ?? null;
|
|
38
|
-
}
|
|
39
|
-
const FormatDictionary = {
|
|
40
|
-
regex: "intrare",
|
|
41
|
-
email: "adresă de email",
|
|
42
|
-
url: "URL",
|
|
43
|
-
emoji: "emoji",
|
|
44
|
-
uuid: "UUID",
|
|
45
|
-
uuidv4: "UUIDv4",
|
|
46
|
-
uuidv6: "UUIDv6",
|
|
47
|
-
nanoid: "nanoid",
|
|
48
|
-
guid: "GUID",
|
|
49
|
-
cuid: "cuid",
|
|
50
|
-
cuid2: "cuid2",
|
|
51
|
-
ulid: "ULID",
|
|
52
|
-
xid: "XID",
|
|
53
|
-
ksuid: "KSUID",
|
|
54
|
-
datetime: "dată și oră ISO",
|
|
55
|
-
date: "dată ISO",
|
|
56
|
-
time: "oră ISO",
|
|
57
|
-
duration: "durată ISO",
|
|
58
|
-
ipv4: "adresă IPv4",
|
|
59
|
-
ipv6: "adresă IPv6",
|
|
60
|
-
mac: "adresă MAC",
|
|
61
|
-
cidrv4: "interval IPv4",
|
|
62
|
-
cidrv6: "interval IPv6",
|
|
63
|
-
base64: "șir codat base64",
|
|
64
|
-
base64url: "șir codat base64url",
|
|
65
|
-
json_string: "șir JSON",
|
|
66
|
-
e164: "număr E.164",
|
|
67
|
-
jwt: "JWT",
|
|
68
|
-
template_literal: "intrare",
|
|
69
|
-
};
|
|
70
|
-
const TypeDictionary = {
|
|
71
|
-
nan: "NaN",
|
|
72
|
-
string: "șir",
|
|
73
|
-
number: "număr",
|
|
74
|
-
boolean: "boolean",
|
|
75
|
-
function: "funcție",
|
|
76
|
-
array: "matrice",
|
|
77
|
-
object: "obiect",
|
|
78
|
-
undefined: "nedefinit",
|
|
79
|
-
symbol: "simbol",
|
|
80
|
-
bigint: "număr mare",
|
|
81
|
-
void: "void",
|
|
82
|
-
never: "never",
|
|
83
|
-
map: "hartă",
|
|
84
|
-
set: "set",
|
|
85
|
-
};
|
|
86
|
-
return (issue) => {
|
|
87
|
-
switch (issue.code) {
|
|
88
|
-
case "invalid_type": {
|
|
89
|
-
const expected = TypeDictionary[issue.expected] ?? issue.expected;
|
|
90
|
-
const receivedType = util.parsedType(issue.input);
|
|
91
|
-
const received = TypeDictionary[receivedType] ?? receivedType;
|
|
92
|
-
return `Intrare invalidă: așteptat ${expected}, primit ${received}`;
|
|
93
|
-
}
|
|
94
|
-
case "invalid_value":
|
|
95
|
-
if (issue.values.length === 1)
|
|
96
|
-
return `Intrare invalidă: așteptat ${util.stringifyPrimitive(issue.values[0])}`;
|
|
97
|
-
return `Opțiune invalidă: așteptat una dintre ${util.joinValues(issue.values, "|")}`;
|
|
98
|
-
case "too_big": {
|
|
99
|
-
const adj = issue.inclusive ? "<=" : "<";
|
|
100
|
-
const sizing = getSizing(issue.origin);
|
|
101
|
-
if (sizing)
|
|
102
|
-
return `Prea mare: așteptat ca ${issue.origin ?? "valoarea"} ${sizing.verb} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elemente"}`;
|
|
103
|
-
return `Prea mare: așteptat ca ${issue.origin ?? "valoarea"} să fie ${adj}${issue.maximum.toString()}`;
|
|
104
|
-
}
|
|
105
|
-
case "too_small": {
|
|
106
|
-
const adj = issue.inclusive ? ">=" : ">";
|
|
107
|
-
const sizing = getSizing(issue.origin);
|
|
108
|
-
if (sizing) {
|
|
109
|
-
return `Prea mic: așteptat ca ${issue.origin} ${sizing.verb} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
|
110
|
-
}
|
|
111
|
-
return `Prea mic: așteptat ca ${issue.origin} să fie ${adj}${issue.minimum.toString()}`;
|
|
112
|
-
}
|
|
113
|
-
case "invalid_format": {
|
|
114
|
-
const _issue = issue;
|
|
115
|
-
if (_issue.format === "starts_with") {
|
|
116
|
-
return `Șir invalid: trebuie să înceapă cu "${_issue.prefix}"`;
|
|
117
|
-
}
|
|
118
|
-
if (_issue.format === "ends_with")
|
|
119
|
-
return `Șir invalid: trebuie să se termine cu "${_issue.suffix}"`;
|
|
120
|
-
if (_issue.format === "includes")
|
|
121
|
-
return `Șir invalid: trebuie să includă "${_issue.includes}"`;
|
|
122
|
-
if (_issue.format === "regex")
|
|
123
|
-
return `Șir invalid: trebuie să se potrivească cu modelul ${_issue.pattern}`;
|
|
124
|
-
return `Format invalid: ${FormatDictionary[_issue.format] ?? issue.format}`;
|
|
125
|
-
}
|
|
126
|
-
case "not_multiple_of":
|
|
127
|
-
return `Număr invalid: trebuie să fie multiplu de ${issue.divisor}`;
|
|
128
|
-
case "unrecognized_keys":
|
|
129
|
-
return `Chei nerecunoscute: ${util.joinValues(issue.keys, ", ")}`;
|
|
130
|
-
case "invalid_key":
|
|
131
|
-
return `Cheie invalidă în ${issue.origin}`;
|
|
132
|
-
case "invalid_union":
|
|
133
|
-
return "Intrare invalidă";
|
|
134
|
-
case "invalid_element":
|
|
135
|
-
return `Valoare invalidă în ${issue.origin}`;
|
|
136
|
-
default:
|
|
137
|
-
return `Intrare invalidă`;
|
|
138
|
-
}
|
|
139
|
-
};
|
|
140
|
-
};
|
|
141
|
-
function default_1() {
|
|
142
|
-
return {
|
|
143
|
-
localeError: error(),
|
|
144
|
-
};
|
|
145
|
-
}
|
|
146
|
-
module.exports = exports.default;
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import * as util from "../core/util.js";
|
|
2
|
-
const error = () => {
|
|
3
|
-
const Sizable = {
|
|
4
|
-
string: { unit: "caractere", verb: "să aibă" },
|
|
5
|
-
file: { unit: "octeți", verb: "să aibă" },
|
|
6
|
-
array: { unit: "elemente", verb: "să aibă" },
|
|
7
|
-
set: { unit: "elemente", verb: "să aibă" },
|
|
8
|
-
map: { unit: "intrări", verb: "să aibă" },
|
|
9
|
-
};
|
|
10
|
-
function getSizing(origin) {
|
|
11
|
-
return Sizable[origin] ?? null;
|
|
12
|
-
}
|
|
13
|
-
const FormatDictionary = {
|
|
14
|
-
regex: "intrare",
|
|
15
|
-
email: "adresă de email",
|
|
16
|
-
url: "URL",
|
|
17
|
-
emoji: "emoji",
|
|
18
|
-
uuid: "UUID",
|
|
19
|
-
uuidv4: "UUIDv4",
|
|
20
|
-
uuidv6: "UUIDv6",
|
|
21
|
-
nanoid: "nanoid",
|
|
22
|
-
guid: "GUID",
|
|
23
|
-
cuid: "cuid",
|
|
24
|
-
cuid2: "cuid2",
|
|
25
|
-
ulid: "ULID",
|
|
26
|
-
xid: "XID",
|
|
27
|
-
ksuid: "KSUID",
|
|
28
|
-
datetime: "dată și oră ISO",
|
|
29
|
-
date: "dată ISO",
|
|
30
|
-
time: "oră ISO",
|
|
31
|
-
duration: "durată ISO",
|
|
32
|
-
ipv4: "adresă IPv4",
|
|
33
|
-
ipv6: "adresă IPv6",
|
|
34
|
-
mac: "adresă MAC",
|
|
35
|
-
cidrv4: "interval IPv4",
|
|
36
|
-
cidrv6: "interval IPv6",
|
|
37
|
-
base64: "șir codat base64",
|
|
38
|
-
base64url: "șir codat base64url",
|
|
39
|
-
json_string: "șir JSON",
|
|
40
|
-
e164: "număr E.164",
|
|
41
|
-
jwt: "JWT",
|
|
42
|
-
template_literal: "intrare",
|
|
43
|
-
};
|
|
44
|
-
const TypeDictionary = {
|
|
45
|
-
nan: "NaN",
|
|
46
|
-
string: "șir",
|
|
47
|
-
number: "număr",
|
|
48
|
-
boolean: "boolean",
|
|
49
|
-
function: "funcție",
|
|
50
|
-
array: "matrice",
|
|
51
|
-
object: "obiect",
|
|
52
|
-
undefined: "nedefinit",
|
|
53
|
-
symbol: "simbol",
|
|
54
|
-
bigint: "număr mare",
|
|
55
|
-
void: "void",
|
|
56
|
-
never: "never",
|
|
57
|
-
map: "hartă",
|
|
58
|
-
set: "set",
|
|
59
|
-
};
|
|
60
|
-
return (issue) => {
|
|
61
|
-
switch (issue.code) {
|
|
62
|
-
case "invalid_type": {
|
|
63
|
-
const expected = TypeDictionary[issue.expected] ?? issue.expected;
|
|
64
|
-
const receivedType = util.parsedType(issue.input);
|
|
65
|
-
const received = TypeDictionary[receivedType] ?? receivedType;
|
|
66
|
-
return `Intrare invalidă: așteptat ${expected}, primit ${received}`;
|
|
67
|
-
}
|
|
68
|
-
case "invalid_value":
|
|
69
|
-
if (issue.values.length === 1)
|
|
70
|
-
return `Intrare invalidă: așteptat ${util.stringifyPrimitive(issue.values[0])}`;
|
|
71
|
-
return `Opțiune invalidă: așteptat una dintre ${util.joinValues(issue.values, "|")}`;
|
|
72
|
-
case "too_big": {
|
|
73
|
-
const adj = issue.inclusive ? "<=" : "<";
|
|
74
|
-
const sizing = getSizing(issue.origin);
|
|
75
|
-
if (sizing)
|
|
76
|
-
return `Prea mare: așteptat ca ${issue.origin ?? "valoarea"} ${sizing.verb} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elemente"}`;
|
|
77
|
-
return `Prea mare: așteptat ca ${issue.origin ?? "valoarea"} să fie ${adj}${issue.maximum.toString()}`;
|
|
78
|
-
}
|
|
79
|
-
case "too_small": {
|
|
80
|
-
const adj = issue.inclusive ? ">=" : ">";
|
|
81
|
-
const sizing = getSizing(issue.origin);
|
|
82
|
-
if (sizing) {
|
|
83
|
-
return `Prea mic: așteptat ca ${issue.origin} ${sizing.verb} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
|
|
84
|
-
}
|
|
85
|
-
return `Prea mic: așteptat ca ${issue.origin} să fie ${adj}${issue.minimum.toString()}`;
|
|
86
|
-
}
|
|
87
|
-
case "invalid_format": {
|
|
88
|
-
const _issue = issue;
|
|
89
|
-
if (_issue.format === "starts_with") {
|
|
90
|
-
return `Șir invalid: trebuie să înceapă cu "${_issue.prefix}"`;
|
|
91
|
-
}
|
|
92
|
-
if (_issue.format === "ends_with")
|
|
93
|
-
return `Șir invalid: trebuie să se termine cu "${_issue.suffix}"`;
|
|
94
|
-
if (_issue.format === "includes")
|
|
95
|
-
return `Șir invalid: trebuie să includă "${_issue.includes}"`;
|
|
96
|
-
if (_issue.format === "regex")
|
|
97
|
-
return `Șir invalid: trebuie să se potrivească cu modelul ${_issue.pattern}`;
|
|
98
|
-
return `Format invalid: ${FormatDictionary[_issue.format] ?? issue.format}`;
|
|
99
|
-
}
|
|
100
|
-
case "not_multiple_of":
|
|
101
|
-
return `Număr invalid: trebuie să fie multiplu de ${issue.divisor}`;
|
|
102
|
-
case "unrecognized_keys":
|
|
103
|
-
return `Chei nerecunoscute: ${util.joinValues(issue.keys, ", ")}`;
|
|
104
|
-
case "invalid_key":
|
|
105
|
-
return `Cheie invalidă în ${issue.origin}`;
|
|
106
|
-
case "invalid_union":
|
|
107
|
-
return "Intrare invalidă";
|
|
108
|
-
case "invalid_element":
|
|
109
|
-
return `Valoare invalidă în ${issue.origin}`;
|
|
110
|
-
default:
|
|
111
|
-
return `Intrare invalidă`;
|
|
112
|
-
}
|
|
113
|
-
};
|
|
114
|
-
};
|
|
115
|
-
export default function () {
|
|
116
|
-
return {
|
|
117
|
-
localeError: error(),
|
|
118
|
-
};
|
|
119
|
-
}
|