@utilix-tech/sdk 0.9.0 → 0.10.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/CHANGELOG.md +3 -0
- package/README.md +11 -3
- package/dist/{chunk-LI5AME5R.js → chunk-OB56VNKJ.js} +85 -1
- package/dist/{chunk-QJE743LY.js → chunk-YVFM5WYI.js} +62 -1
- package/dist/index.cjs +145 -0
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +2 -2
- package/dist/{network-Cy02-FIO.d.cts → network-DaNoZ5ER.d.cts} +39 -2
- package/dist/{network-Cy02-FIO.d.ts → network-DaNoZ5ER.d.ts} +39 -2
- package/dist/tools/network.cjs +84 -0
- package/dist/tools/network.d.cts +1 -1
- package/dist/tools/network.d.ts +1 -1
- package/dist/tools/network.js +1 -1
- package/dist/tools/units.cjs +61 -0
- package/dist/tools/units.d.cts +1 -1
- package/dist/tools/units.d.ts +1 -1
- package/dist/tools/units.js +1 -1
- package/dist/{units-6lwDYBvX.d.cts → units-DRT6W-vu.d.cts} +19 -2
- package/dist/{units-6lwDYBvX.d.ts → units-DRT6W-vu.d.ts} +19 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,9 @@
|
|
|
2
2
|
|
|
3
3
|
Full release notes for all Utilix surfaces (browser tools, REST API, SDKs, MCP server) live at [utilix.tech/changelog](https://utilix.tech/changelog). This file tracks just this package.
|
|
4
4
|
|
|
5
|
+
## 0.10.0
|
|
6
|
+
- Added robots.txt Validator and Credit Card Number Validator.
|
|
7
|
+
|
|
5
8
|
## 0.9.0
|
|
6
9
|
- Added Sitemap.xml Validator.
|
|
7
10
|
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @utilix-tech/sdk
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**531 developer utility functions for Node.js: runs locally, no API key required.**
|
|
4
4
|
|
|
5
5
|
[](https://www.npmjs.com/package/@utilix-tech/sdk)
|
|
6
6
|
[](https://www.npmjs.com/package/@utilix-tech/sdk)
|
|
@@ -242,7 +242,7 @@ getNextRuns("*/5 * * * *", 5); // next 5 run timestamps
|
|
|
242
242
|
### `/units`: Conversions
|
|
243
243
|
|
|
244
244
|
```ts
|
|
245
|
-
import { convertBytes, pxToAll, convert, formatValue } from "@utilix-tech/sdk/units";
|
|
245
|
+
import { convertBytes, pxToAll, convert, formatValue, validateCardNumber } from "@utilix-tech/sdk/units";
|
|
246
246
|
|
|
247
247
|
// File sizes
|
|
248
248
|
convertBytes(1073741824, "GB"); // 1
|
|
@@ -260,6 +260,10 @@ convert("11111111", 2, 10); // "255"
|
|
|
260
260
|
// Currency / locale formatting
|
|
261
261
|
formatValue(1234567.89, { locale: "en-US", currency: "USD" });
|
|
262
262
|
// "$1,234,567.89"
|
|
263
|
+
|
|
264
|
+
// Credit card Luhn checksum + network detection
|
|
265
|
+
validateCardNumber("4111 1111 1111 1111");
|
|
266
|
+
// { valid: true, network: "Visa", length: 16, formatted: "4111 1111 1111 1111" }
|
|
263
267
|
```
|
|
264
268
|
|
|
265
269
|
---
|
|
@@ -269,7 +273,7 @@ formatValue(1234567.89, { locale: "en-US", currency: "USD" });
|
|
|
269
273
|
```ts
|
|
270
274
|
import { getStatusCode, isValidIp, isValidIpv4, isValidIpv6,
|
|
271
275
|
searchStatusCodes, buildGeoUrl, countryCodeToFlag,
|
|
272
|
-
parseHar, validateSitemap } from "@utilix-tech/sdk/network";
|
|
276
|
+
parseHar, validateSitemap, validateRobotsTxt } from "@utilix-tech/sdk/network";
|
|
273
277
|
|
|
274
278
|
getStatusCode(404);
|
|
275
279
|
// { code: 404, text: "Not Found", description: "...", category: "Client Error" }
|
|
@@ -290,6 +294,10 @@ parseHar(har);
|
|
|
290
294
|
// Validate a sitemap.xml (or sitemap index) against the sitemaps.org protocol
|
|
291
295
|
validateSitemap('<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><url><loc>https://example.com/</loc></url></urlset>');
|
|
292
296
|
// { type: "urlset", urlCount: 1, entries: [...], issues: [...], valid: true }
|
|
297
|
+
|
|
298
|
+
// Validate a robots.txt file: User-agent groups, rules, and syntax mistakes
|
|
299
|
+
validateRobotsTxt("User-agent: *\nDisallow: /admin\nSitemap: https://example.com/sitemap.xml");
|
|
300
|
+
// { groups: [...], sitemaps: [...], issues: [...], valid: true }
|
|
293
301
|
```
|
|
294
302
|
|
|
295
303
|
---
|
|
@@ -33,6 +33,7 @@ __export(network_exports, {
|
|
|
33
33
|
validateDomain: () => validateDomain,
|
|
34
34
|
validateHeaderName: () => validateHeaderName,
|
|
35
35
|
validateHeaderValue: () => validateHeaderValue,
|
|
36
|
+
validateRobotsTxt: () => validateRobotsTxt,
|
|
36
37
|
validateSitemap: () => validateSitemap
|
|
37
38
|
});
|
|
38
39
|
var DNS_RECORD_TYPES = ["A", "AAAA", "CNAME", "MX", "TXT", "NS", "SOA", "PTR", "SRV", "CAA"];
|
|
@@ -1531,5 +1532,88 @@ function validateSitemap(xml) {
|
|
|
1531
1532
|
const valid = !issues.some((i) => i.severity === "error");
|
|
1532
1533
|
return { type, urlCount: entries.length, entries, issues, valid };
|
|
1533
1534
|
}
|
|
1535
|
+
var KNOWN_ROBOTS_DIRECTIVES = /* @__PURE__ */ new Set(["user-agent", "disallow", "allow", "sitemap", "crawl-delay", "host"]);
|
|
1536
|
+
function validateRobotsTxt(text) {
|
|
1537
|
+
if (!text || !text.trim()) return { error: "Input is empty" };
|
|
1538
|
+
const lines = text.split("\n");
|
|
1539
|
+
const issues = [];
|
|
1540
|
+
const groups = [];
|
|
1541
|
+
const sitemaps = [];
|
|
1542
|
+
let currentGroup = null;
|
|
1543
|
+
for (let i = 0; i < lines.length; i++) {
|
|
1544
|
+
const rawLine = lines[i];
|
|
1545
|
+
const lineNum = i + 1;
|
|
1546
|
+
const commentIdx = rawLine.indexOf("#");
|
|
1547
|
+
const line = (commentIdx >= 0 ? rawLine.slice(0, commentIdx) : rawLine).trim();
|
|
1548
|
+
if (!line) continue;
|
|
1549
|
+
const colonIdx = line.indexOf(":");
|
|
1550
|
+
if (colonIdx === -1) {
|
|
1551
|
+
issues.push({ severity: "error", line: lineNum, message: `Malformed line (missing ':'): "${line}"` });
|
|
1552
|
+
continue;
|
|
1553
|
+
}
|
|
1554
|
+
const directive = line.slice(0, colonIdx).trim().toLowerCase();
|
|
1555
|
+
const value = line.slice(colonIdx + 1).trim();
|
|
1556
|
+
if (!KNOWN_ROBOTS_DIRECTIVES.has(directive)) {
|
|
1557
|
+
issues.push({ severity: "warning", line: lineNum, message: `Unknown directive "${directive}"` });
|
|
1558
|
+
continue;
|
|
1559
|
+
}
|
|
1560
|
+
if (directive === "sitemap") {
|
|
1561
|
+
if (!/^https?:\/\//i.test(value)) {
|
|
1562
|
+
issues.push({ severity: "error", line: lineNum, message: `Sitemap URL "${value}" must be absolute (start with http:// or https://)` });
|
|
1563
|
+
}
|
|
1564
|
+
sitemaps.push(value);
|
|
1565
|
+
continue;
|
|
1566
|
+
}
|
|
1567
|
+
if (directive === "user-agent") {
|
|
1568
|
+
if (!value) {
|
|
1569
|
+
issues.push({ severity: "error", line: lineNum, message: "User-agent directive is missing a value" });
|
|
1570
|
+
}
|
|
1571
|
+
if (currentGroup && currentGroup.rules.length === 0 && currentGroup.crawlDelay === void 0) {
|
|
1572
|
+
currentGroup.userAgents.push(value);
|
|
1573
|
+
} else {
|
|
1574
|
+
currentGroup = { userAgents: [value], rules: [], line: lineNum };
|
|
1575
|
+
groups.push(currentGroup);
|
|
1576
|
+
}
|
|
1577
|
+
continue;
|
|
1578
|
+
}
|
|
1579
|
+
if (!currentGroup) {
|
|
1580
|
+
issues.push({ severity: "error", line: lineNum, message: `"${directive}" directive found before any User-agent line` });
|
|
1581
|
+
continue;
|
|
1582
|
+
}
|
|
1583
|
+
if (directive === "disallow" || directive === "allow") {
|
|
1584
|
+
if (value !== "" && !value.startsWith("/") && !value.startsWith("*")) {
|
|
1585
|
+
issues.push({ severity: "warning", line: lineNum, message: `${directive === "disallow" ? "Disallow" : "Allow"} value "${value}" should start with "/" (or be empty)` });
|
|
1586
|
+
}
|
|
1587
|
+
if (currentGroup.rules.some((r) => r.type === directive && r.value === value)) {
|
|
1588
|
+
issues.push({ severity: "warning", line: lineNum, message: `Duplicate ${directive} rule for "${value}" in this group` });
|
|
1589
|
+
}
|
|
1590
|
+
currentGroup.rules.push({ type: directive, value, line: lineNum });
|
|
1591
|
+
} else if (directive === "crawl-delay") {
|
|
1592
|
+
const n = Number(value);
|
|
1593
|
+
if (Number.isNaN(n) || n < 0) {
|
|
1594
|
+
issues.push({ severity: "error", line: lineNum, message: `Crawl-delay "${value}" must be a non-negative number` });
|
|
1595
|
+
} else {
|
|
1596
|
+
currentGroup.crawlDelay = n;
|
|
1597
|
+
}
|
|
1598
|
+
}
|
|
1599
|
+
}
|
|
1600
|
+
if (groups.length === 0) {
|
|
1601
|
+
issues.push({ severity: "error", line: 1, message: "No User-agent groups found" });
|
|
1602
|
+
}
|
|
1603
|
+
const seenUA = /* @__PURE__ */ new Map();
|
|
1604
|
+
for (const g of groups) {
|
|
1605
|
+
for (const ua of g.userAgents) {
|
|
1606
|
+
const key = ua.toLowerCase();
|
|
1607
|
+
const firstLine = seenUA.get(key);
|
|
1608
|
+
if (firstLine !== void 0) {
|
|
1609
|
+
issues.push({ severity: "warning", line: g.line, message: `Duplicate User-agent "${ua}" (first seen on line ${firstLine})` });
|
|
1610
|
+
} else {
|
|
1611
|
+
seenUA.set(key, g.line);
|
|
1612
|
+
}
|
|
1613
|
+
}
|
|
1614
|
+
}
|
|
1615
|
+
const valid = !issues.some((i) => i.severity === "error");
|
|
1616
|
+
return { groups, sitemaps, issues, valid };
|
|
1617
|
+
}
|
|
1534
1618
|
|
|
1535
|
-
export { DNS_RECORD_TYPES, HTTP_HEADERS, STATUS_CODES, buildDnsQueryUrl, buildGeoUrl, buildMapUrl, countryCodeToFlag, formatCoordinates, formatTtl, getByCategory, getHeader, getHeadersByCategory, getStatusByCategory, getStatusCode, isClientError, isServerError, isSuccess, isValidIp, isValidIpv4, isValidIpv6, network_exports, parseDnsResponse, parseGeoResponse, parseHar, searchHeaders, searchStatusCodes, statusCodeToText, typeNumberToLabel, validateDomain, validateHeaderName, validateHeaderValue, validateSitemap };
|
|
1619
|
+
export { DNS_RECORD_TYPES, HTTP_HEADERS, STATUS_CODES, buildDnsQueryUrl, buildGeoUrl, buildMapUrl, countryCodeToFlag, formatCoordinates, formatTtl, getByCategory, getHeader, getHeadersByCategory, getStatusByCategory, getStatusCode, isClientError, isServerError, isSuccess, isValidIp, isValidIpv4, isValidIpv6, network_exports, parseDnsResponse, parseGeoResponse, parseHar, searchHeaders, searchStatusCodes, statusCodeToText, typeNumberToLabel, validateDomain, validateHeaderName, validateHeaderValue, validateRobotsTxt, validateSitemap };
|
|
@@ -60,6 +60,7 @@ __export(units_exports, {
|
|
|
60
60
|
sortVersions: () => sortVersions,
|
|
61
61
|
splitSubnet: () => splitSubnet,
|
|
62
62
|
symbolicToPermissions: () => symbolicToPermissions,
|
|
63
|
+
validateCardNumber: () => validateCardNumber,
|
|
63
64
|
viewportToPx: () => viewportToPx
|
|
64
65
|
});
|
|
65
66
|
function pxToAll(px, baseFontSize = 16, viewportWidth = 1440, viewportHeight = 900) {
|
|
@@ -892,5 +893,65 @@ function sortVersions(versions, order = "asc") {
|
|
|
892
893
|
return order === "asc" ? cmp : -cmp;
|
|
893
894
|
});
|
|
894
895
|
}
|
|
896
|
+
var CARD_NETWORK_RULES = [
|
|
897
|
+
{ name: "American Express", lengths: [15], test: (d) => /^3[47]/.test(d) },
|
|
898
|
+
{ name: "Diners Club", lengths: [14], test: (d) => /^3(?:0[0-5]|[68])/.test(d) },
|
|
899
|
+
{
|
|
900
|
+
name: "Discover",
|
|
901
|
+
lengths: [16, 19],
|
|
902
|
+
test: (d) => /^(?:6011|65|64[4-9])/.test(d) || /^622(?:12[6-9]|1[3-9]\d|[2-8]\d{2}|9[01]\d|92[0-5])/.test(d)
|
|
903
|
+
},
|
|
904
|
+
{ name: "JCB", lengths: [16], test: (d) => /^35(?:2[89]|[3-8]\d)/.test(d) },
|
|
905
|
+
{
|
|
906
|
+
name: "Mastercard",
|
|
907
|
+
lengths: [16],
|
|
908
|
+
test: (d) => {
|
|
909
|
+
const two = parseInt(d.slice(0, 2), 10);
|
|
910
|
+
const four = parseInt(d.slice(0, 4), 10);
|
|
911
|
+
return two >= 51 && two <= 55 || four >= 2221 && four <= 2720;
|
|
912
|
+
}
|
|
913
|
+
},
|
|
914
|
+
{ name: "Maestro", lengths: [12, 13, 14, 15, 16, 17, 18, 19], test: (d) => /^(?:50|5[6-8]|6304|6390|67)/.test(d) },
|
|
915
|
+
{ name: "UnionPay", lengths: [16, 17, 18, 19], test: (d) => /^62/.test(d) },
|
|
916
|
+
{ name: "Visa", lengths: [13, 16, 19], test: (d) => /^4/.test(d) }
|
|
917
|
+
];
|
|
918
|
+
function luhnCheck(digits) {
|
|
919
|
+
let sum = 0;
|
|
920
|
+
let shouldDouble = false;
|
|
921
|
+
for (let i = digits.length - 1; i >= 0; i--) {
|
|
922
|
+
let d = parseInt(digits[i], 10);
|
|
923
|
+
if (shouldDouble) {
|
|
924
|
+
d *= 2;
|
|
925
|
+
if (d > 9) d -= 9;
|
|
926
|
+
}
|
|
927
|
+
sum += d;
|
|
928
|
+
shouldDouble = !shouldDouble;
|
|
929
|
+
}
|
|
930
|
+
return sum % 10 === 0;
|
|
931
|
+
}
|
|
932
|
+
function detectCardNetwork(digits) {
|
|
933
|
+
for (const rule of CARD_NETWORK_RULES) {
|
|
934
|
+
if (rule.lengths.includes(digits.length) && rule.test(digits)) return rule.name;
|
|
935
|
+
}
|
|
936
|
+
return null;
|
|
937
|
+
}
|
|
938
|
+
function formatCardNumber(digits, network) {
|
|
939
|
+
if (network === "American Express") {
|
|
940
|
+
return `${digits.slice(0, 4)} ${digits.slice(4, 10)} ${digits.slice(10)}`.trim();
|
|
941
|
+
}
|
|
942
|
+
return digits.match(/.{1,4}/g)?.join(" ") ?? digits;
|
|
943
|
+
}
|
|
944
|
+
function validateCardNumber(input) {
|
|
945
|
+
if (!input || !input.trim()) return { error: "Input is empty" };
|
|
946
|
+
const digits = input.replace(/[\s-]/g, "");
|
|
947
|
+
if (!/^\d+$/.test(digits)) return { error: "Card number must contain only digits, spaces, or hyphens" };
|
|
948
|
+
if (digits.length < 12 || digits.length > 19) {
|
|
949
|
+
return { error: `Card number length (${digits.length}) is outside the valid range of 12-19 digits` };
|
|
950
|
+
}
|
|
951
|
+
const valid = luhnCheck(digits);
|
|
952
|
+
const network = detectCardNetwork(digits);
|
|
953
|
+
const formatted = formatCardNumber(digits, network);
|
|
954
|
+
return { valid, network, length: digits.length, formatted };
|
|
955
|
+
}
|
|
895
956
|
|
|
896
|
-
export { BASE_LABELS, BASE_PREFIXES, BYTE_UNITS, COMMON_CURRENCIES, COMMON_LOCALES, COMMON_PERMISSIONS, COMMON_RATIOS, COMMON_SIZES, COMMON_VIEWPORTS, autoFormat, bumpVersion, calcAspectRatio, calcSubnet, compareSemver, convert, convertBytes, convertIp, coverBox, decimalToIp, decimalToIpCidr, describePermissions, fitIntoBox, formatNumber, formatValue, formatVwValue, formatWithSeparator, gcd, ipFromBinary, ipFromDecimal, ipFromHex, ipToBinary, ipToDecimal, ipToDecimalCidr, ipToHex, ipToOctal, isValid, isValidCidr, isValidIp, isValidIpv4, octalToPermissions, parseFileSize, parseInput, parseNumberString, parseSemver, permissionsToChmod, permissionsToOctal, permissionsToSymbolic, ptToPx, pxToAll, pxToViewport, remToPx, satisfiesRange, scaleByHeight, scaleByWidth, sortVersions, splitSubnet, symbolicToPermissions, units_exports, viewportToPx };
|
|
957
|
+
export { BASE_LABELS, BASE_PREFIXES, BYTE_UNITS, COMMON_CURRENCIES, COMMON_LOCALES, COMMON_PERMISSIONS, COMMON_RATIOS, COMMON_SIZES, COMMON_VIEWPORTS, autoFormat, bumpVersion, calcAspectRatio, calcSubnet, compareSemver, convert, convertBytes, convertIp, coverBox, decimalToIp, decimalToIpCidr, describePermissions, fitIntoBox, formatNumber, formatValue, formatVwValue, formatWithSeparator, gcd, ipFromBinary, ipFromDecimal, ipFromHex, ipToBinary, ipToDecimal, ipToDecimalCidr, ipToHex, ipToOctal, isValid, isValidCidr, isValidIp, isValidIpv4, octalToPermissions, parseFileSize, parseInput, parseNumberString, parseSemver, permissionsToChmod, permissionsToOctal, permissionsToSymbolic, ptToPx, pxToAll, pxToViewport, remToPx, satisfiesRange, scaleByHeight, scaleByWidth, sortVersions, splitSubnet, symbolicToPermissions, units_exports, validateCardNumber, viewportToPx };
|
package/dist/index.cjs
CHANGED
|
@@ -6665,6 +6665,7 @@ __export(units_exports, {
|
|
|
6665
6665
|
sortVersions: () => sortVersions,
|
|
6666
6666
|
splitSubnet: () => splitSubnet,
|
|
6667
6667
|
symbolicToPermissions: () => symbolicToPermissions,
|
|
6668
|
+
validateCardNumber: () => validateCardNumber,
|
|
6668
6669
|
viewportToPx: () => viewportToPx
|
|
6669
6670
|
});
|
|
6670
6671
|
function pxToAll(px, baseFontSize = 16, viewportWidth = 1440, viewportHeight = 900) {
|
|
@@ -7497,6 +7498,66 @@ function sortVersions(versions, order = "asc") {
|
|
|
7497
7498
|
return order === "asc" ? cmp : -cmp;
|
|
7498
7499
|
});
|
|
7499
7500
|
}
|
|
7501
|
+
var CARD_NETWORK_RULES = [
|
|
7502
|
+
{ name: "American Express", lengths: [15], test: (d) => /^3[47]/.test(d) },
|
|
7503
|
+
{ name: "Diners Club", lengths: [14], test: (d) => /^3(?:0[0-5]|[68])/.test(d) },
|
|
7504
|
+
{
|
|
7505
|
+
name: "Discover",
|
|
7506
|
+
lengths: [16, 19],
|
|
7507
|
+
test: (d) => /^(?:6011|65|64[4-9])/.test(d) || /^622(?:12[6-9]|1[3-9]\d|[2-8]\d{2}|9[01]\d|92[0-5])/.test(d)
|
|
7508
|
+
},
|
|
7509
|
+
{ name: "JCB", lengths: [16], test: (d) => /^35(?:2[89]|[3-8]\d)/.test(d) },
|
|
7510
|
+
{
|
|
7511
|
+
name: "Mastercard",
|
|
7512
|
+
lengths: [16],
|
|
7513
|
+
test: (d) => {
|
|
7514
|
+
const two = parseInt(d.slice(0, 2), 10);
|
|
7515
|
+
const four = parseInt(d.slice(0, 4), 10);
|
|
7516
|
+
return two >= 51 && two <= 55 || four >= 2221 && four <= 2720;
|
|
7517
|
+
}
|
|
7518
|
+
},
|
|
7519
|
+
{ name: "Maestro", lengths: [12, 13, 14, 15, 16, 17, 18, 19], test: (d) => /^(?:50|5[6-8]|6304|6390|67)/.test(d) },
|
|
7520
|
+
{ name: "UnionPay", lengths: [16, 17, 18, 19], test: (d) => /^62/.test(d) },
|
|
7521
|
+
{ name: "Visa", lengths: [13, 16, 19], test: (d) => /^4/.test(d) }
|
|
7522
|
+
];
|
|
7523
|
+
function luhnCheck(digits) {
|
|
7524
|
+
let sum = 0;
|
|
7525
|
+
let shouldDouble = false;
|
|
7526
|
+
for (let i = digits.length - 1; i >= 0; i--) {
|
|
7527
|
+
let d = parseInt(digits[i], 10);
|
|
7528
|
+
if (shouldDouble) {
|
|
7529
|
+
d *= 2;
|
|
7530
|
+
if (d > 9) d -= 9;
|
|
7531
|
+
}
|
|
7532
|
+
sum += d;
|
|
7533
|
+
shouldDouble = !shouldDouble;
|
|
7534
|
+
}
|
|
7535
|
+
return sum % 10 === 0;
|
|
7536
|
+
}
|
|
7537
|
+
function detectCardNetwork(digits) {
|
|
7538
|
+
for (const rule of CARD_NETWORK_RULES) {
|
|
7539
|
+
if (rule.lengths.includes(digits.length) && rule.test(digits)) return rule.name;
|
|
7540
|
+
}
|
|
7541
|
+
return null;
|
|
7542
|
+
}
|
|
7543
|
+
function formatCardNumber(digits, network) {
|
|
7544
|
+
if (network === "American Express") {
|
|
7545
|
+
return `${digits.slice(0, 4)} ${digits.slice(4, 10)} ${digits.slice(10)}`.trim();
|
|
7546
|
+
}
|
|
7547
|
+
return digits.match(/.{1,4}/g)?.join(" ") ?? digits;
|
|
7548
|
+
}
|
|
7549
|
+
function validateCardNumber(input) {
|
|
7550
|
+
if (!input || !input.trim()) return { error: "Input is empty" };
|
|
7551
|
+
const digits = input.replace(/[\s-]/g, "");
|
|
7552
|
+
if (!/^\d+$/.test(digits)) return { error: "Card number must contain only digits, spaces, or hyphens" };
|
|
7553
|
+
if (digits.length < 12 || digits.length > 19) {
|
|
7554
|
+
return { error: `Card number length (${digits.length}) is outside the valid range of 12-19 digits` };
|
|
7555
|
+
}
|
|
7556
|
+
const valid = luhnCheck(digits);
|
|
7557
|
+
const network = detectCardNetwork(digits);
|
|
7558
|
+
const formatted = formatCardNumber(digits, network);
|
|
7559
|
+
return { valid, network, length: digits.length, formatted };
|
|
7560
|
+
}
|
|
7500
7561
|
|
|
7501
7562
|
// src/tools/network.ts
|
|
7502
7563
|
var network_exports = {};
|
|
@@ -7531,6 +7592,7 @@ __export(network_exports, {
|
|
|
7531
7592
|
validateDomain: () => validateDomain,
|
|
7532
7593
|
validateHeaderName: () => validateHeaderName,
|
|
7533
7594
|
validateHeaderValue: () => validateHeaderValue,
|
|
7595
|
+
validateRobotsTxt: () => validateRobotsTxt,
|
|
7534
7596
|
validateSitemap: () => validateSitemap
|
|
7535
7597
|
});
|
|
7536
7598
|
var DNS_RECORD_TYPES = ["A", "AAAA", "CNAME", "MX", "TXT", "NS", "SOA", "PTR", "SRV", "CAA"];
|
|
@@ -9029,6 +9091,89 @@ function validateSitemap(xml) {
|
|
|
9029
9091
|
const valid = !issues.some((i) => i.severity === "error");
|
|
9030
9092
|
return { type, urlCount: entries.length, entries, issues, valid };
|
|
9031
9093
|
}
|
|
9094
|
+
var KNOWN_ROBOTS_DIRECTIVES = /* @__PURE__ */ new Set(["user-agent", "disallow", "allow", "sitemap", "crawl-delay", "host"]);
|
|
9095
|
+
function validateRobotsTxt(text) {
|
|
9096
|
+
if (!text || !text.trim()) return { error: "Input is empty" };
|
|
9097
|
+
const lines = text.split("\n");
|
|
9098
|
+
const issues = [];
|
|
9099
|
+
const groups = [];
|
|
9100
|
+
const sitemaps = [];
|
|
9101
|
+
let currentGroup = null;
|
|
9102
|
+
for (let i = 0; i < lines.length; i++) {
|
|
9103
|
+
const rawLine = lines[i];
|
|
9104
|
+
const lineNum = i + 1;
|
|
9105
|
+
const commentIdx = rawLine.indexOf("#");
|
|
9106
|
+
const line = (commentIdx >= 0 ? rawLine.slice(0, commentIdx) : rawLine).trim();
|
|
9107
|
+
if (!line) continue;
|
|
9108
|
+
const colonIdx = line.indexOf(":");
|
|
9109
|
+
if (colonIdx === -1) {
|
|
9110
|
+
issues.push({ severity: "error", line: lineNum, message: `Malformed line (missing ':'): "${line}"` });
|
|
9111
|
+
continue;
|
|
9112
|
+
}
|
|
9113
|
+
const directive = line.slice(0, colonIdx).trim().toLowerCase();
|
|
9114
|
+
const value = line.slice(colonIdx + 1).trim();
|
|
9115
|
+
if (!KNOWN_ROBOTS_DIRECTIVES.has(directive)) {
|
|
9116
|
+
issues.push({ severity: "warning", line: lineNum, message: `Unknown directive "${directive}"` });
|
|
9117
|
+
continue;
|
|
9118
|
+
}
|
|
9119
|
+
if (directive === "sitemap") {
|
|
9120
|
+
if (!/^https?:\/\//i.test(value)) {
|
|
9121
|
+
issues.push({ severity: "error", line: lineNum, message: `Sitemap URL "${value}" must be absolute (start with http:// or https://)` });
|
|
9122
|
+
}
|
|
9123
|
+
sitemaps.push(value);
|
|
9124
|
+
continue;
|
|
9125
|
+
}
|
|
9126
|
+
if (directive === "user-agent") {
|
|
9127
|
+
if (!value) {
|
|
9128
|
+
issues.push({ severity: "error", line: lineNum, message: "User-agent directive is missing a value" });
|
|
9129
|
+
}
|
|
9130
|
+
if (currentGroup && currentGroup.rules.length === 0 && currentGroup.crawlDelay === void 0) {
|
|
9131
|
+
currentGroup.userAgents.push(value);
|
|
9132
|
+
} else {
|
|
9133
|
+
currentGroup = { userAgents: [value], rules: [], line: lineNum };
|
|
9134
|
+
groups.push(currentGroup);
|
|
9135
|
+
}
|
|
9136
|
+
continue;
|
|
9137
|
+
}
|
|
9138
|
+
if (!currentGroup) {
|
|
9139
|
+
issues.push({ severity: "error", line: lineNum, message: `"${directive}" directive found before any User-agent line` });
|
|
9140
|
+
continue;
|
|
9141
|
+
}
|
|
9142
|
+
if (directive === "disallow" || directive === "allow") {
|
|
9143
|
+
if (value !== "" && !value.startsWith("/") && !value.startsWith("*")) {
|
|
9144
|
+
issues.push({ severity: "warning", line: lineNum, message: `${directive === "disallow" ? "Disallow" : "Allow"} value "${value}" should start with "/" (or be empty)` });
|
|
9145
|
+
}
|
|
9146
|
+
if (currentGroup.rules.some((r) => r.type === directive && r.value === value)) {
|
|
9147
|
+
issues.push({ severity: "warning", line: lineNum, message: `Duplicate ${directive} rule for "${value}" in this group` });
|
|
9148
|
+
}
|
|
9149
|
+
currentGroup.rules.push({ type: directive, value, line: lineNum });
|
|
9150
|
+
} else if (directive === "crawl-delay") {
|
|
9151
|
+
const n = Number(value);
|
|
9152
|
+
if (Number.isNaN(n) || n < 0) {
|
|
9153
|
+
issues.push({ severity: "error", line: lineNum, message: `Crawl-delay "${value}" must be a non-negative number` });
|
|
9154
|
+
} else {
|
|
9155
|
+
currentGroup.crawlDelay = n;
|
|
9156
|
+
}
|
|
9157
|
+
}
|
|
9158
|
+
}
|
|
9159
|
+
if (groups.length === 0) {
|
|
9160
|
+
issues.push({ severity: "error", line: 1, message: "No User-agent groups found" });
|
|
9161
|
+
}
|
|
9162
|
+
const seenUA = /* @__PURE__ */ new Map();
|
|
9163
|
+
for (const g of groups) {
|
|
9164
|
+
for (const ua of g.userAgents) {
|
|
9165
|
+
const key = ua.toLowerCase();
|
|
9166
|
+
const firstLine = seenUA.get(key);
|
|
9167
|
+
if (firstLine !== void 0) {
|
|
9168
|
+
issues.push({ severity: "warning", line: g.line, message: `Duplicate User-agent "${ua}" (first seen on line ${firstLine})` });
|
|
9169
|
+
} else {
|
|
9170
|
+
seenUA.set(key, g.line);
|
|
9171
|
+
}
|
|
9172
|
+
}
|
|
9173
|
+
}
|
|
9174
|
+
const valid = !issues.some((i) => i.severity === "error");
|
|
9175
|
+
return { groups, sitemaps, issues, valid };
|
|
9176
|
+
}
|
|
9032
9177
|
|
|
9033
9178
|
// src/tools/api.ts
|
|
9034
9179
|
var api_exports = {};
|
package/dist/index.d.cts
CHANGED
|
@@ -5,8 +5,8 @@ export { t as text } from './text-Bbx-tZ43.cjs';
|
|
|
5
5
|
export { d as data } from './data-D8XTI7Du.cjs';
|
|
6
6
|
export { g as generators } from './generators-BGtRGpJZ.cjs';
|
|
7
7
|
export { t as time } from './time-DbT8fjaF.cjs';
|
|
8
|
-
export { u as units } from './units-
|
|
9
|
-
export { n as network } from './network-
|
|
8
|
+
export { u as units } from './units-DRT6W-vu.cjs';
|
|
9
|
+
export { n as network } from './network-DaNoZ5ER.cjs';
|
|
10
10
|
export { a as api } from './api-Xl7OzIgq.cjs';
|
|
11
11
|
export { c as code } from './code-BUqyaofO.cjs';
|
|
12
12
|
export { c as color } from './color-tPwZCr9H.cjs';
|
package/dist/index.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ export { t as text } from './text-Bbx-tZ43.js';
|
|
|
5
5
|
export { d as data } from './data-D8XTI7Du.js';
|
|
6
6
|
export { g as generators } from './generators-BGtRGpJZ.js';
|
|
7
7
|
export { t as time } from './time-DbT8fjaF.js';
|
|
8
|
-
export { u as units } from './units-
|
|
9
|
-
export { n as network } from './network-
|
|
8
|
+
export { u as units } from './units-DRT6W-vu.js';
|
|
9
|
+
export { n as network } from './network-DaNoZ5ER.js';
|
|
10
10
|
export { a as api } from './api-Xl7OzIgq.js';
|
|
11
11
|
export { c as code } from './code-BUqyaofO.js';
|
|
12
12
|
export { c as color } from './color-tPwZCr9H.js';
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
export { media_exports as media } from './chunk-GUUYEIU6.js';
|
|
2
|
-
export { units_exports as units } from './chunk-
|
|
3
|
-
export { network_exports as network } from './chunk-
|
|
2
|
+
export { units_exports as units } from './chunk-YVFM5WYI.js';
|
|
3
|
+
export { network_exports as network } from './chunk-OB56VNKJ.js';
|
|
4
4
|
export { api_exports as api } from './chunk-Q3B3YWOA.js';
|
|
5
5
|
export { code_exports as code } from './chunk-V5S6OJ4A.js';
|
|
6
6
|
export { color_exports as color } from './chunk-BPVAB4P2.js';
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* - http-headers : HTTP header reference lookup and validation
|
|
10
10
|
* - har-viewer : parseHar
|
|
11
11
|
* - sitemap-validator: validateSitemap
|
|
12
|
+
* - robots-txt-validator: validateRobotsTxt
|
|
12
13
|
*/
|
|
13
14
|
declare const DNS_RECORD_TYPES: readonly ["A", "AAAA", "CNAME", "MX", "TXT", "NS", "SOA", "PTR", "SRV", "CAA"];
|
|
14
15
|
type DnsRecordType = typeof DNS_RECORD_TYPES[number];
|
|
@@ -190,6 +191,37 @@ interface SitemapValidationResult {
|
|
|
190
191
|
declare function validateSitemap(xml: string): SitemapValidationResult | {
|
|
191
192
|
error: string;
|
|
192
193
|
};
|
|
194
|
+
interface RobotsRule {
|
|
195
|
+
type: 'allow' | 'disallow';
|
|
196
|
+
value: string;
|
|
197
|
+
line: number;
|
|
198
|
+
}
|
|
199
|
+
interface RobotsGroup {
|
|
200
|
+
userAgents: string[];
|
|
201
|
+
rules: RobotsRule[];
|
|
202
|
+
crawlDelay?: number;
|
|
203
|
+
line: number;
|
|
204
|
+
}
|
|
205
|
+
interface RobotsIssue {
|
|
206
|
+
severity: 'error' | 'warning';
|
|
207
|
+
line: number;
|
|
208
|
+
message: string;
|
|
209
|
+
}
|
|
210
|
+
interface RobotsValidationResult {
|
|
211
|
+
groups: RobotsGroup[];
|
|
212
|
+
sitemaps: string[];
|
|
213
|
+
issues: RobotsIssue[];
|
|
214
|
+
valid: boolean;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Validate a robots.txt file: parse it into User-agent groups and flag
|
|
218
|
+
* structural mistakes against the de facto robots.txt convention — directives
|
|
219
|
+
* before any User-agent, unknown directives, non-absolute Sitemap URLs,
|
|
220
|
+
* malformed Crawl-delay values, missing leading slashes, and duplicate rules.
|
|
221
|
+
*/
|
|
222
|
+
declare function validateRobotsTxt(text: string): RobotsValidationResult | {
|
|
223
|
+
error: string;
|
|
224
|
+
};
|
|
193
225
|
|
|
194
226
|
declare const network_DNS_RECORD_TYPES: typeof DNS_RECORD_TYPES;
|
|
195
227
|
type network_DnsRecord = DnsRecord;
|
|
@@ -204,6 +236,10 @@ type network_HeaderCategory = HeaderCategory;
|
|
|
204
236
|
type network_HttpHeader = HttpHeader;
|
|
205
237
|
type network_ParsedDnsResult = ParsedDnsResult;
|
|
206
238
|
type network_ParsedGeoResult = ParsedGeoResult;
|
|
239
|
+
type network_RobotsGroup = RobotsGroup;
|
|
240
|
+
type network_RobotsIssue = RobotsIssue;
|
|
241
|
+
type network_RobotsRule = RobotsRule;
|
|
242
|
+
type network_RobotsValidationResult = RobotsValidationResult;
|
|
207
243
|
declare const network_STATUS_CODES: typeof STATUS_CODES;
|
|
208
244
|
type network_SitemapIndexEntry = SitemapIndexEntry;
|
|
209
245
|
type network_SitemapIssue = SitemapIssue;
|
|
@@ -237,9 +273,10 @@ declare const network_typeNumberToLabel: typeof typeNumberToLabel;
|
|
|
237
273
|
declare const network_validateDomain: typeof validateDomain;
|
|
238
274
|
declare const network_validateHeaderName: typeof validateHeaderName;
|
|
239
275
|
declare const network_validateHeaderValue: typeof validateHeaderValue;
|
|
276
|
+
declare const network_validateRobotsTxt: typeof validateRobotsTxt;
|
|
240
277
|
declare const network_validateSitemap: typeof validateSitemap;
|
|
241
278
|
declare namespace network {
|
|
242
|
-
export { network_DNS_RECORD_TYPES as DNS_RECORD_TYPES, type network_DnsRecord as DnsRecord, type network_DnsRecordType as DnsRecordType, type network_DnsResponse as DnsResponse, type network_GeoResult as GeoResult, network_HTTP_HEADERS as HTTP_HEADERS, type network_HarEntry as HarEntry, type network_HarParseResult as HarParseResult, type network_HarSummary as HarSummary, type network_HeaderCategory as HeaderCategory, type network_HttpHeader as HttpHeader, type network_ParsedDnsResult as ParsedDnsResult, type network_ParsedGeoResult as ParsedGeoResult, network_STATUS_CODES as STATUS_CODES, type network_SitemapIndexEntry as SitemapIndexEntry, type network_SitemapIssue as SitemapIssue, type network_SitemapUrlEntry as SitemapUrlEntry, type network_SitemapValidationResult as SitemapValidationResult, type network_StatusCode as StatusCode, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildMapUrl as buildMapUrl, network_countryCodeToFlag as countryCodeToFlag, network_formatCoordinates as formatCoordinates, network_formatTtl as formatTtl, network_getByCategory as getByCategory, network_getHeader as getHeader, network_getHeadersByCategory as getHeadersByCategory, network_getStatusByCategory as getStatusByCategory, network_getStatusCode as getStatusCode, network_isClientError as isClientError, network_isServerError as isServerError, network_isSuccess as isSuccess, network_isValidIp as isValidIp, network_isValidIpv4 as isValidIpv4, network_isValidIpv6 as isValidIpv6, network_parseDnsResponse as parseDnsResponse, network_parseGeoResponse as parseGeoResponse, network_parseHar as parseHar, network_searchHeaders as searchHeaders, network_searchStatusCodes as searchStatusCodes, network_statusCodeToText as statusCodeToText, network_typeNumberToLabel as typeNumberToLabel, network_validateDomain as validateDomain, network_validateHeaderName as validateHeaderName, network_validateHeaderValue as validateHeaderValue, network_validateSitemap as validateSitemap };
|
|
279
|
+
export { network_DNS_RECORD_TYPES as DNS_RECORD_TYPES, type network_DnsRecord as DnsRecord, type network_DnsRecordType as DnsRecordType, type network_DnsResponse as DnsResponse, type network_GeoResult as GeoResult, network_HTTP_HEADERS as HTTP_HEADERS, type network_HarEntry as HarEntry, type network_HarParseResult as HarParseResult, type network_HarSummary as HarSummary, type network_HeaderCategory as HeaderCategory, type network_HttpHeader as HttpHeader, type network_ParsedDnsResult as ParsedDnsResult, type network_ParsedGeoResult as ParsedGeoResult, type network_RobotsGroup as RobotsGroup, type network_RobotsIssue as RobotsIssue, type network_RobotsRule as RobotsRule, type network_RobotsValidationResult as RobotsValidationResult, network_STATUS_CODES as STATUS_CODES, type network_SitemapIndexEntry as SitemapIndexEntry, type network_SitemapIssue as SitemapIssue, type network_SitemapUrlEntry as SitemapUrlEntry, type network_SitemapValidationResult as SitemapValidationResult, type network_StatusCode as StatusCode, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildMapUrl as buildMapUrl, network_countryCodeToFlag as countryCodeToFlag, network_formatCoordinates as formatCoordinates, network_formatTtl as formatTtl, network_getByCategory as getByCategory, network_getHeader as getHeader, network_getHeadersByCategory as getHeadersByCategory, network_getStatusByCategory as getStatusByCategory, network_getStatusCode as getStatusCode, network_isClientError as isClientError, network_isServerError as isServerError, network_isSuccess as isSuccess, network_isValidIp as isValidIp, network_isValidIpv4 as isValidIpv4, network_isValidIpv6 as isValidIpv6, network_parseDnsResponse as parseDnsResponse, network_parseGeoResponse as parseGeoResponse, network_parseHar as parseHar, network_searchHeaders as searchHeaders, network_searchStatusCodes as searchStatusCodes, network_statusCodeToText as statusCodeToText, network_typeNumberToLabel as typeNumberToLabel, network_validateDomain as validateDomain, network_validateHeaderName as validateHeaderName, network_validateHeaderValue as validateHeaderValue, network_validateRobotsTxt as validateRobotsTxt, network_validateSitemap as validateSitemap };
|
|
243
280
|
}
|
|
244
281
|
|
|
245
|
-
export {
|
|
282
|
+
export { getHeadersByCategory as A, getStatusByCategory as B, getStatusCode as C, DNS_RECORD_TYPES as D, isClientError as E, isServerError as F, type GeoResult as G, HTTP_HEADERS as H, isSuccess as I, isValidIp as J, isValidIpv4 as K, isValidIpv6 as L, parseDnsResponse as M, parseGeoResponse as N, parseHar as O, type ParsedDnsResult as P, searchHeaders as Q, type RobotsGroup as R, STATUS_CODES as S, searchStatusCodes as T, statusCodeToText as U, typeNumberToLabel as V, validateDomain as W, validateHeaderName as X, validateHeaderValue as Y, validateRobotsTxt as Z, validateSitemap as _, type DnsRecord as a, type DnsRecordType as b, type DnsResponse as c, type HarEntry as d, type HarParseResult as e, type HarSummary as f, type HeaderCategory as g, type HttpHeader as h, type ParsedGeoResult as i, type RobotsIssue as j, type RobotsRule as k, type RobotsValidationResult as l, type SitemapIndexEntry as m, network as n, type SitemapIssue as o, type SitemapUrlEntry as p, type SitemapValidationResult as q, type StatusCode as r, buildDnsQueryUrl as s, buildGeoUrl as t, buildMapUrl as u, countryCodeToFlag as v, formatCoordinates as w, formatTtl as x, getByCategory as y, getHeader as z };
|
|
@@ -9,6 +9,7 @@
|
|
|
9
9
|
* - http-headers : HTTP header reference lookup and validation
|
|
10
10
|
* - har-viewer : parseHar
|
|
11
11
|
* - sitemap-validator: validateSitemap
|
|
12
|
+
* - robots-txt-validator: validateRobotsTxt
|
|
12
13
|
*/
|
|
13
14
|
declare const DNS_RECORD_TYPES: readonly ["A", "AAAA", "CNAME", "MX", "TXT", "NS", "SOA", "PTR", "SRV", "CAA"];
|
|
14
15
|
type DnsRecordType = typeof DNS_RECORD_TYPES[number];
|
|
@@ -190,6 +191,37 @@ interface SitemapValidationResult {
|
|
|
190
191
|
declare function validateSitemap(xml: string): SitemapValidationResult | {
|
|
191
192
|
error: string;
|
|
192
193
|
};
|
|
194
|
+
interface RobotsRule {
|
|
195
|
+
type: 'allow' | 'disallow';
|
|
196
|
+
value: string;
|
|
197
|
+
line: number;
|
|
198
|
+
}
|
|
199
|
+
interface RobotsGroup {
|
|
200
|
+
userAgents: string[];
|
|
201
|
+
rules: RobotsRule[];
|
|
202
|
+
crawlDelay?: number;
|
|
203
|
+
line: number;
|
|
204
|
+
}
|
|
205
|
+
interface RobotsIssue {
|
|
206
|
+
severity: 'error' | 'warning';
|
|
207
|
+
line: number;
|
|
208
|
+
message: string;
|
|
209
|
+
}
|
|
210
|
+
interface RobotsValidationResult {
|
|
211
|
+
groups: RobotsGroup[];
|
|
212
|
+
sitemaps: string[];
|
|
213
|
+
issues: RobotsIssue[];
|
|
214
|
+
valid: boolean;
|
|
215
|
+
}
|
|
216
|
+
/**
|
|
217
|
+
* Validate a robots.txt file: parse it into User-agent groups and flag
|
|
218
|
+
* structural mistakes against the de facto robots.txt convention — directives
|
|
219
|
+
* before any User-agent, unknown directives, non-absolute Sitemap URLs,
|
|
220
|
+
* malformed Crawl-delay values, missing leading slashes, and duplicate rules.
|
|
221
|
+
*/
|
|
222
|
+
declare function validateRobotsTxt(text: string): RobotsValidationResult | {
|
|
223
|
+
error: string;
|
|
224
|
+
};
|
|
193
225
|
|
|
194
226
|
declare const network_DNS_RECORD_TYPES: typeof DNS_RECORD_TYPES;
|
|
195
227
|
type network_DnsRecord = DnsRecord;
|
|
@@ -204,6 +236,10 @@ type network_HeaderCategory = HeaderCategory;
|
|
|
204
236
|
type network_HttpHeader = HttpHeader;
|
|
205
237
|
type network_ParsedDnsResult = ParsedDnsResult;
|
|
206
238
|
type network_ParsedGeoResult = ParsedGeoResult;
|
|
239
|
+
type network_RobotsGroup = RobotsGroup;
|
|
240
|
+
type network_RobotsIssue = RobotsIssue;
|
|
241
|
+
type network_RobotsRule = RobotsRule;
|
|
242
|
+
type network_RobotsValidationResult = RobotsValidationResult;
|
|
207
243
|
declare const network_STATUS_CODES: typeof STATUS_CODES;
|
|
208
244
|
type network_SitemapIndexEntry = SitemapIndexEntry;
|
|
209
245
|
type network_SitemapIssue = SitemapIssue;
|
|
@@ -237,9 +273,10 @@ declare const network_typeNumberToLabel: typeof typeNumberToLabel;
|
|
|
237
273
|
declare const network_validateDomain: typeof validateDomain;
|
|
238
274
|
declare const network_validateHeaderName: typeof validateHeaderName;
|
|
239
275
|
declare const network_validateHeaderValue: typeof validateHeaderValue;
|
|
276
|
+
declare const network_validateRobotsTxt: typeof validateRobotsTxt;
|
|
240
277
|
declare const network_validateSitemap: typeof validateSitemap;
|
|
241
278
|
declare namespace network {
|
|
242
|
-
export { network_DNS_RECORD_TYPES as DNS_RECORD_TYPES, type network_DnsRecord as DnsRecord, type network_DnsRecordType as DnsRecordType, type network_DnsResponse as DnsResponse, type network_GeoResult as GeoResult, network_HTTP_HEADERS as HTTP_HEADERS, type network_HarEntry as HarEntry, type network_HarParseResult as HarParseResult, type network_HarSummary as HarSummary, type network_HeaderCategory as HeaderCategory, type network_HttpHeader as HttpHeader, type network_ParsedDnsResult as ParsedDnsResult, type network_ParsedGeoResult as ParsedGeoResult, network_STATUS_CODES as STATUS_CODES, type network_SitemapIndexEntry as SitemapIndexEntry, type network_SitemapIssue as SitemapIssue, type network_SitemapUrlEntry as SitemapUrlEntry, type network_SitemapValidationResult as SitemapValidationResult, type network_StatusCode as StatusCode, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildMapUrl as buildMapUrl, network_countryCodeToFlag as countryCodeToFlag, network_formatCoordinates as formatCoordinates, network_formatTtl as formatTtl, network_getByCategory as getByCategory, network_getHeader as getHeader, network_getHeadersByCategory as getHeadersByCategory, network_getStatusByCategory as getStatusByCategory, network_getStatusCode as getStatusCode, network_isClientError as isClientError, network_isServerError as isServerError, network_isSuccess as isSuccess, network_isValidIp as isValidIp, network_isValidIpv4 as isValidIpv4, network_isValidIpv6 as isValidIpv6, network_parseDnsResponse as parseDnsResponse, network_parseGeoResponse as parseGeoResponse, network_parseHar as parseHar, network_searchHeaders as searchHeaders, network_searchStatusCodes as searchStatusCodes, network_statusCodeToText as statusCodeToText, network_typeNumberToLabel as typeNumberToLabel, network_validateDomain as validateDomain, network_validateHeaderName as validateHeaderName, network_validateHeaderValue as validateHeaderValue, network_validateSitemap as validateSitemap };
|
|
279
|
+
export { network_DNS_RECORD_TYPES as DNS_RECORD_TYPES, type network_DnsRecord as DnsRecord, type network_DnsRecordType as DnsRecordType, type network_DnsResponse as DnsResponse, type network_GeoResult as GeoResult, network_HTTP_HEADERS as HTTP_HEADERS, type network_HarEntry as HarEntry, type network_HarParseResult as HarParseResult, type network_HarSummary as HarSummary, type network_HeaderCategory as HeaderCategory, type network_HttpHeader as HttpHeader, type network_ParsedDnsResult as ParsedDnsResult, type network_ParsedGeoResult as ParsedGeoResult, type network_RobotsGroup as RobotsGroup, type network_RobotsIssue as RobotsIssue, type network_RobotsRule as RobotsRule, type network_RobotsValidationResult as RobotsValidationResult, network_STATUS_CODES as STATUS_CODES, type network_SitemapIndexEntry as SitemapIndexEntry, type network_SitemapIssue as SitemapIssue, type network_SitemapUrlEntry as SitemapUrlEntry, type network_SitemapValidationResult as SitemapValidationResult, type network_StatusCode as StatusCode, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildMapUrl as buildMapUrl, network_countryCodeToFlag as countryCodeToFlag, network_formatCoordinates as formatCoordinates, network_formatTtl as formatTtl, network_getByCategory as getByCategory, network_getHeader as getHeader, network_getHeadersByCategory as getHeadersByCategory, network_getStatusByCategory as getStatusByCategory, network_getStatusCode as getStatusCode, network_isClientError as isClientError, network_isServerError as isServerError, network_isSuccess as isSuccess, network_isValidIp as isValidIp, network_isValidIpv4 as isValidIpv4, network_isValidIpv6 as isValidIpv6, network_parseDnsResponse as parseDnsResponse, network_parseGeoResponse as parseGeoResponse, network_parseHar as parseHar, network_searchHeaders as searchHeaders, network_searchStatusCodes as searchStatusCodes, network_statusCodeToText as statusCodeToText, network_typeNumberToLabel as typeNumberToLabel, network_validateDomain as validateDomain, network_validateHeaderName as validateHeaderName, network_validateHeaderValue as validateHeaderValue, network_validateRobotsTxt as validateRobotsTxt, network_validateSitemap as validateSitemap };
|
|
243
280
|
}
|
|
244
281
|
|
|
245
|
-
export {
|
|
282
|
+
export { getHeadersByCategory as A, getStatusByCategory as B, getStatusCode as C, DNS_RECORD_TYPES as D, isClientError as E, isServerError as F, type GeoResult as G, HTTP_HEADERS as H, isSuccess as I, isValidIp as J, isValidIpv4 as K, isValidIpv6 as L, parseDnsResponse as M, parseGeoResponse as N, parseHar as O, type ParsedDnsResult as P, searchHeaders as Q, type RobotsGroup as R, STATUS_CODES as S, searchStatusCodes as T, statusCodeToText as U, typeNumberToLabel as V, validateDomain as W, validateHeaderName as X, validateHeaderValue as Y, validateRobotsTxt as Z, validateSitemap as _, type DnsRecord as a, type DnsRecordType as b, type DnsResponse as c, type HarEntry as d, type HarParseResult as e, type HarSummary as f, type HeaderCategory as g, type HttpHeader as h, type ParsedGeoResult as i, type RobotsIssue as j, type RobotsRule as k, type RobotsValidationResult as l, type SitemapIndexEntry as m, network as n, type SitemapIssue as o, type SitemapUrlEntry as p, type SitemapValidationResult as q, type StatusCode as r, buildDnsQueryUrl as s, buildGeoUrl as t, buildMapUrl as u, countryCodeToFlag as v, formatCoordinates as w, formatTtl as x, getByCategory as y, getHeader as z };
|
package/dist/tools/network.cjs
CHANGED
|
@@ -1497,6 +1497,89 @@ function validateSitemap(xml) {
|
|
|
1497
1497
|
const valid = !issues.some((i) => i.severity === "error");
|
|
1498
1498
|
return { type, urlCount: entries.length, entries, issues, valid };
|
|
1499
1499
|
}
|
|
1500
|
+
var KNOWN_ROBOTS_DIRECTIVES = /* @__PURE__ */ new Set(["user-agent", "disallow", "allow", "sitemap", "crawl-delay", "host"]);
|
|
1501
|
+
function validateRobotsTxt(text) {
|
|
1502
|
+
if (!text || !text.trim()) return { error: "Input is empty" };
|
|
1503
|
+
const lines = text.split("\n");
|
|
1504
|
+
const issues = [];
|
|
1505
|
+
const groups = [];
|
|
1506
|
+
const sitemaps = [];
|
|
1507
|
+
let currentGroup = null;
|
|
1508
|
+
for (let i = 0; i < lines.length; i++) {
|
|
1509
|
+
const rawLine = lines[i];
|
|
1510
|
+
const lineNum = i + 1;
|
|
1511
|
+
const commentIdx = rawLine.indexOf("#");
|
|
1512
|
+
const line = (commentIdx >= 0 ? rawLine.slice(0, commentIdx) : rawLine).trim();
|
|
1513
|
+
if (!line) continue;
|
|
1514
|
+
const colonIdx = line.indexOf(":");
|
|
1515
|
+
if (colonIdx === -1) {
|
|
1516
|
+
issues.push({ severity: "error", line: lineNum, message: `Malformed line (missing ':'): "${line}"` });
|
|
1517
|
+
continue;
|
|
1518
|
+
}
|
|
1519
|
+
const directive = line.slice(0, colonIdx).trim().toLowerCase();
|
|
1520
|
+
const value = line.slice(colonIdx + 1).trim();
|
|
1521
|
+
if (!KNOWN_ROBOTS_DIRECTIVES.has(directive)) {
|
|
1522
|
+
issues.push({ severity: "warning", line: lineNum, message: `Unknown directive "${directive}"` });
|
|
1523
|
+
continue;
|
|
1524
|
+
}
|
|
1525
|
+
if (directive === "sitemap") {
|
|
1526
|
+
if (!/^https?:\/\//i.test(value)) {
|
|
1527
|
+
issues.push({ severity: "error", line: lineNum, message: `Sitemap URL "${value}" must be absolute (start with http:// or https://)` });
|
|
1528
|
+
}
|
|
1529
|
+
sitemaps.push(value);
|
|
1530
|
+
continue;
|
|
1531
|
+
}
|
|
1532
|
+
if (directive === "user-agent") {
|
|
1533
|
+
if (!value) {
|
|
1534
|
+
issues.push({ severity: "error", line: lineNum, message: "User-agent directive is missing a value" });
|
|
1535
|
+
}
|
|
1536
|
+
if (currentGroup && currentGroup.rules.length === 0 && currentGroup.crawlDelay === void 0) {
|
|
1537
|
+
currentGroup.userAgents.push(value);
|
|
1538
|
+
} else {
|
|
1539
|
+
currentGroup = { userAgents: [value], rules: [], line: lineNum };
|
|
1540
|
+
groups.push(currentGroup);
|
|
1541
|
+
}
|
|
1542
|
+
continue;
|
|
1543
|
+
}
|
|
1544
|
+
if (!currentGroup) {
|
|
1545
|
+
issues.push({ severity: "error", line: lineNum, message: `"${directive}" directive found before any User-agent line` });
|
|
1546
|
+
continue;
|
|
1547
|
+
}
|
|
1548
|
+
if (directive === "disallow" || directive === "allow") {
|
|
1549
|
+
if (value !== "" && !value.startsWith("/") && !value.startsWith("*")) {
|
|
1550
|
+
issues.push({ severity: "warning", line: lineNum, message: `${directive === "disallow" ? "Disallow" : "Allow"} value "${value}" should start with "/" (or be empty)` });
|
|
1551
|
+
}
|
|
1552
|
+
if (currentGroup.rules.some((r) => r.type === directive && r.value === value)) {
|
|
1553
|
+
issues.push({ severity: "warning", line: lineNum, message: `Duplicate ${directive} rule for "${value}" in this group` });
|
|
1554
|
+
}
|
|
1555
|
+
currentGroup.rules.push({ type: directive, value, line: lineNum });
|
|
1556
|
+
} else if (directive === "crawl-delay") {
|
|
1557
|
+
const n = Number(value);
|
|
1558
|
+
if (Number.isNaN(n) || n < 0) {
|
|
1559
|
+
issues.push({ severity: "error", line: lineNum, message: `Crawl-delay "${value}" must be a non-negative number` });
|
|
1560
|
+
} else {
|
|
1561
|
+
currentGroup.crawlDelay = n;
|
|
1562
|
+
}
|
|
1563
|
+
}
|
|
1564
|
+
}
|
|
1565
|
+
if (groups.length === 0) {
|
|
1566
|
+
issues.push({ severity: "error", line: 1, message: "No User-agent groups found" });
|
|
1567
|
+
}
|
|
1568
|
+
const seenUA = /* @__PURE__ */ new Map();
|
|
1569
|
+
for (const g of groups) {
|
|
1570
|
+
for (const ua of g.userAgents) {
|
|
1571
|
+
const key = ua.toLowerCase();
|
|
1572
|
+
const firstLine = seenUA.get(key);
|
|
1573
|
+
if (firstLine !== void 0) {
|
|
1574
|
+
issues.push({ severity: "warning", line: g.line, message: `Duplicate User-agent "${ua}" (first seen on line ${firstLine})` });
|
|
1575
|
+
} else {
|
|
1576
|
+
seenUA.set(key, g.line);
|
|
1577
|
+
}
|
|
1578
|
+
}
|
|
1579
|
+
}
|
|
1580
|
+
const valid = !issues.some((i) => i.severity === "error");
|
|
1581
|
+
return { groups, sitemaps, issues, valid };
|
|
1582
|
+
}
|
|
1500
1583
|
|
|
1501
1584
|
exports.DNS_RECORD_TYPES = DNS_RECORD_TYPES;
|
|
1502
1585
|
exports.HTTP_HEADERS = HTTP_HEADERS;
|
|
@@ -1528,4 +1611,5 @@ exports.typeNumberToLabel = typeNumberToLabel;
|
|
|
1528
1611
|
exports.validateDomain = validateDomain;
|
|
1529
1612
|
exports.validateHeaderName = validateHeaderName;
|
|
1530
1613
|
exports.validateHeaderValue = validateHeaderValue;
|
|
1614
|
+
exports.validateRobotsTxt = validateRobotsTxt;
|
|
1531
1615
|
exports.validateSitemap = validateSitemap;
|
package/dist/tools/network.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { D as DNS_RECORD_TYPES, a as DnsRecord, b as DnsRecordType, c as DnsResponse, G as GeoResult, H as HTTP_HEADERS, d as HarEntry, e as HarParseResult, f as HarSummary, g as HeaderCategory, h as HttpHeader, P as ParsedDnsResult, i as ParsedGeoResult, S as STATUS_CODES,
|
|
1
|
+
export { D as DNS_RECORD_TYPES, a as DnsRecord, b as DnsRecordType, c as DnsResponse, G as GeoResult, H as HTTP_HEADERS, d as HarEntry, e as HarParseResult, f as HarSummary, g as HeaderCategory, h as HttpHeader, P as ParsedDnsResult, i as ParsedGeoResult, R as RobotsGroup, j as RobotsIssue, k as RobotsRule, l as RobotsValidationResult, S as STATUS_CODES, m as SitemapIndexEntry, o as SitemapIssue, p as SitemapUrlEntry, q as SitemapValidationResult, r as StatusCode, s as buildDnsQueryUrl, t as buildGeoUrl, u as buildMapUrl, v as countryCodeToFlag, w as formatCoordinates, x as formatTtl, y as getByCategory, z as getHeader, A as getHeadersByCategory, B as getStatusByCategory, C as getStatusCode, E as isClientError, F as isServerError, I as isSuccess, J as isValidIp, K as isValidIpv4, L as isValidIpv6, M as parseDnsResponse, N as parseGeoResponse, O as parseHar, Q as searchHeaders, T as searchStatusCodes, U as statusCodeToText, V as typeNumberToLabel, W as validateDomain, X as validateHeaderName, Y as validateHeaderValue, Z as validateRobotsTxt, _ as validateSitemap } from '../network-DaNoZ5ER.cjs';
|
package/dist/tools/network.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { D as DNS_RECORD_TYPES, a as DnsRecord, b as DnsRecordType, c as DnsResponse, G as GeoResult, H as HTTP_HEADERS, d as HarEntry, e as HarParseResult, f as HarSummary, g as HeaderCategory, h as HttpHeader, P as ParsedDnsResult, i as ParsedGeoResult, S as STATUS_CODES,
|
|
1
|
+
export { D as DNS_RECORD_TYPES, a as DnsRecord, b as DnsRecordType, c as DnsResponse, G as GeoResult, H as HTTP_HEADERS, d as HarEntry, e as HarParseResult, f as HarSummary, g as HeaderCategory, h as HttpHeader, P as ParsedDnsResult, i as ParsedGeoResult, R as RobotsGroup, j as RobotsIssue, k as RobotsRule, l as RobotsValidationResult, S as STATUS_CODES, m as SitemapIndexEntry, o as SitemapIssue, p as SitemapUrlEntry, q as SitemapValidationResult, r as StatusCode, s as buildDnsQueryUrl, t as buildGeoUrl, u as buildMapUrl, v as countryCodeToFlag, w as formatCoordinates, x as formatTtl, y as getByCategory, z as getHeader, A as getHeadersByCategory, B as getStatusByCategory, C as getStatusCode, E as isClientError, F as isServerError, I as isSuccess, J as isValidIp, K as isValidIpv4, L as isValidIpv6, M as parseDnsResponse, N as parseGeoResponse, O as parseHar, Q as searchHeaders, T as searchStatusCodes, U as statusCodeToText, V as typeNumberToLabel, W as validateDomain, X as validateHeaderName, Y as validateHeaderValue, Z as validateRobotsTxt, _ as validateSitemap } from '../network-DaNoZ5ER.js';
|
package/dist/tools/network.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { DNS_RECORD_TYPES, HTTP_HEADERS, STATUS_CODES, buildDnsQueryUrl, buildGeoUrl, buildMapUrl, countryCodeToFlag, formatCoordinates, formatTtl, getByCategory, getHeader, getHeadersByCategory, getStatusByCategory, getStatusCode, isClientError, isServerError, isSuccess, isValidIp, isValidIpv4, isValidIpv6, parseDnsResponse, parseGeoResponse, parseHar, searchHeaders, searchStatusCodes, statusCodeToText, typeNumberToLabel, validateDomain, validateHeaderName, validateHeaderValue, validateSitemap } from '../chunk-
|
|
1
|
+
export { DNS_RECORD_TYPES, HTTP_HEADERS, STATUS_CODES, buildDnsQueryUrl, buildGeoUrl, buildMapUrl, countryCodeToFlag, formatCoordinates, formatTtl, getByCategory, getHeader, getHeadersByCategory, getStatusByCategory, getStatusCode, isClientError, isServerError, isSuccess, isValidIp, isValidIpv4, isValidIpv6, parseDnsResponse, parseGeoResponse, parseHar, searchHeaders, searchStatusCodes, statusCodeToText, typeNumberToLabel, validateDomain, validateHeaderName, validateHeaderValue, validateRobotsTxt, validateSitemap } from '../chunk-OB56VNKJ.js';
|
|
2
2
|
import '../chunk-MLKGABMK.js';
|
package/dist/tools/units.cjs
CHANGED
|
@@ -831,6 +831,66 @@ function sortVersions(versions, order = "asc") {
|
|
|
831
831
|
return order === "asc" ? cmp : -cmp;
|
|
832
832
|
});
|
|
833
833
|
}
|
|
834
|
+
var CARD_NETWORK_RULES = [
|
|
835
|
+
{ name: "American Express", lengths: [15], test: (d) => /^3[47]/.test(d) },
|
|
836
|
+
{ name: "Diners Club", lengths: [14], test: (d) => /^3(?:0[0-5]|[68])/.test(d) },
|
|
837
|
+
{
|
|
838
|
+
name: "Discover",
|
|
839
|
+
lengths: [16, 19],
|
|
840
|
+
test: (d) => /^(?:6011|65|64[4-9])/.test(d) || /^622(?:12[6-9]|1[3-9]\d|[2-8]\d{2}|9[01]\d|92[0-5])/.test(d)
|
|
841
|
+
},
|
|
842
|
+
{ name: "JCB", lengths: [16], test: (d) => /^35(?:2[89]|[3-8]\d)/.test(d) },
|
|
843
|
+
{
|
|
844
|
+
name: "Mastercard",
|
|
845
|
+
lengths: [16],
|
|
846
|
+
test: (d) => {
|
|
847
|
+
const two = parseInt(d.slice(0, 2), 10);
|
|
848
|
+
const four = parseInt(d.slice(0, 4), 10);
|
|
849
|
+
return two >= 51 && two <= 55 || four >= 2221 && four <= 2720;
|
|
850
|
+
}
|
|
851
|
+
},
|
|
852
|
+
{ name: "Maestro", lengths: [12, 13, 14, 15, 16, 17, 18, 19], test: (d) => /^(?:50|5[6-8]|6304|6390|67)/.test(d) },
|
|
853
|
+
{ name: "UnionPay", lengths: [16, 17, 18, 19], test: (d) => /^62/.test(d) },
|
|
854
|
+
{ name: "Visa", lengths: [13, 16, 19], test: (d) => /^4/.test(d) }
|
|
855
|
+
];
|
|
856
|
+
function luhnCheck(digits) {
|
|
857
|
+
let sum = 0;
|
|
858
|
+
let shouldDouble = false;
|
|
859
|
+
for (let i = digits.length - 1; i >= 0; i--) {
|
|
860
|
+
let d = parseInt(digits[i], 10);
|
|
861
|
+
if (shouldDouble) {
|
|
862
|
+
d *= 2;
|
|
863
|
+
if (d > 9) d -= 9;
|
|
864
|
+
}
|
|
865
|
+
sum += d;
|
|
866
|
+
shouldDouble = !shouldDouble;
|
|
867
|
+
}
|
|
868
|
+
return sum % 10 === 0;
|
|
869
|
+
}
|
|
870
|
+
function detectCardNetwork(digits) {
|
|
871
|
+
for (const rule of CARD_NETWORK_RULES) {
|
|
872
|
+
if (rule.lengths.includes(digits.length) && rule.test(digits)) return rule.name;
|
|
873
|
+
}
|
|
874
|
+
return null;
|
|
875
|
+
}
|
|
876
|
+
function formatCardNumber(digits, network) {
|
|
877
|
+
if (network === "American Express") {
|
|
878
|
+
return `${digits.slice(0, 4)} ${digits.slice(4, 10)} ${digits.slice(10)}`.trim();
|
|
879
|
+
}
|
|
880
|
+
return digits.match(/.{1,4}/g)?.join(" ") ?? digits;
|
|
881
|
+
}
|
|
882
|
+
function validateCardNumber(input) {
|
|
883
|
+
if (!input || !input.trim()) return { error: "Input is empty" };
|
|
884
|
+
const digits = input.replace(/[\s-]/g, "");
|
|
885
|
+
if (!/^\d+$/.test(digits)) return { error: "Card number must contain only digits, spaces, or hyphens" };
|
|
886
|
+
if (digits.length < 12 || digits.length > 19) {
|
|
887
|
+
return { error: `Card number length (${digits.length}) is outside the valid range of 12-19 digits` };
|
|
888
|
+
}
|
|
889
|
+
const valid = luhnCheck(digits);
|
|
890
|
+
const network = detectCardNetwork(digits);
|
|
891
|
+
const formatted = formatCardNumber(digits, network);
|
|
892
|
+
return { valid, network, length: digits.length, formatted };
|
|
893
|
+
}
|
|
834
894
|
|
|
835
895
|
exports.BASE_LABELS = BASE_LABELS;
|
|
836
896
|
exports.BASE_PREFIXES = BASE_PREFIXES;
|
|
@@ -889,4 +949,5 @@ exports.scaleByWidth = scaleByWidth;
|
|
|
889
949
|
exports.sortVersions = sortVersions;
|
|
890
950
|
exports.splitSubnet = splitSubnet;
|
|
891
951
|
exports.symbolicToPermissions = symbolicToPermissions;
|
|
952
|
+
exports.validateCardNumber = validateCardNumber;
|
|
892
953
|
exports.viewportToPx = viewportToPx;
|
package/dist/tools/units.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { A as AspectRatioResult, B as BASE_LABELS, a as BASE_PREFIXES, b as BYTE_UNITS, c as BaseConvertResult, d as ByteConvertResult, e as ByteUnit, C as COMMON_CURRENCIES, f as COMMON_LOCALES, g as COMMON_PERMISSIONS, h as COMMON_RATIOS, i as COMMON_SIZES, j as COMMON_VIEWPORTS, D as Dimensions, F as FilePermissions,
|
|
1
|
+
export { A as AspectRatioResult, B as BASE_LABELS, a as BASE_PREFIXES, b as BYTE_UNITS, c as BaseConvertResult, d as ByteConvertResult, e as ByteUnit, C as COMMON_CURRENCIES, f as COMMON_LOCALES, g as COMMON_PERMISSIONS, h as COMMON_RATIOS, i as COMMON_SIZES, j as COMMON_VIEWPORTS, k as CardValidationResult, D as Dimensions, F as FilePermissions, l as FormatOptions, I as IpConversion, N as NotationStyle, m as NumberBase, P as Permission, n as PxConvertResult, S as SemverVersion, o as SubnetInfo, V as ViewportConvertResult, p as autoFormat, q as bumpVersion, r as calcAspectRatio, s as calcSubnet, t as compareSemver, v as convert, w as convertBytes, x as convertIp, y as coverBox, z as decimalToIp, E as decimalToIpCidr, G as describePermissions, H as fitIntoBox, J as formatNumber, K as formatValue, L as formatVwValue, M as formatWithSeparator, O as gcd, Q as ipFromBinary, R as ipFromDecimal, T as ipFromHex, U as ipToBinary, W as ipToDecimal, X as ipToDecimalCidr, Y as ipToHex, Z as ipToOctal, _ as isValid, $ as isValidCidr, a0 as isValidIp, a1 as isValidIpv4, a2 as octalToPermissions, a3 as parseFileSize, a4 as parseInput, a5 as parseNumberString, a6 as parseSemver, a7 as permissionsToChmod, a8 as permissionsToOctal, a9 as permissionsToSymbolic, aa as ptToPx, ab as pxToAll, ac as pxToViewport, ad as remToPx, ae as satisfiesRange, af as scaleByHeight, ag as scaleByWidth, ah as sortVersions, ai as splitSubnet, aj as symbolicToPermissions, ak as validateCardNumber, al as viewportToPx } from '../units-DRT6W-vu.cjs';
|
package/dist/tools/units.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { A as AspectRatioResult, B as BASE_LABELS, a as BASE_PREFIXES, b as BYTE_UNITS, c as BaseConvertResult, d as ByteConvertResult, e as ByteUnit, C as COMMON_CURRENCIES, f as COMMON_LOCALES, g as COMMON_PERMISSIONS, h as COMMON_RATIOS, i as COMMON_SIZES, j as COMMON_VIEWPORTS, D as Dimensions, F as FilePermissions,
|
|
1
|
+
export { A as AspectRatioResult, B as BASE_LABELS, a as BASE_PREFIXES, b as BYTE_UNITS, c as BaseConvertResult, d as ByteConvertResult, e as ByteUnit, C as COMMON_CURRENCIES, f as COMMON_LOCALES, g as COMMON_PERMISSIONS, h as COMMON_RATIOS, i as COMMON_SIZES, j as COMMON_VIEWPORTS, k as CardValidationResult, D as Dimensions, F as FilePermissions, l as FormatOptions, I as IpConversion, N as NotationStyle, m as NumberBase, P as Permission, n as PxConvertResult, S as SemverVersion, o as SubnetInfo, V as ViewportConvertResult, p as autoFormat, q as bumpVersion, r as calcAspectRatio, s as calcSubnet, t as compareSemver, v as convert, w as convertBytes, x as convertIp, y as coverBox, z as decimalToIp, E as decimalToIpCidr, G as describePermissions, H as fitIntoBox, J as formatNumber, K as formatValue, L as formatVwValue, M as formatWithSeparator, O as gcd, Q as ipFromBinary, R as ipFromDecimal, T as ipFromHex, U as ipToBinary, W as ipToDecimal, X as ipToDecimalCidr, Y as ipToHex, Z as ipToOctal, _ as isValid, $ as isValidCidr, a0 as isValidIp, a1 as isValidIpv4, a2 as octalToPermissions, a3 as parseFileSize, a4 as parseInput, a5 as parseNumberString, a6 as parseSemver, a7 as permissionsToChmod, a8 as permissionsToOctal, a9 as permissionsToSymbolic, aa as ptToPx, ab as pxToAll, ac as pxToViewport, ad as remToPx, ae as satisfiesRange, af as scaleByHeight, ag as scaleByWidth, ah as sortVersions, ai as splitSubnet, aj as symbolicToPermissions, ak as validateCardNumber, al as viewportToPx } from '../units-DRT6W-vu.js';
|
package/dist/tools/units.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { BASE_LABELS, BASE_PREFIXES, BYTE_UNITS, COMMON_CURRENCIES, COMMON_LOCALES, COMMON_PERMISSIONS, COMMON_RATIOS, COMMON_SIZES, COMMON_VIEWPORTS, autoFormat, bumpVersion, calcAspectRatio, calcSubnet, compareSemver, convert, convertBytes, convertIp, coverBox, decimalToIp, decimalToIpCidr, describePermissions, fitIntoBox, formatNumber, formatValue, formatVwValue, formatWithSeparator, gcd, ipFromBinary, ipFromDecimal, ipFromHex, ipToBinary, ipToDecimal, ipToDecimalCidr, ipToHex, ipToOctal, isValid, isValidCidr, isValidIp, isValidIpv4, octalToPermissions, parseFileSize, parseInput, parseNumberString, parseSemver, permissionsToChmod, permissionsToOctal, permissionsToSymbolic, ptToPx, pxToAll, pxToViewport, remToPx, satisfiesRange, scaleByHeight, scaleByWidth, sortVersions, splitSubnet, symbolicToPermissions, viewportToPx } from '../chunk-
|
|
1
|
+
export { BASE_LABELS, BASE_PREFIXES, BYTE_UNITS, COMMON_CURRENCIES, COMMON_LOCALES, COMMON_PERMISSIONS, COMMON_RATIOS, COMMON_SIZES, COMMON_VIEWPORTS, autoFormat, bumpVersion, calcAspectRatio, calcSubnet, compareSemver, convert, convertBytes, convertIp, coverBox, decimalToIp, decimalToIpCidr, describePermissions, fitIntoBox, formatNumber, formatValue, formatVwValue, formatWithSeparator, gcd, ipFromBinary, ipFromDecimal, ipFromHex, ipToBinary, ipToDecimal, ipToDecimalCidr, ipToHex, ipToOctal, isValid, isValidCidr, isValidIp, isValidIpv4, octalToPermissions, parseFileSize, parseInput, parseNumberString, parseSemver, permissionsToChmod, permissionsToOctal, permissionsToSymbolic, ptToPx, pxToAll, pxToViewport, remToPx, satisfiesRange, scaleByHeight, scaleByWidth, sortVersions, splitSubnet, symbolicToPermissions, validateCardNumber, viewportToPx } from '../chunk-YVFM5WYI.js';
|
|
2
2
|
import '../chunk-MLKGABMK.js';
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* - ip-converter : convertIp, isValidIpv4, ipToDecimal, decimalToIp, ipToHex, ipToBinary, ipToOctal, ipFromHex, ipFromBinary, ipFromDecimal
|
|
13
13
|
* - cidr-calc : calcSubnet, splitSubnet, isValidCidr, isValidIp, ipToDecimal (cidr), decimalToIp (cidr)
|
|
14
14
|
* - semver : parseSemver, isValid, compareSemver, satisfiesRange, bumpVersion, sortVersions
|
|
15
|
+
* - credit-card-validator : validateCardNumber
|
|
15
16
|
*/
|
|
16
17
|
interface PxConvertResult {
|
|
17
18
|
px: number;
|
|
@@ -221,6 +222,20 @@ declare function bumpVersion(version: string, bump: "major" | "minor" | "patch")
|
|
|
221
222
|
error: string;
|
|
222
223
|
};
|
|
223
224
|
declare function sortVersions(versions: string[], order?: "asc" | "desc"): string[];
|
|
225
|
+
interface CardValidationResult {
|
|
226
|
+
valid: boolean;
|
|
227
|
+
network: string | null;
|
|
228
|
+
length: number;
|
|
229
|
+
formatted: string;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Validate a credit card number via the Luhn checksum and detect its
|
|
233
|
+
* network (issuer) from the number's prefix and length. No card data is
|
|
234
|
+
* ever stored or transmitted.
|
|
235
|
+
*/
|
|
236
|
+
declare function validateCardNumber(input: string): CardValidationResult | {
|
|
237
|
+
error: string;
|
|
238
|
+
};
|
|
224
239
|
|
|
225
240
|
type units_AspectRatioResult = AspectRatioResult;
|
|
226
241
|
declare const units_BASE_LABELS: typeof BASE_LABELS;
|
|
@@ -235,6 +250,7 @@ declare const units_COMMON_PERMISSIONS: typeof COMMON_PERMISSIONS;
|
|
|
235
250
|
declare const units_COMMON_RATIOS: typeof COMMON_RATIOS;
|
|
236
251
|
declare const units_COMMON_SIZES: typeof COMMON_SIZES;
|
|
237
252
|
declare const units_COMMON_VIEWPORTS: typeof COMMON_VIEWPORTS;
|
|
253
|
+
type units_CardValidationResult = CardValidationResult;
|
|
238
254
|
type units_Dimensions = Dimensions;
|
|
239
255
|
type units_FilePermissions = FilePermissions;
|
|
240
256
|
type units_FormatOptions = FormatOptions;
|
|
@@ -294,9 +310,10 @@ declare const units_scaleByWidth: typeof scaleByWidth;
|
|
|
294
310
|
declare const units_sortVersions: typeof sortVersions;
|
|
295
311
|
declare const units_splitSubnet: typeof splitSubnet;
|
|
296
312
|
declare const units_symbolicToPermissions: typeof symbolicToPermissions;
|
|
313
|
+
declare const units_validateCardNumber: typeof validateCardNumber;
|
|
297
314
|
declare const units_viewportToPx: typeof viewportToPx;
|
|
298
315
|
declare namespace units {
|
|
299
|
-
export { type units_AspectRatioResult as AspectRatioResult, units_BASE_LABELS as BASE_LABELS, units_BASE_PREFIXES as BASE_PREFIXES, units_BYTE_UNITS as BYTE_UNITS, type units_BaseConvertResult as BaseConvertResult, type units_ByteConvertResult as ByteConvertResult, type units_ByteUnit as ByteUnit, units_COMMON_CURRENCIES as COMMON_CURRENCIES, units_COMMON_LOCALES as COMMON_LOCALES, units_COMMON_PERMISSIONS as COMMON_PERMISSIONS, units_COMMON_RATIOS as COMMON_RATIOS, units_COMMON_SIZES as COMMON_SIZES, units_COMMON_VIEWPORTS as COMMON_VIEWPORTS, type units_Dimensions as Dimensions, type units_FilePermissions as FilePermissions, type units_FormatOptions as FormatOptions, type units_IpConversion as IpConversion, type units_NotationStyle as NotationStyle, type units_NumberBase as NumberBase, type units_Permission as Permission, type units_PxConvertResult as PxConvertResult, type units_SemverVersion as SemverVersion, type units_SubnetInfo as SubnetInfo, type units_ViewportConvertResult as ViewportConvertResult, units_autoFormat as autoFormat, units_bumpVersion as bumpVersion, units_calcAspectRatio as calcAspectRatio, units_calcSubnet as calcSubnet, units_compareSemver as compareSemver, units_convert as convert, units_convertBytes as convertBytes, units_convertIp as convertIp, units_coverBox as coverBox, units_decimalToIp as decimalToIp, units_decimalToIpCidr as decimalToIpCidr, units_describePermissions as describePermissions, units_fitIntoBox as fitIntoBox, units_formatNumber as formatNumber, units_formatValue as formatValue, units_formatVwValue as formatVwValue, units_formatWithSeparator as formatWithSeparator, units_gcd as gcd, units_ipFromBinary as ipFromBinary, units_ipFromDecimal as ipFromDecimal, units_ipFromHex as ipFromHex, units_ipToBinary as ipToBinary, units_ipToDecimal as ipToDecimal, units_ipToDecimalCidr as ipToDecimalCidr, units_ipToHex as ipToHex, units_ipToOctal as ipToOctal, units_isValid as isValid, units_isValidCidr as isValidCidr, units_isValidIp as isValidIp, units_isValidIpv4 as isValidIpv4, units_octalToPermissions as octalToPermissions, units_parseFileSize as parseFileSize, units_parseInput as parseInput, units_parseNumberString as parseNumberString, units_parseSemver as parseSemver, units_permissionsToChmod as permissionsToChmod, units_permissionsToOctal as permissionsToOctal, units_permissionsToSymbolic as permissionsToSymbolic, units_ptToPx as ptToPx, units_pxToAll as pxToAll, units_pxToViewport as pxToViewport, units_remToPx as remToPx, units_satisfiesRange as satisfiesRange, units_scaleByHeight as scaleByHeight, units_scaleByWidth as scaleByWidth, units_sortVersions as sortVersions, units_splitSubnet as splitSubnet, units_symbolicToPermissions as symbolicToPermissions, units_viewportToPx as viewportToPx };
|
|
316
|
+
export { type units_AspectRatioResult as AspectRatioResult, units_BASE_LABELS as BASE_LABELS, units_BASE_PREFIXES as BASE_PREFIXES, units_BYTE_UNITS as BYTE_UNITS, type units_BaseConvertResult as BaseConvertResult, type units_ByteConvertResult as ByteConvertResult, type units_ByteUnit as ByteUnit, units_COMMON_CURRENCIES as COMMON_CURRENCIES, units_COMMON_LOCALES as COMMON_LOCALES, units_COMMON_PERMISSIONS as COMMON_PERMISSIONS, units_COMMON_RATIOS as COMMON_RATIOS, units_COMMON_SIZES as COMMON_SIZES, units_COMMON_VIEWPORTS as COMMON_VIEWPORTS, type units_CardValidationResult as CardValidationResult, type units_Dimensions as Dimensions, type units_FilePermissions as FilePermissions, type units_FormatOptions as FormatOptions, type units_IpConversion as IpConversion, type units_NotationStyle as NotationStyle, type units_NumberBase as NumberBase, type units_Permission as Permission, type units_PxConvertResult as PxConvertResult, type units_SemverVersion as SemverVersion, type units_SubnetInfo as SubnetInfo, type units_ViewportConvertResult as ViewportConvertResult, units_autoFormat as autoFormat, units_bumpVersion as bumpVersion, units_calcAspectRatio as calcAspectRatio, units_calcSubnet as calcSubnet, units_compareSemver as compareSemver, units_convert as convert, units_convertBytes as convertBytes, units_convertIp as convertIp, units_coverBox as coverBox, units_decimalToIp as decimalToIp, units_decimalToIpCidr as decimalToIpCidr, units_describePermissions as describePermissions, units_fitIntoBox as fitIntoBox, units_formatNumber as formatNumber, units_formatValue as formatValue, units_formatVwValue as formatVwValue, units_formatWithSeparator as formatWithSeparator, units_gcd as gcd, units_ipFromBinary as ipFromBinary, units_ipFromDecimal as ipFromDecimal, units_ipFromHex as ipFromHex, units_ipToBinary as ipToBinary, units_ipToDecimal as ipToDecimal, units_ipToDecimalCidr as ipToDecimalCidr, units_ipToHex as ipToHex, units_ipToOctal as ipToOctal, units_isValid as isValid, units_isValidCidr as isValidCidr, units_isValidIp as isValidIp, units_isValidIpv4 as isValidIpv4, units_octalToPermissions as octalToPermissions, units_parseFileSize as parseFileSize, units_parseInput as parseInput, units_parseNumberString as parseNumberString, units_parseSemver as parseSemver, units_permissionsToChmod as permissionsToChmod, units_permissionsToOctal as permissionsToOctal, units_permissionsToSymbolic as permissionsToSymbolic, units_ptToPx as ptToPx, units_pxToAll as pxToAll, units_pxToViewport as pxToViewport, units_remToPx as remToPx, units_satisfiesRange as satisfiesRange, units_scaleByHeight as scaleByHeight, units_scaleByWidth as scaleByWidth, units_sortVersions as sortVersions, units_splitSubnet as splitSubnet, units_symbolicToPermissions as symbolicToPermissions, units_validateCardNumber as validateCardNumber, units_viewportToPx as viewportToPx };
|
|
300
317
|
}
|
|
301
318
|
|
|
302
|
-
export {
|
|
319
|
+
export { isValidCidr as $, type AspectRatioResult as A, BASE_LABELS as B, COMMON_CURRENCIES as C, type Dimensions as D, decimalToIpCidr as E, type FilePermissions as F, describePermissions as G, fitIntoBox as H, type IpConversion as I, formatNumber as J, formatValue as K, formatVwValue as L, formatWithSeparator as M, type NotationStyle as N, gcd as O, type Permission as P, ipFromBinary as Q, ipFromDecimal as R, type SemverVersion as S, ipFromHex as T, ipToBinary as U, type ViewportConvertResult as V, ipToDecimal as W, ipToDecimalCidr as X, ipToHex as Y, ipToOctal as Z, isValid as _, BASE_PREFIXES as a, isValidIp as a0, isValidIpv4 as a1, octalToPermissions as a2, parseFileSize as a3, parseInput as a4, parseNumberString as a5, parseSemver as a6, permissionsToChmod as a7, permissionsToOctal as a8, permissionsToSymbolic as a9, ptToPx as aa, pxToAll as ab, pxToViewport as ac, remToPx as ad, satisfiesRange as ae, scaleByHeight as af, scaleByWidth as ag, sortVersions as ah, splitSubnet as ai, symbolicToPermissions as aj, validateCardNumber as ak, viewportToPx as al, BYTE_UNITS as b, type BaseConvertResult as c, type ByteConvertResult as d, type ByteUnit as e, COMMON_LOCALES as f, COMMON_PERMISSIONS as g, COMMON_RATIOS as h, COMMON_SIZES as i, COMMON_VIEWPORTS as j, type CardValidationResult as k, type FormatOptions as l, type NumberBase as m, type PxConvertResult as n, type SubnetInfo as o, autoFormat as p, bumpVersion as q, calcAspectRatio as r, calcSubnet as s, compareSemver as t, units as u, convert as v, convertBytes as w, convertIp as x, coverBox as y, decimalToIp as z };
|
|
@@ -12,6 +12,7 @@
|
|
|
12
12
|
* - ip-converter : convertIp, isValidIpv4, ipToDecimal, decimalToIp, ipToHex, ipToBinary, ipToOctal, ipFromHex, ipFromBinary, ipFromDecimal
|
|
13
13
|
* - cidr-calc : calcSubnet, splitSubnet, isValidCidr, isValidIp, ipToDecimal (cidr), decimalToIp (cidr)
|
|
14
14
|
* - semver : parseSemver, isValid, compareSemver, satisfiesRange, bumpVersion, sortVersions
|
|
15
|
+
* - credit-card-validator : validateCardNumber
|
|
15
16
|
*/
|
|
16
17
|
interface PxConvertResult {
|
|
17
18
|
px: number;
|
|
@@ -221,6 +222,20 @@ declare function bumpVersion(version: string, bump: "major" | "minor" | "patch")
|
|
|
221
222
|
error: string;
|
|
222
223
|
};
|
|
223
224
|
declare function sortVersions(versions: string[], order?: "asc" | "desc"): string[];
|
|
225
|
+
interface CardValidationResult {
|
|
226
|
+
valid: boolean;
|
|
227
|
+
network: string | null;
|
|
228
|
+
length: number;
|
|
229
|
+
formatted: string;
|
|
230
|
+
}
|
|
231
|
+
/**
|
|
232
|
+
* Validate a credit card number via the Luhn checksum and detect its
|
|
233
|
+
* network (issuer) from the number's prefix and length. No card data is
|
|
234
|
+
* ever stored or transmitted.
|
|
235
|
+
*/
|
|
236
|
+
declare function validateCardNumber(input: string): CardValidationResult | {
|
|
237
|
+
error: string;
|
|
238
|
+
};
|
|
224
239
|
|
|
225
240
|
type units_AspectRatioResult = AspectRatioResult;
|
|
226
241
|
declare const units_BASE_LABELS: typeof BASE_LABELS;
|
|
@@ -235,6 +250,7 @@ declare const units_COMMON_PERMISSIONS: typeof COMMON_PERMISSIONS;
|
|
|
235
250
|
declare const units_COMMON_RATIOS: typeof COMMON_RATIOS;
|
|
236
251
|
declare const units_COMMON_SIZES: typeof COMMON_SIZES;
|
|
237
252
|
declare const units_COMMON_VIEWPORTS: typeof COMMON_VIEWPORTS;
|
|
253
|
+
type units_CardValidationResult = CardValidationResult;
|
|
238
254
|
type units_Dimensions = Dimensions;
|
|
239
255
|
type units_FilePermissions = FilePermissions;
|
|
240
256
|
type units_FormatOptions = FormatOptions;
|
|
@@ -294,9 +310,10 @@ declare const units_scaleByWidth: typeof scaleByWidth;
|
|
|
294
310
|
declare const units_sortVersions: typeof sortVersions;
|
|
295
311
|
declare const units_splitSubnet: typeof splitSubnet;
|
|
296
312
|
declare const units_symbolicToPermissions: typeof symbolicToPermissions;
|
|
313
|
+
declare const units_validateCardNumber: typeof validateCardNumber;
|
|
297
314
|
declare const units_viewportToPx: typeof viewportToPx;
|
|
298
315
|
declare namespace units {
|
|
299
|
-
export { type units_AspectRatioResult as AspectRatioResult, units_BASE_LABELS as BASE_LABELS, units_BASE_PREFIXES as BASE_PREFIXES, units_BYTE_UNITS as BYTE_UNITS, type units_BaseConvertResult as BaseConvertResult, type units_ByteConvertResult as ByteConvertResult, type units_ByteUnit as ByteUnit, units_COMMON_CURRENCIES as COMMON_CURRENCIES, units_COMMON_LOCALES as COMMON_LOCALES, units_COMMON_PERMISSIONS as COMMON_PERMISSIONS, units_COMMON_RATIOS as COMMON_RATIOS, units_COMMON_SIZES as COMMON_SIZES, units_COMMON_VIEWPORTS as COMMON_VIEWPORTS, type units_Dimensions as Dimensions, type units_FilePermissions as FilePermissions, type units_FormatOptions as FormatOptions, type units_IpConversion as IpConversion, type units_NotationStyle as NotationStyle, type units_NumberBase as NumberBase, type units_Permission as Permission, type units_PxConvertResult as PxConvertResult, type units_SemverVersion as SemverVersion, type units_SubnetInfo as SubnetInfo, type units_ViewportConvertResult as ViewportConvertResult, units_autoFormat as autoFormat, units_bumpVersion as bumpVersion, units_calcAspectRatio as calcAspectRatio, units_calcSubnet as calcSubnet, units_compareSemver as compareSemver, units_convert as convert, units_convertBytes as convertBytes, units_convertIp as convertIp, units_coverBox as coverBox, units_decimalToIp as decimalToIp, units_decimalToIpCidr as decimalToIpCidr, units_describePermissions as describePermissions, units_fitIntoBox as fitIntoBox, units_formatNumber as formatNumber, units_formatValue as formatValue, units_formatVwValue as formatVwValue, units_formatWithSeparator as formatWithSeparator, units_gcd as gcd, units_ipFromBinary as ipFromBinary, units_ipFromDecimal as ipFromDecimal, units_ipFromHex as ipFromHex, units_ipToBinary as ipToBinary, units_ipToDecimal as ipToDecimal, units_ipToDecimalCidr as ipToDecimalCidr, units_ipToHex as ipToHex, units_ipToOctal as ipToOctal, units_isValid as isValid, units_isValidCidr as isValidCidr, units_isValidIp as isValidIp, units_isValidIpv4 as isValidIpv4, units_octalToPermissions as octalToPermissions, units_parseFileSize as parseFileSize, units_parseInput as parseInput, units_parseNumberString as parseNumberString, units_parseSemver as parseSemver, units_permissionsToChmod as permissionsToChmod, units_permissionsToOctal as permissionsToOctal, units_permissionsToSymbolic as permissionsToSymbolic, units_ptToPx as ptToPx, units_pxToAll as pxToAll, units_pxToViewport as pxToViewport, units_remToPx as remToPx, units_satisfiesRange as satisfiesRange, units_scaleByHeight as scaleByHeight, units_scaleByWidth as scaleByWidth, units_sortVersions as sortVersions, units_splitSubnet as splitSubnet, units_symbolicToPermissions as symbolicToPermissions, units_viewportToPx as viewportToPx };
|
|
316
|
+
export { type units_AspectRatioResult as AspectRatioResult, units_BASE_LABELS as BASE_LABELS, units_BASE_PREFIXES as BASE_PREFIXES, units_BYTE_UNITS as BYTE_UNITS, type units_BaseConvertResult as BaseConvertResult, type units_ByteConvertResult as ByteConvertResult, type units_ByteUnit as ByteUnit, units_COMMON_CURRENCIES as COMMON_CURRENCIES, units_COMMON_LOCALES as COMMON_LOCALES, units_COMMON_PERMISSIONS as COMMON_PERMISSIONS, units_COMMON_RATIOS as COMMON_RATIOS, units_COMMON_SIZES as COMMON_SIZES, units_COMMON_VIEWPORTS as COMMON_VIEWPORTS, type units_CardValidationResult as CardValidationResult, type units_Dimensions as Dimensions, type units_FilePermissions as FilePermissions, type units_FormatOptions as FormatOptions, type units_IpConversion as IpConversion, type units_NotationStyle as NotationStyle, type units_NumberBase as NumberBase, type units_Permission as Permission, type units_PxConvertResult as PxConvertResult, type units_SemverVersion as SemverVersion, type units_SubnetInfo as SubnetInfo, type units_ViewportConvertResult as ViewportConvertResult, units_autoFormat as autoFormat, units_bumpVersion as bumpVersion, units_calcAspectRatio as calcAspectRatio, units_calcSubnet as calcSubnet, units_compareSemver as compareSemver, units_convert as convert, units_convertBytes as convertBytes, units_convertIp as convertIp, units_coverBox as coverBox, units_decimalToIp as decimalToIp, units_decimalToIpCidr as decimalToIpCidr, units_describePermissions as describePermissions, units_fitIntoBox as fitIntoBox, units_formatNumber as formatNumber, units_formatValue as formatValue, units_formatVwValue as formatVwValue, units_formatWithSeparator as formatWithSeparator, units_gcd as gcd, units_ipFromBinary as ipFromBinary, units_ipFromDecimal as ipFromDecimal, units_ipFromHex as ipFromHex, units_ipToBinary as ipToBinary, units_ipToDecimal as ipToDecimal, units_ipToDecimalCidr as ipToDecimalCidr, units_ipToHex as ipToHex, units_ipToOctal as ipToOctal, units_isValid as isValid, units_isValidCidr as isValidCidr, units_isValidIp as isValidIp, units_isValidIpv4 as isValidIpv4, units_octalToPermissions as octalToPermissions, units_parseFileSize as parseFileSize, units_parseInput as parseInput, units_parseNumberString as parseNumberString, units_parseSemver as parseSemver, units_permissionsToChmod as permissionsToChmod, units_permissionsToOctal as permissionsToOctal, units_permissionsToSymbolic as permissionsToSymbolic, units_ptToPx as ptToPx, units_pxToAll as pxToAll, units_pxToViewport as pxToViewport, units_remToPx as remToPx, units_satisfiesRange as satisfiesRange, units_scaleByHeight as scaleByHeight, units_scaleByWidth as scaleByWidth, units_sortVersions as sortVersions, units_splitSubnet as splitSubnet, units_symbolicToPermissions as symbolicToPermissions, units_validateCardNumber as validateCardNumber, units_viewportToPx as viewportToPx };
|
|
300
317
|
}
|
|
301
318
|
|
|
302
|
-
export {
|
|
319
|
+
export { isValidCidr as $, type AspectRatioResult as A, BASE_LABELS as B, COMMON_CURRENCIES as C, type Dimensions as D, decimalToIpCidr as E, type FilePermissions as F, describePermissions as G, fitIntoBox as H, type IpConversion as I, formatNumber as J, formatValue as K, formatVwValue as L, formatWithSeparator as M, type NotationStyle as N, gcd as O, type Permission as P, ipFromBinary as Q, ipFromDecimal as R, type SemverVersion as S, ipFromHex as T, ipToBinary as U, type ViewportConvertResult as V, ipToDecimal as W, ipToDecimalCidr as X, ipToHex as Y, ipToOctal as Z, isValid as _, BASE_PREFIXES as a, isValidIp as a0, isValidIpv4 as a1, octalToPermissions as a2, parseFileSize as a3, parseInput as a4, parseNumberString as a5, parseSemver as a6, permissionsToChmod as a7, permissionsToOctal as a8, permissionsToSymbolic as a9, ptToPx as aa, pxToAll as ab, pxToViewport as ac, remToPx as ad, satisfiesRange as ae, scaleByHeight as af, scaleByWidth as ag, sortVersions as ah, splitSubnet as ai, symbolicToPermissions as aj, validateCardNumber as ak, viewportToPx as al, BYTE_UNITS as b, type BaseConvertResult as c, type ByteConvertResult as d, type ByteUnit as e, COMMON_LOCALES as f, COMMON_PERMISSIONS as g, COMMON_RATIOS as h, COMMON_SIZES as i, COMMON_VIEWPORTS as j, type CardValidationResult as k, type FormatOptions as l, type NumberBase as m, type PxConvertResult as n, type SubnetInfo as o, autoFormat as p, bumpVersion as q, calcAspectRatio as r, calcSubnet as s, compareSemver as t, units as u, convert as v, convertBytes as w, convertIp as x, coverBox as y, decimalToIp as z };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@utilix-tech/sdk",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "154+ developer utility tools for Node.js: JSON, encoding, hashing, color, CSS, network and more. Runs locally, no API key required.",
|
|
5
5
|
"author": "Utilix <hello@utilix.tech>",
|
|
6
6
|
"license": "MIT",
|