lkd-web-kit 0.4.8 → 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 (132) hide show
  1. package/dist/hooks/useZodConfig.cjs +2 -2
  2. package/dist/hooks/useZodConfig.js +2 -2
  3. package/dist/index.d.ts +2 -2
  4. package/package.json +7 -7
  5. package/dist/node_modules/zod/v4/classic/coerce.cjs +0 -28
  6. package/dist/node_modules/zod/v4/classic/coerce.js +0 -20
  7. package/dist/node_modules/zod/v4/classic/compat.cjs +0 -37
  8. package/dist/node_modules/zod/v4/classic/compat.js +0 -30
  9. package/dist/node_modules/zod/v4/classic/errors.cjs +0 -49
  10. package/dist/node_modules/zod/v4/classic/errors.js +0 -44
  11. package/dist/node_modules/zod/v4/classic/external.cjs +0 -231
  12. package/dist/node_modules/zod/v4/classic/external.js +0 -28
  13. package/dist/node_modules/zod/v4/classic/index.cjs +0 -10
  14. package/dist/node_modules/zod/v4/classic/index.js +0 -5
  15. package/dist/node_modules/zod/v4/classic/iso.cjs +0 -46
  16. package/dist/node_modules/zod/v4/classic/iso.js +0 -35
  17. package/dist/node_modules/zod/v4/classic/parse.cjs +0 -16
  18. package/dist/node_modules/zod/v4/classic/parse.js +0 -9
  19. package/dist/node_modules/zod/v4/classic/schemas.cjs +0 -1155
  20. package/dist/node_modules/zod/v4/classic/schemas.js +0 -1006
  21. package/dist/node_modules/zod/v4/core/api.cjs +0 -1016
  22. package/dist/node_modules/zod/v4/core/api.js +0 -903
  23. package/dist/node_modules/zod/v4/core/checks.cjs +0 -587
  24. package/dist/node_modules/zod/v4/core/checks.js +0 -562
  25. package/dist/node_modules/zod/v4/core/core.cjs +0 -72
  26. package/dist/node_modules/zod/v4/core/core.js +0 -63
  27. package/dist/node_modules/zod/v4/core/doc.cjs +0 -41
  28. package/dist/node_modules/zod/v4/core/doc.js +0 -37
  29. package/dist/node_modules/zod/v4/core/errors.cjs +0 -204
  30. package/dist/node_modules/zod/v4/core/errors.js +0 -194
  31. package/dist/node_modules/zod/v4/core/function.cjs +0 -81
  32. package/dist/node_modules/zod/v4/core/function.js +0 -76
  33. package/dist/node_modules/zod/v4/core/index.cjs +0 -261
  34. package/dist/node_modules/zod/v4/core/index.js +0 -20
  35. package/dist/node_modules/zod/v4/core/json-schema.cjs +0 -2
  36. package/dist/node_modules/zod/v4/core/json-schema.js +0 -1
  37. package/dist/node_modules/zod/v4/core/parse.cjs +0 -71
  38. package/dist/node_modules/zod/v4/core/parse.js +0 -60
  39. package/dist/node_modules/zod/v4/core/regexes.cjs +0 -139
  40. package/dist/node_modules/zod/v4/core/regexes.js +0 -95
  41. package/dist/node_modules/zod/v4/core/registries.cjs +0 -52
  42. package/dist/node_modules/zod/v4/core/registries.js +0 -44
  43. package/dist/node_modules/zod/v4/core/schemas.cjs +0 -1793
  44. package/dist/node_modules/zod/v4/core/schemas.js +0 -1720
  45. package/dist/node_modules/zod/v4/core/to-json-schema.cjs +0 -823
  46. package/dist/node_modules/zod/v4/core/to-json-schema.js +0 -818
  47. package/dist/node_modules/zod/v4/core/util.cjs +0 -543
  48. package/dist/node_modules/zod/v4/core/util.js +0 -491
  49. package/dist/node_modules/zod/v4/core/versions.cjs +0 -11
  50. package/dist/node_modules/zod/v4/core/versions.js +0 -7
  51. package/dist/node_modules/zod/v4/index.cjs +0 -10
  52. package/dist/node_modules/zod/v4/index.js +0 -5
  53. package/dist/node_modules/zod/v4/locales/ar.cjs +0 -121
  54. package/dist/node_modules/zod/v4/locales/ar.js +0 -119
  55. package/dist/node_modules/zod/v4/locales/az.cjs +0 -120
  56. package/dist/node_modules/zod/v4/locales/az.js +0 -118
  57. package/dist/node_modules/zod/v4/locales/be.cjs +0 -169
  58. package/dist/node_modules/zod/v4/locales/be.js +0 -167
  59. package/dist/node_modules/zod/v4/locales/ca.cjs +0 -123
  60. package/dist/node_modules/zod/v4/locales/ca.js +0 -121
  61. package/dist/node_modules/zod/v4/locales/cs.cjs +0 -140
  62. package/dist/node_modules/zod/v4/locales/cs.js +0 -138
  63. package/dist/node_modules/zod/v4/locales/de.cjs +0 -121
  64. package/dist/node_modules/zod/v4/locales/de.js +0 -119
  65. package/dist/node_modules/zod/v4/locales/en.cjs +0 -125
  66. package/dist/node_modules/zod/v4/locales/en.js +0 -120
  67. package/dist/node_modules/zod/v4/locales/eo.cjs +0 -124
  68. package/dist/node_modules/zod/v4/locales/eo.js +0 -119
  69. package/dist/node_modules/zod/v4/locales/es.cjs +0 -122
  70. package/dist/node_modules/zod/v4/locales/es.js +0 -120
  71. package/dist/node_modules/zod/v4/locales/fa.cjs +0 -127
  72. package/dist/node_modules/zod/v4/locales/fa.js +0 -125
  73. package/dist/node_modules/zod/v4/locales/fi.cjs +0 -127
  74. package/dist/node_modules/zod/v4/locales/fi.js +0 -125
  75. package/dist/node_modules/zod/v4/locales/fr-CA.cjs +0 -122
  76. package/dist/node_modules/zod/v4/locales/fr-CA.js +0 -120
  77. package/dist/node_modules/zod/v4/locales/fr.cjs +0 -121
  78. package/dist/node_modules/zod/v4/locales/fr.js +0 -119
  79. package/dist/node_modules/zod/v4/locales/he.cjs +0 -122
  80. package/dist/node_modules/zod/v4/locales/he.js +0 -120
  81. package/dist/node_modules/zod/v4/locales/hu.cjs +0 -122
  82. package/dist/node_modules/zod/v4/locales/hu.js +0 -120
  83. package/dist/node_modules/zod/v4/locales/id.cjs +0 -121
  84. package/dist/node_modules/zod/v4/locales/id.js +0 -119
  85. package/dist/node_modules/zod/v4/locales/index.cjs +0 -85
  86. package/dist/node_modules/zod/v4/locales/index.js +0 -39
  87. package/dist/node_modules/zod/v4/locales/it.cjs +0 -122
  88. package/dist/node_modules/zod/v4/locales/it.js +0 -120
  89. package/dist/node_modules/zod/v4/locales/ja.cjs +0 -120
  90. package/dist/node_modules/zod/v4/locales/ja.js +0 -118
  91. package/dist/node_modules/zod/v4/locales/kh.cjs +0 -122
  92. package/dist/node_modules/zod/v4/locales/kh.js +0 -120
  93. package/dist/node_modules/zod/v4/locales/ko.cjs +0 -126
  94. package/dist/node_modules/zod/v4/locales/ko.js +0 -124
  95. package/dist/node_modules/zod/v4/locales/mk.cjs +0 -123
  96. package/dist/node_modules/zod/v4/locales/mk.js +0 -121
  97. package/dist/node_modules/zod/v4/locales/ms.cjs +0 -121
  98. package/dist/node_modules/zod/v4/locales/ms.js +0 -119
  99. package/dist/node_modules/zod/v4/locales/nl.cjs +0 -122
  100. package/dist/node_modules/zod/v4/locales/nl.js +0 -120
  101. package/dist/node_modules/zod/v4/locales/no.cjs +0 -121
  102. package/dist/node_modules/zod/v4/locales/no.js +0 -119
  103. package/dist/node_modules/zod/v4/locales/ota.cjs +0 -122
  104. package/dist/node_modules/zod/v4/locales/ota.js +0 -120
  105. package/dist/node_modules/zod/v4/locales/pl.cjs +0 -122
  106. package/dist/node_modules/zod/v4/locales/pl.js +0 -120
  107. package/dist/node_modules/zod/v4/locales/ps.cjs +0 -127
  108. package/dist/node_modules/zod/v4/locales/ps.js +0 -125
  109. package/dist/node_modules/zod/v4/locales/pt.cjs +0 -121
  110. package/dist/node_modules/zod/v4/locales/pt.js +0 -119
  111. package/dist/node_modules/zod/v4/locales/ru.cjs +0 -169
  112. package/dist/node_modules/zod/v4/locales/ru.js +0 -167
  113. package/dist/node_modules/zod/v4/locales/sl.cjs +0 -122
  114. package/dist/node_modules/zod/v4/locales/sl.js +0 -120
  115. package/dist/node_modules/zod/v4/locales/sv.cjs +0 -123
  116. package/dist/node_modules/zod/v4/locales/sv.js +0 -121
  117. package/dist/node_modules/zod/v4/locales/ta.cjs +0 -122
  118. package/dist/node_modules/zod/v4/locales/ta.js +0 -120
  119. package/dist/node_modules/zod/v4/locales/th.cjs +0 -122
  120. package/dist/node_modules/zod/v4/locales/th.js +0 -120
  121. package/dist/node_modules/zod/v4/locales/tr.cjs +0 -123
  122. package/dist/node_modules/zod/v4/locales/tr.js +0 -118
  123. package/dist/node_modules/zod/v4/locales/ua.cjs +0 -122
  124. package/dist/node_modules/zod/v4/locales/ua.js +0 -120
  125. package/dist/node_modules/zod/v4/locales/ur.cjs +0 -122
  126. package/dist/node_modules/zod/v4/locales/ur.js +0 -120
  127. package/dist/node_modules/zod/v4/locales/vi.cjs +0 -121
  128. package/dist/node_modules/zod/v4/locales/vi.js +0 -119
  129. package/dist/node_modules/zod/v4/locales/zh-CN.cjs +0 -121
  130. package/dist/node_modules/zod/v4/locales/zh-CN.js +0 -119
  131. package/dist/node_modules/zod/v4/locales/zh-TW.cjs +0 -122
  132. package/dist/node_modules/zod/v4/locales/zh-TW.js +0 -120
@@ -1,119 +0,0 @@
1
- import { joinValues, stringifyPrimitive } from '../core/util.js';
2
-
3
- const error = () => {
4
- const Sizable = {
5
- string: { unit: "aksara", verb: "mempunyai" },
6
- file: { unit: "bait", verb: "mempunyai" },
7
- array: { unit: "elemen", verb: "mempunyai" },
8
- set: { unit: "elemen", verb: "mempunyai" },
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" : "nombor";
18
- }
19
- case "object": {
20
- if (Array.isArray(data)) {
21
- return "array";
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: "input",
35
- email: "alamat e-mel",
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: "tarikh masa ISO",
49
- date: "tarikh ISO",
50
- time: "masa ISO",
51
- duration: "tempoh ISO",
52
- ipv4: "alamat IPv4",
53
- ipv6: "alamat IPv6",
54
- cidrv4: "julat IPv4",
55
- cidrv6: "julat IPv6",
56
- base64: "string dikodkan base64",
57
- base64url: "string dikodkan base64url",
58
- json_string: "string JSON",
59
- e164: "nombor E.164",
60
- jwt: "JWT",
61
- template_literal: "input",
62
- };
63
- return (issue) => {
64
- switch (issue.code) {
65
- case "invalid_type":
66
- return `Input tidak sah: dijangka ${issue.expected}, diterima ${parsedType(issue.input)}`;
67
- case "invalid_value":
68
- if (issue.values.length === 1)
69
- return `Input tidak sah: dijangka ${stringifyPrimitive(issue.values[0])}`;
70
- return `Pilihan tidak sah: dijangka salah satu daripada ${joinValues(issue.values, "|")}`;
71
- case "too_big": {
72
- const adj = issue.inclusive ? "<=" : "<";
73
- const sizing = getSizing(issue.origin);
74
- if (sizing)
75
- return `Terlalu besar: dijangka ${issue.origin ?? "nilai"} ${sizing.verb} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elemen"}`;
76
- return `Terlalu besar: dijangka ${issue.origin ?? "nilai"} adalah ${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 `Terlalu kecil: dijangka ${issue.origin} ${sizing.verb} ${adj}${issue.minimum.toString()} ${sizing.unit}`;
83
- }
84
- return `Terlalu kecil: dijangka ${issue.origin} adalah ${adj}${issue.minimum.toString()}`;
85
- }
86
- case "invalid_format": {
87
- const _issue = issue;
88
- if (_issue.format === "starts_with")
89
- return `String tidak sah: mesti bermula dengan "${_issue.prefix}"`;
90
- if (_issue.format === "ends_with")
91
- return `String tidak sah: mesti berakhir dengan "${_issue.suffix}"`;
92
- if (_issue.format === "includes")
93
- return `String tidak sah: mesti mengandungi "${_issue.includes}"`;
94
- if (_issue.format === "regex")
95
- return `String tidak sah: mesti sepadan dengan corak ${_issue.pattern}`;
96
- return `${Nouns[_issue.format] ?? issue.format} tidak sah`;
97
- }
98
- case "not_multiple_of":
99
- return `Nombor tidak sah: perlu gandaan ${issue.divisor}`;
100
- case "unrecognized_keys":
101
- return `Kunci tidak dikenali: ${joinValues(issue.keys, ", ")}`;
102
- case "invalid_key":
103
- return `Kunci tidak sah dalam ${issue.origin}`;
104
- case "invalid_union":
105
- return "Input tidak sah";
106
- case "invalid_element":
107
- return `Nilai tidak sah dalam ${issue.origin}`;
108
- default:
109
- return `Input tidak sah`;
110
- }
111
- };
112
- };
113
- function ms () {
114
- return {
115
- localeError: error(),
116
- };
117
- }
118
-
119
- export { ms 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: "tekens" },
8
- file: { unit: "bytes" },
9
- array: { unit: "elementen" },
10
- set: { unit: "elementen" },
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" : "getal";
20
- }
21
- case "object": {
22
- if (Array.isArray(data)) {
23
- return "array";
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: "invoer",
37
- email: "emailadres",
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 en tijd",
51
- date: "ISO datum",
52
- time: "ISO tijd",
53
- duration: "ISO duur",
54
- ipv4: "IPv4-adres",
55
- ipv6: "IPv6-adres",
56
- cidrv4: "IPv4-bereik",
57
- cidrv6: "IPv6-bereik",
58
- base64: "base64-gecodeerde tekst",
59
- base64url: "base64 URL-gecodeerde tekst",
60
- json_string: "JSON string",
61
- e164: "E.164-nummer",
62
- jwt: "JWT",
63
- template_literal: "invoer",
64
- };
65
- return (issue) => {
66
- switch (issue.code) {
67
- case "invalid_type":
68
- return `Ongeldige invoer: verwacht ${issue.expected}, ontving ${parsedType(issue.input)}`;
69
- case "invalid_value":
70
- if (issue.values.length === 1)
71
- return `Ongeldige invoer: verwacht ${util.stringifyPrimitive(issue.values[0])}`;
72
- return `Ongeldige optie: verwacht één van ${util.joinValues(issue.values, "|")}`;
73
- case "too_big": {
74
- const adj = issue.inclusive ? "<=" : "<";
75
- const sizing = getSizing(issue.origin);
76
- if (sizing)
77
- return `Te lang: verwacht dat ${issue.origin ?? "waarde"} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementen"} bevat`;
78
- return `Te lang: verwacht dat ${issue.origin ?? "waarde"} ${adj}${issue.maximum.toString()} is`;
79
- }
80
- case "too_small": {
81
- const adj = issue.inclusive ? ">=" : ">";
82
- const sizing = getSizing(issue.origin);
83
- if (sizing) {
84
- return `Te kort: verwacht dat ${issue.origin} ${adj}${issue.minimum.toString()} ${sizing.unit} bevat`;
85
- }
86
- return `Te kort: verwacht dat ${issue.origin} ${adj}${issue.minimum.toString()} is`;
87
- }
88
- case "invalid_format": {
89
- const _issue = issue;
90
- if (_issue.format === "starts_with") {
91
- return `Ongeldige tekst: moet met "${_issue.prefix}" beginnen`;
92
- }
93
- if (_issue.format === "ends_with")
94
- return `Ongeldige tekst: moet op "${_issue.suffix}" eindigen`;
95
- if (_issue.format === "includes")
96
- return `Ongeldige tekst: moet "${_issue.includes}" bevatten`;
97
- if (_issue.format === "regex")
98
- return `Ongeldige tekst: moet overeenkomen met patroon ${_issue.pattern}`;
99
- return `Ongeldig: ${Nouns[_issue.format] ?? issue.format}`;
100
- }
101
- case "not_multiple_of":
102
- return `Ongeldig getal: moet een veelvoud van ${issue.divisor} zijn`;
103
- case "unrecognized_keys":
104
- return `Onbekende key${issue.keys.length > 1 ? "s" : ""}: ${util.joinValues(issue.keys, ", ")}`;
105
- case "invalid_key":
106
- return `Ongeldige key in ${issue.origin}`;
107
- case "invalid_union":
108
- return "Ongeldige invoer";
109
- case "invalid_element":
110
- return `Ongeldige waarde in ${issue.origin}`;
111
- default:
112
- return `Ongeldige invoer`;
113
- }
114
- };
115
- };
116
- function nl () {
117
- return {
118
- localeError: error(),
119
- };
120
- }
121
-
122
- module.exports = nl;
@@ -1,120 +0,0 @@
1
- import { joinValues, stringifyPrimitive } from '../core/util.js';
2
-
3
- const error = () => {
4
- const Sizable = {
5
- string: { unit: "tekens" },
6
- file: { unit: "bytes" },
7
- array: { unit: "elementen" },
8
- set: { unit: "elementen" },
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" : "getal";
18
- }
19
- case "object": {
20
- if (Array.isArray(data)) {
21
- return "array";
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: "invoer",
35
- email: "emailadres",
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 en tijd",
49
- date: "ISO datum",
50
- time: "ISO tijd",
51
- duration: "ISO duur",
52
- ipv4: "IPv4-adres",
53
- ipv6: "IPv6-adres",
54
- cidrv4: "IPv4-bereik",
55
- cidrv6: "IPv6-bereik",
56
- base64: "base64-gecodeerde tekst",
57
- base64url: "base64 URL-gecodeerde tekst",
58
- json_string: "JSON string",
59
- e164: "E.164-nummer",
60
- jwt: "JWT",
61
- template_literal: "invoer",
62
- };
63
- return (issue) => {
64
- switch (issue.code) {
65
- case "invalid_type":
66
- return `Ongeldige invoer: verwacht ${issue.expected}, ontving ${parsedType(issue.input)}`;
67
- case "invalid_value":
68
- if (issue.values.length === 1)
69
- return `Ongeldige invoer: verwacht ${stringifyPrimitive(issue.values[0])}`;
70
- return `Ongeldige optie: verwacht één van ${joinValues(issue.values, "|")}`;
71
- case "too_big": {
72
- const adj = issue.inclusive ? "<=" : "<";
73
- const sizing = getSizing(issue.origin);
74
- if (sizing)
75
- return `Te lang: verwacht dat ${issue.origin ?? "waarde"} ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementen"} bevat`;
76
- return `Te lang: verwacht dat ${issue.origin ?? "waarde"} ${adj}${issue.maximum.toString()} is`;
77
- }
78
- case "too_small": {
79
- const adj = issue.inclusive ? ">=" : ">";
80
- const sizing = getSizing(issue.origin);
81
- if (sizing) {
82
- return `Te kort: verwacht dat ${issue.origin} ${adj}${issue.minimum.toString()} ${sizing.unit} bevat`;
83
- }
84
- return `Te kort: verwacht dat ${issue.origin} ${adj}${issue.minimum.toString()} is`;
85
- }
86
- case "invalid_format": {
87
- const _issue = issue;
88
- if (_issue.format === "starts_with") {
89
- return `Ongeldige tekst: moet met "${_issue.prefix}" beginnen`;
90
- }
91
- if (_issue.format === "ends_with")
92
- return `Ongeldige tekst: moet op "${_issue.suffix}" eindigen`;
93
- if (_issue.format === "includes")
94
- return `Ongeldige tekst: moet "${_issue.includes}" bevatten`;
95
- if (_issue.format === "regex")
96
- return `Ongeldige tekst: moet overeenkomen met patroon ${_issue.pattern}`;
97
- return `Ongeldig: ${Nouns[_issue.format] ?? issue.format}`;
98
- }
99
- case "not_multiple_of":
100
- return `Ongeldig getal: moet een veelvoud van ${issue.divisor} zijn`;
101
- case "unrecognized_keys":
102
- return `Onbekende key${issue.keys.length > 1 ? "s" : ""}: ${joinValues(issue.keys, ", ")}`;
103
- case "invalid_key":
104
- return `Ongeldige key in ${issue.origin}`;
105
- case "invalid_union":
106
- return "Ongeldige invoer";
107
- case "invalid_element":
108
- return `Ongeldige waarde in ${issue.origin}`;
109
- default:
110
- return `Ongeldige invoer`;
111
- }
112
- };
113
- };
114
- function nl () {
115
- return {
116
- localeError: error(),
117
- };
118
- }
119
-
120
- export { nl as default };
@@ -1,121 +0,0 @@
1
- 'use strict';
2
-
3
- const util = require('../core/util.cjs');
4
-
5
- const error = () => {
6
- const Sizable = {
7
- string: { unit: "tegn", verb: "å ha" },
8
- file: { unit: "bytes", verb: "å ha" },
9
- array: { unit: "elementer", verb: "å inneholde" },
10
- set: { unit: "elementer", verb: "å inneholde" },
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" : "tall";
20
- }
21
- case "object": {
22
- if (Array.isArray(data)) {
23
- return "liste";
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: "input",
37
- email: "e-postadresse",
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 dato- og klokkeslett",
51
- date: "ISO-dato",
52
- time: "ISO-klokkeslett",
53
- duration: "ISO-varighet",
54
- ipv4: "IPv4-område",
55
- ipv6: "IPv6-område",
56
- cidrv4: "IPv4-spekter",
57
- cidrv6: "IPv6-spekter",
58
- base64: "base64-enkodet streng",
59
- base64url: "base64url-enkodet streng",
60
- json_string: "JSON-streng",
61
- e164: "E.164-nummer",
62
- jwt: "JWT",
63
- template_literal: "input",
64
- };
65
- return (issue) => {
66
- switch (issue.code) {
67
- case "invalid_type":
68
- return `Ugyldig input: forventet ${issue.expected}, fikk ${parsedType(issue.input)}`;
69
- case "invalid_value":
70
- if (issue.values.length === 1)
71
- return `Ugyldig verdi: forventet ${util.stringifyPrimitive(issue.values[0])}`;
72
- return `Ugyldig valg: forventet 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 `For stor(t): forventet ${issue.origin ?? "value"} til å ha ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementer"}`;
78
- return `For stor(t): forventet ${issue.origin ?? "value"} til å ha ${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 `For lite(n): forventet ${issue.origin} til å ha ${adj}${issue.minimum.toString()} ${sizing.unit}`;
85
- }
86
- return `For lite(n): forventet ${issue.origin} til å ha ${adj}${issue.minimum.toString()}`;
87
- }
88
- case "invalid_format": {
89
- const _issue = issue;
90
- if (_issue.format === "starts_with")
91
- return `Ugyldig streng: må starte med "${_issue.prefix}"`;
92
- if (_issue.format === "ends_with")
93
- return `Ugyldig streng: må ende med "${_issue.suffix}"`;
94
- if (_issue.format === "includes")
95
- return `Ugyldig streng: må inneholde "${_issue.includes}"`;
96
- if (_issue.format === "regex")
97
- return `Ugyldig streng: må matche mønsteret ${_issue.pattern}`;
98
- return `Ugyldig ${Nouns[_issue.format] ?? issue.format}`;
99
- }
100
- case "not_multiple_of":
101
- return `Ugyldig tall: må være et multiplum av ${issue.divisor}`;
102
- case "unrecognized_keys":
103
- return `${issue.keys.length > 1 ? "Ukjente nøkler" : "Ukjent nøkkel"}: ${util.joinValues(issue.keys, ", ")}`;
104
- case "invalid_key":
105
- return `Ugyldig nøkkel i ${issue.origin}`;
106
- case "invalid_union":
107
- return "Ugyldig input";
108
- case "invalid_element":
109
- return `Ugyldig verdi i ${issue.origin}`;
110
- default:
111
- return `Ugyldig input`;
112
- }
113
- };
114
- };
115
- function no () {
116
- return {
117
- localeError: error(),
118
- };
119
- }
120
-
121
- module.exports = no;
@@ -1,119 +0,0 @@
1
- import { joinValues, stringifyPrimitive } from '../core/util.js';
2
-
3
- const error = () => {
4
- const Sizable = {
5
- string: { unit: "tegn", verb: "å ha" },
6
- file: { unit: "bytes", verb: "å ha" },
7
- array: { unit: "elementer", verb: "å inneholde" },
8
- set: { unit: "elementer", verb: "å inneholde" },
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" : "tall";
18
- }
19
- case "object": {
20
- if (Array.isArray(data)) {
21
- return "liste";
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: "input",
35
- email: "e-postadresse",
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 dato- og klokkeslett",
49
- date: "ISO-dato",
50
- time: "ISO-klokkeslett",
51
- duration: "ISO-varighet",
52
- ipv4: "IPv4-område",
53
- ipv6: "IPv6-område",
54
- cidrv4: "IPv4-spekter",
55
- cidrv6: "IPv6-spekter",
56
- base64: "base64-enkodet streng",
57
- base64url: "base64url-enkodet streng",
58
- json_string: "JSON-streng",
59
- e164: "E.164-nummer",
60
- jwt: "JWT",
61
- template_literal: "input",
62
- };
63
- return (issue) => {
64
- switch (issue.code) {
65
- case "invalid_type":
66
- return `Ugyldig input: forventet ${issue.expected}, fikk ${parsedType(issue.input)}`;
67
- case "invalid_value":
68
- if (issue.values.length === 1)
69
- return `Ugyldig verdi: forventet ${stringifyPrimitive(issue.values[0])}`;
70
- return `Ugyldig valg: forventet 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 `For stor(t): forventet ${issue.origin ?? "value"} til å ha ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementer"}`;
76
- return `For stor(t): forventet ${issue.origin ?? "value"} til å ha ${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 `For lite(n): forventet ${issue.origin} til å ha ${adj}${issue.minimum.toString()} ${sizing.unit}`;
83
- }
84
- return `For lite(n): forventet ${issue.origin} til å ha ${adj}${issue.minimum.toString()}`;
85
- }
86
- case "invalid_format": {
87
- const _issue = issue;
88
- if (_issue.format === "starts_with")
89
- return `Ugyldig streng: må starte med "${_issue.prefix}"`;
90
- if (_issue.format === "ends_with")
91
- return `Ugyldig streng: må ende med "${_issue.suffix}"`;
92
- if (_issue.format === "includes")
93
- return `Ugyldig streng: må inneholde "${_issue.includes}"`;
94
- if (_issue.format === "regex")
95
- return `Ugyldig streng: må matche mønsteret ${_issue.pattern}`;
96
- return `Ugyldig ${Nouns[_issue.format] ?? issue.format}`;
97
- }
98
- case "not_multiple_of":
99
- return `Ugyldig tall: må være et multiplum av ${issue.divisor}`;
100
- case "unrecognized_keys":
101
- return `${issue.keys.length > 1 ? "Ukjente nøkler" : "Ukjent nøkkel"}: ${joinValues(issue.keys, ", ")}`;
102
- case "invalid_key":
103
- return `Ugyldig nøkkel i ${issue.origin}`;
104
- case "invalid_union":
105
- return "Ugyldig input";
106
- case "invalid_element":
107
- return `Ugyldig verdi i ${issue.origin}`;
108
- default:
109
- return `Ugyldig input`;
110
- }
111
- };
112
- };
113
- function no () {
114
- return {
115
- localeError: error(),
116
- };
117
- }
118
-
119
- export { no as default };