superjs-core 0.3.3 → 0.3.4

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.
@@ -0,0 +1,183 @@
1
+ // src/validation/isNIK.ts
2
+ function isNIK(value) {
3
+ const digits = value.replace(/\D/g, "");
4
+ if (digits.length !== 16) return false;
5
+ const rawDay = Number.parseInt(digits.slice(6, 8), 10);
6
+ const month = Number.parseInt(digits.slice(8, 10), 10);
7
+ const year = Number.parseInt(digits.slice(10, 12), 10);
8
+ if (rawDay < 1 || rawDay > 71) return false;
9
+ if (month < 1 || month > 12) return false;
10
+ let day = rawDay;
11
+ if (day >= 41) day -= 40;
12
+ const fullYear = year < 70 ? 2e3 + year : 1900 + year;
13
+ const date = new Date(fullYear, month - 1, day);
14
+ return date.getFullYear() === fullYear && date.getMonth() === month - 1 && date.getDate() === day;
15
+ }
16
+
17
+ // src/validation/isNPWP.ts
18
+ function isNPWP(value) {
19
+ const digits = value.replace(/\D/g, "");
20
+ if (digits.length !== 15 && digits.length !== 16) return false;
21
+ const nums = [];
22
+ for (let i = 0; i < digits.length; i++) {
23
+ nums.push(Number.parseInt(digits[i], 10));
24
+ }
25
+ const checkDigit = nums[nums.length - 1];
26
+ let sum = 0;
27
+ for (let i = 0; i < nums.length - 1; i++) {
28
+ sum += nums[i] * [3, 7, 1][i % 3];
29
+ }
30
+ const computed = (11 - sum % 11) % 10;
31
+ return computed === checkDigit;
32
+ }
33
+
34
+ // src/validation/isPhone.ts
35
+ var INDONESIAN_PREFIXES = [
36
+ [11, 19],
37
+ [21, 29],
38
+ [51, 59],
39
+ [77, 79],
40
+ [95, 99]
41
+ ];
42
+ function isValidIndonesianPrefix(prefix) {
43
+ for (const [min, max] of INDONESIAN_PREFIXES) {
44
+ if (prefix >= min && prefix <= max) return true;
45
+ }
46
+ return false;
47
+ }
48
+ function isPhone(value, country = "id") {
49
+ const digits = value.replace(/\D/g, "");
50
+ if (country === "any") {
51
+ return digits.length >= 10 && digits.length <= 15;
52
+ }
53
+ if (digits.length < 10) return false;
54
+ let normalized;
55
+ if (digits.startsWith("62")) {
56
+ normalized = digits.slice(2);
57
+ } else if (digits.startsWith("0")) {
58
+ normalized = digits.slice(1);
59
+ } else {
60
+ normalized = digits;
61
+ }
62
+ if (normalized.length < 10 || normalized.length > 13) return false;
63
+ if (!normalized.startsWith("8")) return false;
64
+ const prefix = Number.parseInt(normalized.slice(1, 3), 10);
65
+ return isValidIndonesianPrefix(prefix);
66
+ }
67
+
68
+ // src/validation/isEmail.ts
69
+ var LOCAL_SPECIAL = "!#$%&'*+/=?^_`{|}~-";
70
+ function isQuotedLocalPart(local) {
71
+ if (local.length < 2) return false;
72
+ let i = 1;
73
+ while (i < local.length - 1) {
74
+ const ch = local[i];
75
+ if (ch === "\\") {
76
+ i++;
77
+ if (i >= local.length - 1) return false;
78
+ } else if (ch === '"') {
79
+ return false;
80
+ }
81
+ i++;
82
+ }
83
+ return true;
84
+ }
85
+ function isUnquotedLocalPart(local) {
86
+ if (local.length === 0 || local.startsWith(".") || local.endsWith(".")) return false;
87
+ for (let i = 0; i < local.length; i++) {
88
+ const ch = local[i];
89
+ if (ch >= "a" && ch <= "z" || ch >= "A" && ch <= "Z" || ch >= "0" && ch <= "9" || ch === "." || LOCAL_SPECIAL.includes(ch)) {
90
+ continue;
91
+ }
92
+ return false;
93
+ }
94
+ for (let i = 1; i < local.length; i++) {
95
+ if (local[i] === "." && local[i - 1] === ".") return false;
96
+ }
97
+ return true;
98
+ }
99
+ function isValidDomain(domain) {
100
+ if (domain.length === 0 || domain.startsWith(".") || domain.endsWith(".")) return false;
101
+ const labels = domain.split(".");
102
+ if (labels.length < 2) return false;
103
+ for (const label of labels) {
104
+ if (label.length === 0 || label.length > 63) return false;
105
+ if (label.startsWith("-") || label.endsWith("-")) return false;
106
+ for (let i = 0; i < label.length; i++) {
107
+ const ch = label[i];
108
+ if (!(ch >= "a" && ch <= "z" || ch >= "A" && ch <= "Z" || ch >= "0" && ch <= "9" || ch === "-")) {
109
+ return false;
110
+ }
111
+ }
112
+ }
113
+ return true;
114
+ }
115
+ function isEmail(value) {
116
+ if (value.length > 254) return false;
117
+ const atIndex = value.lastIndexOf("@");
118
+ if (atIndex < 1 || atIndex === value.length - 1) return false;
119
+ const localPart = value.slice(0, atIndex);
120
+ const domainPart = value.slice(atIndex + 1);
121
+ if (localPart.length > 64) return false;
122
+ if (domainPart.length > 255) return false;
123
+ if (localPart.startsWith('"') && localPart.endsWith('"')) {
124
+ if (!isQuotedLocalPart(localPart)) return false;
125
+ } else {
126
+ if (!isUnquotedLocalPart(localPart)) return false;
127
+ }
128
+ return isValidDomain(domainPart);
129
+ }
130
+
131
+ // src/validation/isURL.ts
132
+ var IPV4_OCTET = /^(?:[0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/;
133
+ function isValidIPv4(hostname) {
134
+ const octets = hostname.split(".");
135
+ if (octets.length !== 4) return false;
136
+ return octets.every((octet) => IPV4_OCTET.test(octet));
137
+ }
138
+ function isValidDNSHostname(hostname) {
139
+ if (hostname.startsWith(".") || hostname.endsWith(".")) return false;
140
+ const labels = hostname.split(".");
141
+ if (labels.length < 2) return false;
142
+ for (const label of labels) {
143
+ if (label.length === 0 || label.length > 63) return false;
144
+ if (label.startsWith("-") || label.endsWith("-")) return false;
145
+ for (let i = 0; i < label.length; i++) {
146
+ const ch = label[i];
147
+ if (!(ch >= "a" && ch <= "z" || ch >= "A" && ch <= "Z" || ch >= "0" && ch <= "9" || ch === "-")) {
148
+ return false;
149
+ }
150
+ }
151
+ }
152
+ return true;
153
+ }
154
+ function isValidHostname(hostname) {
155
+ if (hostname.length === 0) return false;
156
+ if (hostname.startsWith("[") && hostname.endsWith("]")) {
157
+ return hostname.length > 2;
158
+ }
159
+ if (/^\d/.test(hostname) || /\d$/.test(hostname)) {
160
+ if (isValidIPv4(hostname)) return true;
161
+ }
162
+ if (hostname === "localhost") return true;
163
+ return isValidDNSHostname(hostname);
164
+ }
165
+ function isURL(value) {
166
+ try {
167
+ const url = new URL(value);
168
+ if (url.protocol !== "http:" && url.protocol !== "https:") {
169
+ return false;
170
+ }
171
+ return isValidHostname(url.hostname);
172
+ } catch {
173
+ return false;
174
+ }
175
+ }
176
+ export {
177
+ isEmail,
178
+ isNIK,
179
+ isNPWP,
180
+ isPhone,
181
+ isURL
182
+ };
183
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../src/validation/isNIK.ts","../../src/validation/isNPWP.ts","../../src/validation/isPhone.ts","../../src/validation/isEmail.ts","../../src/validation/isURL.ts"],"sourcesContent":["/**\n * Validates an Indonesian NIK (Nomor Induk Kependudukan / Resident Identity Number).\n *\n * A valid NIK:\n * - Must be exactly 16 digits\n * - Structure: PP CC DD DDMMYY SSSS\n * - PP: Province code (2 digits)\n * - CC: City code (2 digits)\n * - DD: District code (2 digits)\n * - DDMMYY: Birth date (6 digits; for women the day is incremented by 40)\n * - SSSS: Serial number (4 digits)\n * - The birth date must correspond to a valid calendar date\n *\n * @param value - The NIK string (digits only or with dots)\n * @returns `true` if the value is a valid NIK\n *\n * @example isNIK('3201010203940001') // => true (male, born 2 March 1994)\n * @example isNIK('3201015203940001') // => true (female, born 12 March 1994)\n * @example isNIK('1234567890123456') // => false (invalid birth date)\n * @example isNIK('320101') // => false (too short)\n */\nexport function isNIK(value: string): boolean {\n const digits = value.replace(/\\D/g, '')\n if (digits.length !== 16) return false\n\n const rawDay = Number.parseInt(digits.slice(6, 8), 10)\n const month = Number.parseInt(digits.slice(8, 10), 10)\n const year = Number.parseInt(digits.slice(10, 12), 10)\n\n if (rawDay < 1 || rawDay > 71) return false\n if (month < 1 || month > 12) return false\n\n let day = rawDay\n if (day >= 41) day -= 40\n\n const fullYear = year < 70 ? 2000 + year : 1900 + year\n const date = new Date(fullYear, month - 1, day)\n\n return (\n date.getFullYear() === fullYear &&\n date.getMonth() === month - 1 &&\n date.getDate() === day\n )\n}\n","/**\n * Validates an Indonesian NPWP (Nomor Pokok Wajib Pajak / Tax Identification Number).\n *\n * A valid NPWP:\n * - Must be 15 or 16 digits (formatted: `XX.XXX.XXX.X-XXX.XXX` or plain digits)\n * - The last digit is a checksum computed from the preceding digits\n *\n * The checksum uses a weighted-sum algorithm with a repeating weight pattern of\n * `[3, 7, 1]`. The computed checksum must equal the last digit.\n *\n * @param value - The NPWP string (formatted with dots & dash, or plain digits)\n * @returns `true` if the value is a valid NPWP\n *\n * @example isNPWP('12.345.678.9-012.344') // => true\n * @example isNPWP('123456789012344') // => true (plain digits)\n * @example isNPWP('12.345.678.9-012.345') // => false (invalid checksum)\n */\nexport function isNPWP(value: string): boolean {\n const digits = value.replace(/\\D/g, '')\n if (digits.length !== 15 && digits.length !== 16) return false\n\n const nums: number[] = []\n for (let i = 0; i < digits.length; i++) {\n nums.push(Number.parseInt(digits[i]!, 10))\n }\n\n const checkDigit = nums[nums.length - 1]!\n\n let sum = 0\n for (let i = 0; i < nums.length - 1; i++) {\n sum += nums[i]! * [3, 7, 1][i % 3]!\n }\n\n const computed = (11 - (sum % 11)) % 10\n return computed === checkDigit\n}\n","const INDONESIAN_PREFIXES: ReadonlyArray<[number, number]> = [\n [11, 19],\n [21, 29],\n [51, 59],\n [77, 79],\n [95, 99],\n]\n\nfunction isValidIndonesianPrefix(prefix: number): boolean {\n for (const [min, max] of INDONESIAN_PREFIXES) {\n if (prefix >= min && prefix <= max) return true\n }\n return false\n}\n\n/**\n * Validates a phone number.\n *\n * For Indonesian numbers (`country = 'id'`):\n * - Accepted formats: `08xx…`, `+628xx…`, `628xx…`\n * - Must start with a valid operator prefix:\n * 0811-0819, 0821-0829, 0851-0859, 0877-0879, 0895-0899\n * - 10–13 digits after the country code\n *\n * For generic numbers (`country = 'any'`):\n * - Any string with 10–15 digits is accepted\n *\n * @param value - The phone number string\n * @param country - Country to validate against (`'id'` or `'any'`; default `'id'`)\n * @returns `true` if the value is a valid phone number\n *\n * @example isPhone('08123456789') // => true\n * @example isPhone('+628123456789') // => true\n * @example isPhone('628123456789') // => true\n * @example isPhone('081234567') // => false (too short)\n * @example isPhone('089123456789') // => false (invalid prefix 91)\n */\nexport function isPhone(value: string, country: 'id' | 'any' = 'id'): boolean {\n const digits = value.replace(/\\D/g, '')\n\n if (country === 'any') {\n return digits.length >= 10 && digits.length <= 15\n }\n\n if (digits.length < 10) return false\n\n let normalized: string\n if (digits.startsWith('62')) {\n normalized = digits.slice(2)\n } else if (digits.startsWith('0')) {\n normalized = digits.slice(1)\n } else {\n normalized = digits\n }\n\n if (normalized.length < 10 || normalized.length > 13) return false\n if (!normalized.startsWith('8')) return false\n\n const prefix = Number.parseInt(normalized.slice(1, 3), 10)\n return isValidIndonesianPrefix(prefix)\n}\n","const LOCAL_SPECIAL = \"!#$%&'*+/=?^_`{|}~-\"\n\nfunction isQuotedLocalPart(local: string): boolean {\n if (local.length < 2) return false\n let i = 1\n while (i < local.length - 1) {\n const ch = local[i]!\n if (ch === '\\\\') {\n i++\n if (i >= local.length - 1) return false\n } else if (ch === '\"') {\n return false\n }\n i++\n }\n return true\n}\n\nfunction isUnquotedLocalPart(local: string): boolean {\n if (local.length === 0 || local.startsWith('.') || local.endsWith('.')) return false\n\n for (let i = 0; i < local.length; i++) {\n const ch = local[i]!\n if (\n (ch >= 'a' && ch <= 'z') ||\n (ch >= 'A' && ch <= 'Z') ||\n (ch >= '0' && ch <= '9') ||\n ch === '.' ||\n LOCAL_SPECIAL.includes(ch)\n ) {\n continue\n }\n return false\n }\n\n for (let i = 1; i < local.length; i++) {\n if (local[i] === '.' && local[i - 1] === '.') return false\n }\n\n return true\n}\n\nfunction isValidDomain(domain: string): boolean {\n if (domain.length === 0 || domain.startsWith('.') || domain.endsWith('.')) return false\n\n const labels = domain.split('.')\n if (labels.length < 2) return false\n\n for (const label of labels) {\n if (label.length === 0 || label.length > 63) return false\n if (label.startsWith('-') || label.endsWith('-')) return false\n\n for (let i = 0; i < label.length; i++) {\n const ch = label[i]!\n if (\n !(\n (ch >= 'a' && ch <= 'z') ||\n (ch >= 'A' && ch <= 'Z') ||\n (ch >= '0' && ch <= '9') ||\n ch === '-'\n )\n ) {\n return false\n }\n }\n }\n\n return true\n}\n\n/**\n * RFC‑compliant email address validation.\n *\n * Validation rules:\n * - Total length ≤ 254 characters\n * - Local part ≤ 64 characters; supports quoted strings (including escaped\n * characters), unquoted letters / digits / `!#$%&'*+/=?^_`{|}~-`, and dots\n * (no leading, trailing, or consecutive dots)\n * - Domain part ≤ 255 characters; valid DNS labels separated by dots, each\n * label ≤ 63 characters, no leading/trailing hyphens, at least two labels\n *\n * @param value - The email address string\n * @returns `true` if the value is a syntactically valid email address\n *\n * @example isEmail('user@example.com') // => true\n * @example isEmail('user.name+tag@example.co.id') // => true\n * @example isEmail('\"quoted@local\"@example.com') // => true\n * @example isEmail('not-an-email') // => false\n */\nexport function isEmail(value: string): boolean {\n if (value.length > 254) return false\n\n const atIndex = value.lastIndexOf('@')\n if (atIndex < 1 || atIndex === value.length - 1) return false\n\n const localPart = value.slice(0, atIndex)\n const domainPart = value.slice(atIndex + 1)\n\n if (localPart.length > 64) return false\n if (domainPart.length > 255) return false\n\n if (localPart.startsWith('\"') && localPart.endsWith('\"')) {\n if (!isQuotedLocalPart(localPart)) return false\n } else {\n if (!isUnquotedLocalPart(localPart)) return false\n }\n\n return isValidDomain(domainPart)\n}\n","const IPV4_OCTET = /^(?:[0-9]|[1-9][0-9]|1[0-9]{2}|2[0-4][0-9]|25[0-5])$/\n\nfunction isValidIPv4(hostname: string): boolean {\n const octets = hostname.split('.')\n if (octets.length !== 4) return false\n return octets.every(octet => IPV4_OCTET.test(octet))\n}\n\nfunction isValidDNSHostname(hostname: string): boolean {\n if (hostname.startsWith('.') || hostname.endsWith('.')) return false\n\n const labels = hostname.split('.')\n if (labels.length < 2) return false\n\n for (const label of labels) {\n if (label.length === 0 || label.length > 63) return false\n if (label.startsWith('-') || label.endsWith('-')) return false\n\n for (let i = 0; i < label.length; i++) {\n const ch = label[i]!\n if (\n !(\n (ch >= 'a' && ch <= 'z') ||\n (ch >= 'A' && ch <= 'Z') ||\n (ch >= '0' && ch <= '9') ||\n ch === '-'\n )\n ) {\n return false\n }\n }\n }\n\n return true\n}\n\nfunction isValidHostname(hostname: string): boolean {\n if (hostname.length === 0) return false\n\n // IPv6 literal\n if (hostname.startsWith('[') && hostname.endsWith(']')) {\n return hostname.length > 2\n }\n\n // IPv4\n if (/^\\d/.test(hostname) || /\\d$/.test(hostname)) {\n if (isValidIPv4(hostname)) return true\n }\n\n // localhost\n if (hostname === 'localhost') return true\n\n // DNS hostname\n return isValidDNSHostname(hostname)\n}\n\n/**\n * Validates a URL.\n *\n * A valid URL:\n * - Must use the `http` or `https` protocol\n * - Must have a valid hostname (DNS name, IPv4, IPv6 literal, or `localhost`)\n * - May include an optional port, path, query string, and fragment\n *\n * @param value - The URL string\n * @returns `true` if the value is a valid http/https URL\n *\n * @example isURL('https://example.com') // => true\n * @example isURL('http://example.com:8080/path?q=1#f') // => true\n * @example isURL('ftp://example.com') // => false\n * @example isURL('not-a-url') // => false\n */\nexport function isURL(value: string): boolean {\n try {\n const url = new URL(value)\n\n if (url.protocol !== 'http:' && url.protocol !== 'https:') {\n return false\n }\n\n return isValidHostname(url.hostname)\n } catch {\n return false\n }\n}\n"],"mappings":";AAqBO,SAAS,MAAM,OAAwB;AAC5C,QAAM,SAAS,MAAM,QAAQ,OAAO,EAAE;AACtC,MAAI,OAAO,WAAW,GAAI,QAAO;AAEjC,QAAM,SAAS,OAAO,SAAS,OAAO,MAAM,GAAG,CAAC,GAAG,EAAE;AACrD,QAAM,QAAQ,OAAO,SAAS,OAAO,MAAM,GAAG,EAAE,GAAG,EAAE;AACrD,QAAM,OAAO,OAAO,SAAS,OAAO,MAAM,IAAI,EAAE,GAAG,EAAE;AAErD,MAAI,SAAS,KAAK,SAAS,GAAI,QAAO;AACtC,MAAI,QAAQ,KAAK,QAAQ,GAAI,QAAO;AAEpC,MAAI,MAAM;AAC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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "superjs-core",
3
- "version": "0.3.3",
3
+ "version": "0.3.4",
4
4
  "description": "Zero-dependency JavaScript standard library + dependency health scanner — core, math, date, collection, string, async, io, type, crypto, path & dep-exray",
5
5
  "type": "module",
6
6
  "main": "./dist/index.js",
@@ -81,6 +81,22 @@
81
81
  "./dep-exray/cli": {
82
82
  "import": "./dist/dep-exray/cli.js",
83
83
  "types": "./dist/dep-exray/cli.d.ts"
84
+ },
85
+ "./validation": {
86
+ "import": "./dist/validation/index.js",
87
+ "types": "./dist/validation/index.d.ts"
88
+ },
89
+ "./error": {
90
+ "import": "./dist/error/index.js",
91
+ "types": "./dist/error/index.d.ts"
92
+ },
93
+ "./logger": {
94
+ "import": "./dist/logger/index.js",
95
+ "types": "./dist/logger/index.d.ts"
96
+ },
97
+ "./logger/transports": {
98
+ "import": "./dist/logger/transports.js",
99
+ "types": "./dist/logger/transports.d.ts"
84
100
  }
85
101
  },
86
102
  "sideEffects": false,