lkd-web-kit 0.4.7 → 0.4.9

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.
Files changed (138) hide show
  1. package/dist/components/EmptyState/index.cjs +24 -12
  2. package/dist/components/EmptyState/index.js +24 -12
  3. package/dist/components/Icon.cjs +2 -3
  4. package/dist/components/Icon.js +2 -3
  5. package/dist/components/SelectInfinity/index.cjs +7 -4
  6. package/dist/components/SelectInfinity/index.js +7 -4
  7. package/dist/hooks/useZodConfig.cjs +2 -2
  8. package/dist/hooks/useZodConfig.js +2 -2
  9. package/dist/index.d.ts +4 -4
  10. package/package.json +7 -7
  11. package/dist/node_modules/zod/v4/classic/coerce.cjs +0 -28
  12. package/dist/node_modules/zod/v4/classic/coerce.js +0 -20
  13. package/dist/node_modules/zod/v4/classic/compat.cjs +0 -37
  14. package/dist/node_modules/zod/v4/classic/compat.js +0 -30
  15. package/dist/node_modules/zod/v4/classic/errors.cjs +0 -49
  16. package/dist/node_modules/zod/v4/classic/errors.js +0 -44
  17. package/dist/node_modules/zod/v4/classic/external.cjs +0 -231
  18. package/dist/node_modules/zod/v4/classic/external.js +0 -28
  19. package/dist/node_modules/zod/v4/classic/index.cjs +0 -10
  20. package/dist/node_modules/zod/v4/classic/index.js +0 -5
  21. package/dist/node_modules/zod/v4/classic/iso.cjs +0 -46
  22. package/dist/node_modules/zod/v4/classic/iso.js +0 -35
  23. package/dist/node_modules/zod/v4/classic/parse.cjs +0 -16
  24. package/dist/node_modules/zod/v4/classic/parse.js +0 -9
  25. package/dist/node_modules/zod/v4/classic/schemas.cjs +0 -1155
  26. package/dist/node_modules/zod/v4/classic/schemas.js +0 -1006
  27. package/dist/node_modules/zod/v4/core/api.cjs +0 -1016
  28. package/dist/node_modules/zod/v4/core/api.js +0 -903
  29. package/dist/node_modules/zod/v4/core/checks.cjs +0 -587
  30. package/dist/node_modules/zod/v4/core/checks.js +0 -562
  31. package/dist/node_modules/zod/v4/core/core.cjs +0 -72
  32. package/dist/node_modules/zod/v4/core/core.js +0 -63
  33. package/dist/node_modules/zod/v4/core/doc.cjs +0 -41
  34. package/dist/node_modules/zod/v4/core/doc.js +0 -37
  35. package/dist/node_modules/zod/v4/core/errors.cjs +0 -204
  36. package/dist/node_modules/zod/v4/core/errors.js +0 -194
  37. package/dist/node_modules/zod/v4/core/function.cjs +0 -81
  38. package/dist/node_modules/zod/v4/core/function.js +0 -76
  39. package/dist/node_modules/zod/v4/core/index.cjs +0 -261
  40. package/dist/node_modules/zod/v4/core/index.js +0 -20
  41. package/dist/node_modules/zod/v4/core/json-schema.cjs +0 -2
  42. package/dist/node_modules/zod/v4/core/json-schema.js +0 -1
  43. package/dist/node_modules/zod/v4/core/parse.cjs +0 -71
  44. package/dist/node_modules/zod/v4/core/parse.js +0 -60
  45. package/dist/node_modules/zod/v4/core/regexes.cjs +0 -139
  46. package/dist/node_modules/zod/v4/core/regexes.js +0 -95
  47. package/dist/node_modules/zod/v4/core/registries.cjs +0 -52
  48. package/dist/node_modules/zod/v4/core/registries.js +0 -44
  49. package/dist/node_modules/zod/v4/core/schemas.cjs +0 -1793
  50. package/dist/node_modules/zod/v4/core/schemas.js +0 -1720
  51. package/dist/node_modules/zod/v4/core/to-json-schema.cjs +0 -823
  52. package/dist/node_modules/zod/v4/core/to-json-schema.js +0 -818
  53. package/dist/node_modules/zod/v4/core/util.cjs +0 -543
  54. package/dist/node_modules/zod/v4/core/util.js +0 -491
  55. package/dist/node_modules/zod/v4/core/versions.cjs +0 -11
  56. package/dist/node_modules/zod/v4/core/versions.js +0 -7
  57. package/dist/node_modules/zod/v4/index.cjs +0 -10
  58. package/dist/node_modules/zod/v4/index.js +0 -5
  59. package/dist/node_modules/zod/v4/locales/ar.cjs +0 -121
  60. package/dist/node_modules/zod/v4/locales/ar.js +0 -119
  61. package/dist/node_modules/zod/v4/locales/az.cjs +0 -120
  62. package/dist/node_modules/zod/v4/locales/az.js +0 -118
  63. package/dist/node_modules/zod/v4/locales/be.cjs +0 -169
  64. package/dist/node_modules/zod/v4/locales/be.js +0 -167
  65. package/dist/node_modules/zod/v4/locales/ca.cjs +0 -123
  66. package/dist/node_modules/zod/v4/locales/ca.js +0 -121
  67. package/dist/node_modules/zod/v4/locales/cs.cjs +0 -140
  68. package/dist/node_modules/zod/v4/locales/cs.js +0 -138
  69. package/dist/node_modules/zod/v4/locales/de.cjs +0 -121
  70. package/dist/node_modules/zod/v4/locales/de.js +0 -119
  71. package/dist/node_modules/zod/v4/locales/en.cjs +0 -125
  72. package/dist/node_modules/zod/v4/locales/en.js +0 -120
  73. package/dist/node_modules/zod/v4/locales/eo.cjs +0 -124
  74. package/dist/node_modules/zod/v4/locales/eo.js +0 -119
  75. package/dist/node_modules/zod/v4/locales/es.cjs +0 -122
  76. package/dist/node_modules/zod/v4/locales/es.js +0 -120
  77. package/dist/node_modules/zod/v4/locales/fa.cjs +0 -127
  78. package/dist/node_modules/zod/v4/locales/fa.js +0 -125
  79. package/dist/node_modules/zod/v4/locales/fi.cjs +0 -127
  80. package/dist/node_modules/zod/v4/locales/fi.js +0 -125
  81. package/dist/node_modules/zod/v4/locales/fr-CA.cjs +0 -122
  82. package/dist/node_modules/zod/v4/locales/fr-CA.js +0 -120
  83. package/dist/node_modules/zod/v4/locales/fr.cjs +0 -121
  84. package/dist/node_modules/zod/v4/locales/fr.js +0 -119
  85. package/dist/node_modules/zod/v4/locales/he.cjs +0 -122
  86. package/dist/node_modules/zod/v4/locales/he.js +0 -120
  87. package/dist/node_modules/zod/v4/locales/hu.cjs +0 -122
  88. package/dist/node_modules/zod/v4/locales/hu.js +0 -120
  89. package/dist/node_modules/zod/v4/locales/id.cjs +0 -121
  90. package/dist/node_modules/zod/v4/locales/id.js +0 -119
  91. package/dist/node_modules/zod/v4/locales/index.cjs +0 -85
  92. package/dist/node_modules/zod/v4/locales/index.js +0 -39
  93. package/dist/node_modules/zod/v4/locales/it.cjs +0 -122
  94. package/dist/node_modules/zod/v4/locales/it.js +0 -120
  95. package/dist/node_modules/zod/v4/locales/ja.cjs +0 -120
  96. package/dist/node_modules/zod/v4/locales/ja.js +0 -118
  97. package/dist/node_modules/zod/v4/locales/kh.cjs +0 -122
  98. package/dist/node_modules/zod/v4/locales/kh.js +0 -120
  99. package/dist/node_modules/zod/v4/locales/ko.cjs +0 -126
  100. package/dist/node_modules/zod/v4/locales/ko.js +0 -124
  101. package/dist/node_modules/zod/v4/locales/mk.cjs +0 -123
  102. package/dist/node_modules/zod/v4/locales/mk.js +0 -121
  103. package/dist/node_modules/zod/v4/locales/ms.cjs +0 -121
  104. package/dist/node_modules/zod/v4/locales/ms.js +0 -119
  105. package/dist/node_modules/zod/v4/locales/nl.cjs +0 -122
  106. package/dist/node_modules/zod/v4/locales/nl.js +0 -120
  107. package/dist/node_modules/zod/v4/locales/no.cjs +0 -121
  108. package/dist/node_modules/zod/v4/locales/no.js +0 -119
  109. package/dist/node_modules/zod/v4/locales/ota.cjs +0 -122
  110. package/dist/node_modules/zod/v4/locales/ota.js +0 -120
  111. package/dist/node_modules/zod/v4/locales/pl.cjs +0 -122
  112. package/dist/node_modules/zod/v4/locales/pl.js +0 -120
  113. package/dist/node_modules/zod/v4/locales/ps.cjs +0 -127
  114. package/dist/node_modules/zod/v4/locales/ps.js +0 -125
  115. package/dist/node_modules/zod/v4/locales/pt.cjs +0 -121
  116. package/dist/node_modules/zod/v4/locales/pt.js +0 -119
  117. package/dist/node_modules/zod/v4/locales/ru.cjs +0 -169
  118. package/dist/node_modules/zod/v4/locales/ru.js +0 -167
  119. package/dist/node_modules/zod/v4/locales/sl.cjs +0 -122
  120. package/dist/node_modules/zod/v4/locales/sl.js +0 -120
  121. package/dist/node_modules/zod/v4/locales/sv.cjs +0 -123
  122. package/dist/node_modules/zod/v4/locales/sv.js +0 -121
  123. package/dist/node_modules/zod/v4/locales/ta.cjs +0 -122
  124. package/dist/node_modules/zod/v4/locales/ta.js +0 -120
  125. package/dist/node_modules/zod/v4/locales/th.cjs +0 -122
  126. package/dist/node_modules/zod/v4/locales/th.js +0 -120
  127. package/dist/node_modules/zod/v4/locales/tr.cjs +0 -123
  128. package/dist/node_modules/zod/v4/locales/tr.js +0 -118
  129. package/dist/node_modules/zod/v4/locales/ua.cjs +0 -122
  130. package/dist/node_modules/zod/v4/locales/ua.js +0 -120
  131. package/dist/node_modules/zod/v4/locales/ur.cjs +0 -122
  132. package/dist/node_modules/zod/v4/locales/ur.js +0 -120
  133. package/dist/node_modules/zod/v4/locales/vi.cjs +0 -121
  134. package/dist/node_modules/zod/v4/locales/vi.js +0 -119
  135. package/dist/node_modules/zod/v4/locales/zh-CN.cjs +0 -121
  136. package/dist/node_modules/zod/v4/locales/zh-CN.js +0 -119
  137. package/dist/node_modules/zod/v4/locales/zh-TW.cjs +0 -122
  138. package/dist/node_modules/zod/v4/locales/zh-TW.js +0 -120
@@ -1,167 +0,0 @@
1
- import { joinValues, stringifyPrimitive } from '../core/util.js';
2
-
3
- function getRussianPlural(count, one, few, many) {
4
- const absCount = Math.abs(count);
5
- const lastDigit = absCount % 10;
6
- const lastTwoDigits = absCount % 100;
7
- if (lastTwoDigits >= 11 && lastTwoDigits <= 19) {
8
- return many;
9
- }
10
- if (lastDigit === 1) {
11
- return one;
12
- }
13
- if (lastDigit >= 2 && lastDigit <= 4) {
14
- return few;
15
- }
16
- return many;
17
- }
18
- const error = () => {
19
- const Sizable = {
20
- string: {
21
- unit: {
22
- one: "символ",
23
- few: "символа",
24
- many: "символов",
25
- },
26
- verb: "иметь",
27
- },
28
- file: {
29
- unit: {
30
- one: "байт",
31
- few: "байта",
32
- many: "байт",
33
- },
34
- verb: "иметь",
35
- },
36
- array: {
37
- unit: {
38
- one: "элемент",
39
- few: "элемента",
40
- many: "элементов",
41
- },
42
- verb: "иметь",
43
- },
44
- set: {
45
- unit: {
46
- one: "элемент",
47
- few: "элемента",
48
- many: "элементов",
49
- },
50
- verb: "иметь",
51
- },
52
- };
53
- function getSizing(origin) {
54
- return Sizable[origin] ?? null;
55
- }
56
- const parsedType = (data) => {
57
- const t = typeof data;
58
- switch (t) {
59
- case "number": {
60
- return Number.isNaN(data) ? "NaN" : "число";
61
- }
62
- case "object": {
63
- if (Array.isArray(data)) {
64
- return "массив";
65
- }
66
- if (data === null) {
67
- return "null";
68
- }
69
- if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
70
- return data.constructor.name;
71
- }
72
- }
73
- }
74
- return t;
75
- };
76
- const Nouns = {
77
- regex: "ввод",
78
- email: "email адрес",
79
- url: "URL",
80
- emoji: "эмодзи",
81
- uuid: "UUID",
82
- uuidv4: "UUIDv4",
83
- uuidv6: "UUIDv6",
84
- nanoid: "nanoid",
85
- guid: "GUID",
86
- cuid: "cuid",
87
- cuid2: "cuid2",
88
- ulid: "ULID",
89
- xid: "XID",
90
- ksuid: "KSUID",
91
- datetime: "ISO дата и время",
92
- date: "ISO дата",
93
- time: "ISO время",
94
- duration: "ISO длительность",
95
- ipv4: "IPv4 адрес",
96
- ipv6: "IPv6 адрес",
97
- cidrv4: "IPv4 диапазон",
98
- cidrv6: "IPv6 диапазон",
99
- base64: "строка в формате base64",
100
- base64url: "строка в формате base64url",
101
- json_string: "JSON строка",
102
- e164: "номер E.164",
103
- jwt: "JWT",
104
- template_literal: "ввод",
105
- };
106
- return (issue) => {
107
- switch (issue.code) {
108
- case "invalid_type":
109
- return `Неверный ввод: ожидалось ${issue.expected}, получено ${parsedType(issue.input)}`;
110
- case "invalid_value":
111
- if (issue.values.length === 1)
112
- return `Неверный ввод: ожидалось ${stringifyPrimitive(issue.values[0])}`;
113
- return `Неверный вариант: ожидалось одно из ${joinValues(issue.values, "|")}`;
114
- case "too_big": {
115
- const adj = issue.inclusive ? "<=" : "<";
116
- const sizing = getSizing(issue.origin);
117
- if (sizing) {
118
- const maxValue = Number(issue.maximum);
119
- const unit = getRussianPlural(maxValue, sizing.unit.one, sizing.unit.few, sizing.unit.many);
120
- return `Слишком большое значение: ожидалось, что ${issue.origin ?? "значение"} будет иметь ${adj}${issue.maximum.toString()} ${unit}`;
121
- }
122
- return `Слишком большое значение: ожидалось, что ${issue.origin ?? "значение"} будет ${adj}${issue.maximum.toString()}`;
123
- }
124
- case "too_small": {
125
- const adj = issue.inclusive ? ">=" : ">";
126
- const sizing = getSizing(issue.origin);
127
- if (sizing) {
128
- const minValue = Number(issue.minimum);
129
- const unit = getRussianPlural(minValue, sizing.unit.one, sizing.unit.few, sizing.unit.many);
130
- return `Слишком маленькое значение: ожидалось, что ${issue.origin} будет иметь ${adj}${issue.minimum.toString()} ${unit}`;
131
- }
132
- return `Слишком маленькое значение: ожидалось, что ${issue.origin} будет ${adj}${issue.minimum.toString()}`;
133
- }
134
- case "invalid_format": {
135
- const _issue = issue;
136
- if (_issue.format === "starts_with")
137
- return `Неверная строка: должна начинаться с "${_issue.prefix}"`;
138
- if (_issue.format === "ends_with")
139
- return `Неверная строка: должна заканчиваться на "${_issue.suffix}"`;
140
- if (_issue.format === "includes")
141
- return `Неверная строка: должна содержать "${_issue.includes}"`;
142
- if (_issue.format === "regex")
143
- return `Неверная строка: должна соответствовать шаблону ${_issue.pattern}`;
144
- return `Неверный ${Nouns[_issue.format] ?? issue.format}`;
145
- }
146
- case "not_multiple_of":
147
- return `Неверное число: должно быть кратным ${issue.divisor}`;
148
- case "unrecognized_keys":
149
- return `Нераспознанн${issue.keys.length > 1 ? "ые" : "ый"} ключ${issue.keys.length > 1 ? "и" : ""}: ${joinValues(issue.keys, ", ")}`;
150
- case "invalid_key":
151
- return `Неверный ключ в ${issue.origin}`;
152
- case "invalid_union":
153
- return "Неверные входные данные";
154
- case "invalid_element":
155
- return `Неверное значение в ${issue.origin}`;
156
- default:
157
- return `Неверные входные данные`;
158
- }
159
- };
160
- };
161
- function ru () {
162
- return {
163
- localeError: error(),
164
- };
165
- }
166
-
167
- export { ru as default };
@@ -1,122 +0,0 @@
1
- 'use strict';
2
-
3
- const util = require('../core/util.cjs');
4
-
5
- const error = () => {
6
- const Sizable = {
7
- string: { unit: "znakov", verb: "imeti" },
8
- file: { unit: "bajtov", verb: "imeti" },
9
- array: { unit: "elementov", verb: "imeti" },
10
- set: { unit: "elementov", verb: "imeti" },
11
- };
12
- function getSizing(origin) {
13
- return Sizable[origin] ?? null;
14
- }
15
- const parsedType = (data) => {
16
- const t = typeof data;
17
- switch (t) {
18
- case "number": {
19
- return Number.isNaN(data) ? "NaN" : "število";
20
- }
21
- case "object": {
22
- if (Array.isArray(data)) {
23
- return "tabela";
24
- }
25
- if (data === null) {
26
- return "null";
27
- }
28
- if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
29
- return data.constructor.name;
30
- }
31
- }
32
- }
33
- return t;
34
- };
35
- const Nouns = {
36
- regex: "vnos",
37
- email: "e-poštni naslov",
38
- url: "URL",
39
- emoji: "emoji",
40
- uuid: "UUID",
41
- uuidv4: "UUIDv4",
42
- uuidv6: "UUIDv6",
43
- nanoid: "nanoid",
44
- guid: "GUID",
45
- cuid: "cuid",
46
- cuid2: "cuid2",
47
- ulid: "ULID",
48
- xid: "XID",
49
- ksuid: "KSUID",
50
- datetime: "ISO datum in čas",
51
- date: "ISO datum",
52
- time: "ISO čas",
53
- duration: "ISO trajanje",
54
- ipv4: "IPv4 naslov",
55
- ipv6: "IPv6 naslov",
56
- cidrv4: "obseg IPv4",
57
- cidrv6: "obseg IPv6",
58
- base64: "base64 kodiran niz",
59
- base64url: "base64url kodiran niz",
60
- json_string: "JSON niz",
61
- e164: "E.164 številka",
62
- jwt: "JWT",
63
- template_literal: "vnos",
64
- };
65
- return (issue) => {
66
- switch (issue.code) {
67
- case "invalid_type":
68
- return `Neveljaven vnos: pričakovano ${issue.expected}, prejeto ${parsedType(issue.input)}`;
69
- case "invalid_value":
70
- if (issue.values.length === 1)
71
- return `Neveljaven vnos: pričakovano ${util.stringifyPrimitive(issue.values[0])}`;
72
- return `Neveljavna možnost: pričakovano eno izmed ${util.joinValues(issue.values, "|")}`;
73
- case "too_big": {
74
- const adj = issue.inclusive ? "<=" : "<";
75
- const sizing = getSizing(issue.origin);
76
- if (sizing)
77
- return `Preveliko: pričakovano, da bo ${issue.origin ?? "vrednost"} imelo ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementov"}`;
78
- return `Preveliko: pričakovano, da bo ${issue.origin ?? "vrednost"} ${adj}${issue.maximum.toString()}`;
79
- }
80
- case "too_small": {
81
- const adj = issue.inclusive ? ">=" : ">";
82
- const sizing = getSizing(issue.origin);
83
- if (sizing) {
84
- return `Premajhno: pričakovano, da bo ${issue.origin} imelo ${adj}${issue.minimum.toString()} ${sizing.unit}`;
85
- }
86
- return `Premajhno: pričakovano, da bo ${issue.origin} ${adj}${issue.minimum.toString()}`;
87
- }
88
- case "invalid_format": {
89
- const _issue = issue;
90
- if (_issue.format === "starts_with") {
91
- return `Neveljaven niz: mora se začeti z "${_issue.prefix}"`;
92
- }
93
- if (_issue.format === "ends_with")
94
- return `Neveljaven niz: mora se končati z "${_issue.suffix}"`;
95
- if (_issue.format === "includes")
96
- return `Neveljaven niz: mora vsebovati "${_issue.includes}"`;
97
- if (_issue.format === "regex")
98
- return `Neveljaven niz: mora ustrezati vzorcu ${_issue.pattern}`;
99
- return `Neveljaven ${Nouns[_issue.format] ?? issue.format}`;
100
- }
101
- case "not_multiple_of":
102
- return `Neveljavno število: mora biti večkratnik ${issue.divisor}`;
103
- case "unrecognized_keys":
104
- return `Neprepoznan${issue.keys.length > 1 ? "i ključi" : " ključ"}: ${util.joinValues(issue.keys, ", ")}`;
105
- case "invalid_key":
106
- return `Neveljaven ključ v ${issue.origin}`;
107
- case "invalid_union":
108
- return "Neveljaven vnos";
109
- case "invalid_element":
110
- return `Neveljavna vrednost v ${issue.origin}`;
111
- default:
112
- return "Neveljaven vnos";
113
- }
114
- };
115
- };
116
- function sl () {
117
- return {
118
- localeError: error(),
119
- };
120
- }
121
-
122
- module.exports = sl;
@@ -1,120 +0,0 @@
1
- import { joinValues, stringifyPrimitive } from '../core/util.js';
2
-
3
- const error = () => {
4
- const Sizable = {
5
- string: { unit: "znakov", verb: "imeti" },
6
- file: { unit: "bajtov", verb: "imeti" },
7
- array: { unit: "elementov", verb: "imeti" },
8
- set: { unit: "elementov", verb: "imeti" },
9
- };
10
- function getSizing(origin) {
11
- return Sizable[origin] ?? null;
12
- }
13
- const parsedType = (data) => {
14
- const t = typeof data;
15
- switch (t) {
16
- case "number": {
17
- return Number.isNaN(data) ? "NaN" : "število";
18
- }
19
- case "object": {
20
- if (Array.isArray(data)) {
21
- return "tabela";
22
- }
23
- if (data === null) {
24
- return "null";
25
- }
26
- if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
27
- return data.constructor.name;
28
- }
29
- }
30
- }
31
- return t;
32
- };
33
- const Nouns = {
34
- regex: "vnos",
35
- email: "e-poštni naslov",
36
- url: "URL",
37
- emoji: "emoji",
38
- uuid: "UUID",
39
- uuidv4: "UUIDv4",
40
- uuidv6: "UUIDv6",
41
- nanoid: "nanoid",
42
- guid: "GUID",
43
- cuid: "cuid",
44
- cuid2: "cuid2",
45
- ulid: "ULID",
46
- xid: "XID",
47
- ksuid: "KSUID",
48
- datetime: "ISO datum in čas",
49
- date: "ISO datum",
50
- time: "ISO čas",
51
- duration: "ISO trajanje",
52
- ipv4: "IPv4 naslov",
53
- ipv6: "IPv6 naslov",
54
- cidrv4: "obseg IPv4",
55
- cidrv6: "obseg IPv6",
56
- base64: "base64 kodiran niz",
57
- base64url: "base64url kodiran niz",
58
- json_string: "JSON niz",
59
- e164: "E.164 številka",
60
- jwt: "JWT",
61
- template_literal: "vnos",
62
- };
63
- return (issue) => {
64
- switch (issue.code) {
65
- case "invalid_type":
66
- return `Neveljaven vnos: pričakovano ${issue.expected}, prejeto ${parsedType(issue.input)}`;
67
- case "invalid_value":
68
- if (issue.values.length === 1)
69
- return `Neveljaven vnos: pričakovano ${stringifyPrimitive(issue.values[0])}`;
70
- return `Neveljavna možnost: pričakovano eno izmed ${joinValues(issue.values, "|")}`;
71
- case "too_big": {
72
- const adj = issue.inclusive ? "<=" : "<";
73
- const sizing = getSizing(issue.origin);
74
- if (sizing)
75
- return `Preveliko: pričakovano, da bo ${issue.origin ?? "vrednost"} imelo ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementov"}`;
76
- return `Preveliko: pričakovano, da bo ${issue.origin ?? "vrednost"} ${adj}${issue.maximum.toString()}`;
77
- }
78
- case "too_small": {
79
- const adj = issue.inclusive ? ">=" : ">";
80
- const sizing = getSizing(issue.origin);
81
- if (sizing) {
82
- return `Premajhno: pričakovano, da bo ${issue.origin} imelo ${adj}${issue.minimum.toString()} ${sizing.unit}`;
83
- }
84
- return `Premajhno: pričakovano, da bo ${issue.origin} ${adj}${issue.minimum.toString()}`;
85
- }
86
- case "invalid_format": {
87
- const _issue = issue;
88
- if (_issue.format === "starts_with") {
89
- return `Neveljaven niz: mora se začeti z "${_issue.prefix}"`;
90
- }
91
- if (_issue.format === "ends_with")
92
- return `Neveljaven niz: mora se končati z "${_issue.suffix}"`;
93
- if (_issue.format === "includes")
94
- return `Neveljaven niz: mora vsebovati "${_issue.includes}"`;
95
- if (_issue.format === "regex")
96
- return `Neveljaven niz: mora ustrezati vzorcu ${_issue.pattern}`;
97
- return `Neveljaven ${Nouns[_issue.format] ?? issue.format}`;
98
- }
99
- case "not_multiple_of":
100
- return `Neveljavno število: mora biti večkratnik ${issue.divisor}`;
101
- case "unrecognized_keys":
102
- return `Neprepoznan${issue.keys.length > 1 ? "i ključi" : " ključ"}: ${joinValues(issue.keys, ", ")}`;
103
- case "invalid_key":
104
- return `Neveljaven ključ v ${issue.origin}`;
105
- case "invalid_union":
106
- return "Neveljaven vnos";
107
- case "invalid_element":
108
- return `Neveljavna vrednost v ${issue.origin}`;
109
- default:
110
- return "Neveljaven vnos";
111
- }
112
- };
113
- };
114
- function sl () {
115
- return {
116
- localeError: error(),
117
- };
118
- }
119
-
120
- export { sl as default };
@@ -1,123 +0,0 @@
1
- 'use strict';
2
-
3
- const util = require('../core/util.cjs');
4
-
5
- const error = () => {
6
- const Sizable = {
7
- string: { unit: "tecken", verb: "att ha" },
8
- file: { unit: "bytes", verb: "att ha" },
9
- array: { unit: "objekt", verb: "att innehålla" },
10
- set: { unit: "objekt", verb: "att innehålla" },
11
- };
12
- function getSizing(origin) {
13
- return Sizable[origin] ?? null;
14
- }
15
- const parsedType = (data) => {
16
- const t = typeof data;
17
- switch (t) {
18
- case "number": {
19
- return Number.isNaN(data) ? "NaN" : "antal";
20
- }
21
- case "object": {
22
- if (Array.isArray(data)) {
23
- return "lista";
24
- }
25
- if (data === null) {
26
- return "null";
27
- }
28
- if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
29
- return data.constructor.name;
30
- }
31
- }
32
- }
33
- return t;
34
- };
35
- const Nouns = {
36
- regex: "reguljärt uttryck",
37
- email: "e-postadress",
38
- url: "URL",
39
- emoji: "emoji",
40
- uuid: "UUID",
41
- uuidv4: "UUIDv4",
42
- uuidv6: "UUIDv6",
43
- nanoid: "nanoid",
44
- guid: "GUID",
45
- cuid: "cuid",
46
- cuid2: "cuid2",
47
- ulid: "ULID",
48
- xid: "XID",
49
- ksuid: "KSUID",
50
- datetime: "ISO-datum och tid",
51
- date: "ISO-datum",
52
- time: "ISO-tid",
53
- duration: "ISO-varaktighet",
54
- ipv4: "IPv4-intervall",
55
- ipv6: "IPv6-intervall",
56
- cidrv4: "IPv4-spektrum",
57
- cidrv6: "IPv6-spektrum",
58
- base64: "base64-kodad sträng",
59
- base64url: "base64url-kodad sträng",
60
- json_string: "JSON-sträng",
61
- e164: "E.164-nummer",
62
- jwt: "JWT",
63
- template_literal: "mall-literal",
64
- };
65
- return (issue) => {
66
- switch (issue.code) {
67
- case "invalid_type":
68
- return `Ogiltig inmatning: förväntat ${issue.expected}, fick ${parsedType(issue.input)}`;
69
- case "invalid_value":
70
- if (issue.values.length === 1)
71
- return `Ogiltig inmatning: förväntat ${util.stringifyPrimitive(issue.values[0])}`;
72
- return `Ogiltigt val: förväntade en av ${util.joinValues(issue.values, "|")}`;
73
- case "too_big": {
74
- const adj = issue.inclusive ? "<=" : "<";
75
- const sizing = getSizing(issue.origin);
76
- if (sizing) {
77
- return `För stor(t): förväntade ${issue.origin ?? "värdet"} att ha ${adj}${issue.maximum.toString()} ${sizing.unit ?? "element"}`;
78
- }
79
- return `För stor(t): förväntat ${issue.origin ?? "värdet"} att ha ${adj}${issue.maximum.toString()}`;
80
- }
81
- case "too_small": {
82
- const adj = issue.inclusive ? ">=" : ">";
83
- const sizing = getSizing(issue.origin);
84
- if (sizing) {
85
- return `För lite(t): förväntade ${issue.origin ?? "värdet"} att ha ${adj}${issue.minimum.toString()} ${sizing.unit}`;
86
- }
87
- return `För lite(t): förväntade ${issue.origin ?? "värdet"} att ha ${adj}${issue.minimum.toString()}`;
88
- }
89
- case "invalid_format": {
90
- const _issue = issue;
91
- if (_issue.format === "starts_with") {
92
- return `Ogiltig sträng: måste börja med "${_issue.prefix}"`;
93
- }
94
- if (_issue.format === "ends_with")
95
- return `Ogiltig sträng: måste sluta med "${_issue.suffix}"`;
96
- if (_issue.format === "includes")
97
- return `Ogiltig sträng: måste innehålla "${_issue.includes}"`;
98
- if (_issue.format === "regex")
99
- return `Ogiltig sträng: måste matcha mönstret "${_issue.pattern}"`;
100
- return `Ogiltig(t) ${Nouns[_issue.format] ?? issue.format}`;
101
- }
102
- case "not_multiple_of":
103
- return `Ogiltigt tal: måste vara en multipel av ${issue.divisor}`;
104
- case "unrecognized_keys":
105
- return `${issue.keys.length > 1 ? "Okända nycklar" : "Okänd nyckel"}: ${util.joinValues(issue.keys, ", ")}`;
106
- case "invalid_key":
107
- return `Ogiltig nyckel i ${issue.origin ?? "värdet"}`;
108
- case "invalid_union":
109
- return "Ogiltig input";
110
- case "invalid_element":
111
- return `Ogiltigt värde i ${issue.origin ?? "värdet"}`;
112
- default:
113
- return `Ogiltig input`;
114
- }
115
- };
116
- };
117
- function sv () {
118
- return {
119
- localeError: error(),
120
- };
121
- }
122
-
123
- module.exports = sv;
@@ -1,121 +0,0 @@
1
- import { joinValues, stringifyPrimitive } from '../core/util.js';
2
-
3
- const error = () => {
4
- const Sizable = {
5
- string: { unit: "tecken", verb: "att ha" },
6
- file: { unit: "bytes", verb: "att ha" },
7
- array: { unit: "objekt", verb: "att innehålla" },
8
- set: { unit: "objekt", verb: "att innehålla" },
9
- };
10
- function getSizing(origin) {
11
- return Sizable[origin] ?? null;
12
- }
13
- const parsedType = (data) => {
14
- const t = typeof data;
15
- switch (t) {
16
- case "number": {
17
- return Number.isNaN(data) ? "NaN" : "antal";
18
- }
19
- case "object": {
20
- if (Array.isArray(data)) {
21
- return "lista";
22
- }
23
- if (data === null) {
24
- return "null";
25
- }
26
- if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
27
- return data.constructor.name;
28
- }
29
- }
30
- }
31
- return t;
32
- };
33
- const Nouns = {
34
- regex: "reguljärt uttryck",
35
- email: "e-postadress",
36
- url: "URL",
37
- emoji: "emoji",
38
- uuid: "UUID",
39
- uuidv4: "UUIDv4",
40
- uuidv6: "UUIDv6",
41
- nanoid: "nanoid",
42
- guid: "GUID",
43
- cuid: "cuid",
44
- cuid2: "cuid2",
45
- ulid: "ULID",
46
- xid: "XID",
47
- ksuid: "KSUID",
48
- datetime: "ISO-datum och tid",
49
- date: "ISO-datum",
50
- time: "ISO-tid",
51
- duration: "ISO-varaktighet",
52
- ipv4: "IPv4-intervall",
53
- ipv6: "IPv6-intervall",
54
- cidrv4: "IPv4-spektrum",
55
- cidrv6: "IPv6-spektrum",
56
- base64: "base64-kodad sträng",
57
- base64url: "base64url-kodad sträng",
58
- json_string: "JSON-sträng",
59
- e164: "E.164-nummer",
60
- jwt: "JWT",
61
- template_literal: "mall-literal",
62
- };
63
- return (issue) => {
64
- switch (issue.code) {
65
- case "invalid_type":
66
- return `Ogiltig inmatning: förväntat ${issue.expected}, fick ${parsedType(issue.input)}`;
67
- case "invalid_value":
68
- if (issue.values.length === 1)
69
- return `Ogiltig inmatning: förväntat ${stringifyPrimitive(issue.values[0])}`;
70
- return `Ogiltigt val: förväntade en av ${joinValues(issue.values, "|")}`;
71
- case "too_big": {
72
- const adj = issue.inclusive ? "<=" : "<";
73
- const sizing = getSizing(issue.origin);
74
- if (sizing) {
75
- return `För stor(t): förväntade ${issue.origin ?? "värdet"} att ha ${adj}${issue.maximum.toString()} ${sizing.unit ?? "element"}`;
76
- }
77
- return `För stor(t): förväntat ${issue.origin ?? "värdet"} att ha ${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 `För lite(t): förväntade ${issue.origin ?? "värdet"} att ha ${adj}${issue.minimum.toString()} ${sizing.unit}`;
84
- }
85
- return `För lite(t): förväntade ${issue.origin ?? "värdet"} att ha ${adj}${issue.minimum.toString()}`;
86
- }
87
- case "invalid_format": {
88
- const _issue = issue;
89
- if (_issue.format === "starts_with") {
90
- return `Ogiltig sträng: måste börja med "${_issue.prefix}"`;
91
- }
92
- if (_issue.format === "ends_with")
93
- return `Ogiltig sträng: måste sluta med "${_issue.suffix}"`;
94
- if (_issue.format === "includes")
95
- return `Ogiltig sträng: måste innehålla "${_issue.includes}"`;
96
- if (_issue.format === "regex")
97
- return `Ogiltig sträng: måste matcha mönstret "${_issue.pattern}"`;
98
- return `Ogiltig(t) ${Nouns[_issue.format] ?? issue.format}`;
99
- }
100
- case "not_multiple_of":
101
- return `Ogiltigt tal: måste vara en multipel av ${issue.divisor}`;
102
- case "unrecognized_keys":
103
- return `${issue.keys.length > 1 ? "Okända nycklar" : "Okänd nyckel"}: ${joinValues(issue.keys, ", ")}`;
104
- case "invalid_key":
105
- return `Ogiltig nyckel i ${issue.origin ?? "värdet"}`;
106
- case "invalid_union":
107
- return "Ogiltig input";
108
- case "invalid_element":
109
- return `Ogiltigt värde i ${issue.origin ?? "värdet"}`;
110
- default:
111
- return `Ogiltig input`;
112
- }
113
- };
114
- };
115
- function sv () {
116
- return {
117
- localeError: error(),
118
- };
119
- }
120
-
121
- export { sv as default };