@utilix-tech/sdk 0.43.0 → 0.44.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 CHANGED
@@ -2,6 +2,10 @@
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.44.0
6
+ - Add `buildPermissionsPolicy`, `parsePermissionsPolicy` (permissions-policy-builder): build a `Permissions-Policy` response header from browser features and their per-feature allowlist with a plain-English note per feature, or parse an existing one into the same shape.
7
+ - Add `calculatePaybackPeriod` (payback-period-calculator): compute the simple and discounted payback period from an initial investment and a series of periodic cash flows.
8
+
5
9
  ## 0.43.0
6
10
  - Add `validateManifest` (manifest-validator): validate a web app manifest.json against the W3C Web App Manifest spec's installability requirements, including a 512x512 icon and a maskable icon check.
7
11
  - Add `lintToolSchema` (tool-schema-linter): lint an LLM tool/function-calling definition (OpenAI, Anthropic, or MCP format) for missing descriptions, invalid names, empty enums, and required/properties mismatches.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @utilix-tech/sdk
2
2
 
3
- **622 developer utility functions for Node.js: runs locally, no API key required.**
3
+ **626 developer utility functions for Node.js: runs locally, no API key required.**
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/@utilix-tech/sdk?style=flat-square&color=cb3837)](https://www.npmjs.com/package/@utilix-tech/sdk)
6
6
  [![npm downloads](https://img.shields.io/npm/dm/@utilix-tech/sdk?style=flat-square)](https://www.npmjs.com/package/@utilix-tech/sdk)
@@ -312,7 +312,7 @@ formatIso8601Duration(90061); // { iso: "P1DT1H1M1S", ... }
312
312
  ### `/units`: Conversions
313
313
 
314
314
  ```ts
315
- import { convertBytes, pxToAll, convert, formatValue, validateCardNumber, validateIban, calculateLoan, validateBarcode, calculateTax, calculateCompoundInterest, validateIsbn, calculateTipSplit, calculateSimpleInterest, calculateTimeValue, calculatePercentageChange, convertAprApy, calculateMarginMarkup, calculateDiscount, applySuccessiveDiscounts, calculateBreakEven, calculateVideoBitrate, calculateRuleOf72, calculateEmi, calculateRoi, compareUnitPrices } from "@utilix-tech/sdk/units";
315
+ import { convertBytes, pxToAll, convert, formatValue, validateCardNumber, validateIban, calculateLoan, validateBarcode, calculateTax, calculateCompoundInterest, validateIsbn, calculateTipSplit, calculateSimpleInterest, calculateTimeValue, calculatePercentageChange, convertAprApy, calculateMarginMarkup, calculateDiscount, applySuccessiveDiscounts, calculateBreakEven, calculateVideoBitrate, calculateRuleOf72, calculateEmi, calculateRoi, compareUnitPrices, calculatePaybackPeriod } from "@utilix-tech/sdk/units";
316
316
 
317
317
  // File sizes
318
318
  convertBytes(1073741824, "GB"); // 1
@@ -422,6 +422,10 @@ calculateCashBreakdown(53.75, USD_DENOMINATIONS);
422
422
  // Change owed for a payment/tender pair, broken down the same way
423
423
  calculateChange(4.65, 5.0, USD_DENOMINATIONS);
424
424
  // { changeDue: 0.35, breakdown: [{ denomination: 0.25, count: 1, subtotal: 0.25 }, ...], totalCount: 2 }
425
+
426
+ // Payback period: simple + discounted, from an initial investment and periodic cash flows
427
+ calculatePaybackPeriod({ initialInvestment: 1000, cashFlows: [400, 400, 400], discountRatePercent: 8 });
428
+ // { paybackPeriod: 2.5, paybackPeriodRounded: 3, recovered: true, discountedPaybackPeriod: 2.9029, ... }
425
429
  ```
426
430
 
427
431
  ---
@@ -433,7 +437,8 @@ import { getStatusCode, isValidIp, isValidIpv4, isValidIpv6,
433
437
  searchStatusCodes, buildGeoUrl, countryCodeToFlag,
434
438
  parseHar, validateSitemap, validateRobotsTxt,
435
439
  parseUserAgent, buildCacheControl, buildReferrerPolicy, parseIpv6Address, buildLinkHeader, checkSetCookieHeader, analyzeEmailHeaders,
436
- buildRangeHeader, parseContentRangeHeader, buildVaryHeader, parseVaryHeader, validateManifest } from "@utilix-tech/sdk/network";
440
+ buildRangeHeader, parseContentRangeHeader, buildVaryHeader, parseVaryHeader, validateManifest,
441
+ buildPermissionsPolicy, parsePermissionsPolicy } from "@utilix-tech/sdk/network";
437
442
 
438
443
  getStatusCode(404);
439
444
  // { code: 404, text: "Not Found", description: "...", category: "Client Error" }
@@ -508,6 +513,14 @@ parseVaryHeader("Vary: Accept-Encoding, Accept-Language");
508
513
  // Validate a web app manifest.json against the W3C spec's installability requirements
509
514
  validateManifest(JSON.stringify({ name: "My App", start_url: "/", display: "standalone", icons: [{ src: "/icon-512.png", sizes: "512x512", purpose: "any maskable" }] }));
510
515
  // { issues: [...], valid: true, summary: { hasMaskableIcon: true, has512Icon: true, ... } }
516
+
517
+ // Build a Permissions-Policy header from features and their allowlists, with a plain-English note per feature
518
+ buildPermissionsPolicy([{ feature: "camera", allowlist: [] }, { feature: "geolocation", allowlist: ["self"] }]);
519
+ // { header: "Permissions-Policy: camera=(), geolocation=(self)", directives: [...], warnings: [] }
520
+
521
+ // Parse an existing Permissions-Policy header value into the same shape
522
+ parsePermissionsPolicy("camera=(), geolocation=(self)");
523
+ // { header: "Permissions-Policy: camera=(), geolocation=(self)", directives: [...], warnings: [] }
511
524
  ```
512
525
 
513
526
  ---
@@ -745,8 +758,8 @@ readVideoInfo(new Uint8Array(videoBytes));
745
758
  | `@utilix-tech/sdk/data` | CSV, YAML, TOML, XML, INI, NDJSON parse and convert, SRT/WebVTT subtitles, Markdown front matter parser |
746
759
  | `@utilix-tech/sdk/generators` | UUID v4/v7, ULID, passwords, strength check, entropy estimator, fake data |
747
760
  | `@utilix-tech/sdk/time` | Date diff, timezone convert, cron parse, relative time |
748
- | `@utilix-tech/sdk/units` | Bytes, CSS px/rem, number bases, currency format, credit card/IBAN/barcode/ISBN validation, loan calculator, EMI calculator, compound/simple interest calculators, VAT/sales tax calculator, tip/bill split calculator, break-even point calculator, Rule of 72 calculator, savings goal calculator, ROI calculator, cash denomination/till calculator |
749
- | `@utilix-tech/sdk/network` | HTTP status codes, IP validation, country flags, geolocation URLs, HAR file parsing, User-Agent parsing, IPv6 address compress/expand |
761
+ | `@utilix-tech/sdk/units` | Bytes, CSS px/rem, number bases, currency format, credit card/IBAN/barcode/ISBN validation, loan calculator, EMI calculator, compound/simple interest calculators, VAT/sales tax calculator, tip/bill split calculator, break-even point calculator, Rule of 72 calculator, savings goal calculator, ROI calculator, cash denomination/till calculator, payback period calculator |
762
+ | `@utilix-tech/sdk/network` | HTTP status codes, IP validation, country flags, geolocation URLs, HAR file parsing, User-Agent parsing, IPv6 address compress/expand, Permissions-Policy header builder |
750
763
  | `@utilix-tech/sdk/api` | cURL build/parse, JWT decode/sign, JWKS parse, CORS headers, CSP header |
751
764
  | `@utilix-tech/sdk/code` | SQL format/minify, HTML format/minify, regex tester, GraphQL format, MIME type lookup, GitHub URL parsing, regex ReDoS detector, Conventional Commits linter |
752
765
  | `@utilix-tech/sdk/color` | Hex/RGB/HSL/HSV/CMYK convert, palette generation, contrast check |
@@ -6,6 +6,7 @@ __export(network_exports, {
6
6
  DNS_RECORD_TYPES: () => DNS_RECORD_TYPES,
7
7
  HTTP_HEADERS: () => HTTP_HEADERS,
8
8
  LINK_REL_VALUES: () => LINK_REL_VALUES,
9
+ PERMISSIONS_POLICY_FEATURES: () => PERMISSIONS_POLICY_FEATURES,
9
10
  REFERRER_POLICY_VALUES: () => REFERRER_POLICY_VALUES,
10
11
  STATUS_CODES: () => STATUS_CODES,
11
12
  analyzeEmailHeaders: () => analyzeEmailHeaders,
@@ -14,6 +15,7 @@ __export(network_exports, {
14
15
  buildGeoUrl: () => buildGeoUrl,
15
16
  buildLinkHeader: () => buildLinkHeader,
16
17
  buildMapUrl: () => buildMapUrl,
18
+ buildPermissionsPolicy: () => buildPermissionsPolicy,
17
19
  buildRangeHeader: () => buildRangeHeader,
18
20
  buildReferrerPolicy: () => buildReferrerPolicy,
19
21
  buildVaryHeader: () => buildVaryHeader,
@@ -37,6 +39,7 @@ __export(network_exports, {
37
39
  parseGeoResponse: () => parseGeoResponse,
38
40
  parseHar: () => parseHar,
39
41
  parseIpv6Address: () => parseIpv6Address,
42
+ parsePermissionsPolicy: () => parsePermissionsPolicy,
40
43
  parseUserAgent: () => parseUserAgent,
41
44
  parseVaryHeader: () => parseVaryHeader,
42
45
  searchHeaders: () => searchHeaders,
@@ -2471,5 +2474,106 @@ function validateManifest(jsonText) {
2471
2474
  }
2472
2475
  };
2473
2476
  }
2477
+ var PERMISSIONS_POLICY_NOTES = {
2478
+ camera: "Controls access to video capture devices (getUserMedia video).",
2479
+ microphone: "Controls access to audio capture devices (getUserMedia audio).",
2480
+ geolocation: "Controls access to the Geolocation API.",
2481
+ autoplay: "Controls whether media elements can autoplay without a user gesture.",
2482
+ fullscreen: "Controls access to the Fullscreen API (requestFullscreen).",
2483
+ payment: "Controls access to the Payment Request API.",
2484
+ usb: "Controls access to the WebUSB API.",
2485
+ accelerometer: "Controls access to the Accelerometer sensor API.",
2486
+ gyroscope: "Controls access to the Gyroscope sensor API.",
2487
+ magnetometer: "Controls access to the Magnetometer sensor API.",
2488
+ midi: "Controls access to the Web MIDI API.",
2489
+ "picture-in-picture": "Controls whether video elements can enter picture-in-picture mode.",
2490
+ "sync-xhr": "Controls whether synchronous XMLHttpRequest is allowed.",
2491
+ "display-capture": "Controls access to screen/tab capture (getDisplayMedia).",
2492
+ "encrypted-media": "Controls access to the Encrypted Media Extensions API (DRM playback).",
2493
+ "clipboard-read": "Controls read access to the async Clipboard API.",
2494
+ "clipboard-write": "Controls write access to the async Clipboard API.",
2495
+ "screen-wake-lock": "Controls access to the Screen Wake Lock API.",
2496
+ "web-share": "Controls access to the Web Share API.",
2497
+ "xr-spatial-tracking": "Controls access to WebXR device sensors and spatial tracking."
2498
+ };
2499
+ var PERMISSIONS_POLICY_FEATURES = Object.keys(PERMISSIONS_POLICY_NOTES);
2500
+ function _formatPermissionsPolicyAllowlist(allowlist) {
2501
+ if (allowlist.includes("*")) return "*";
2502
+ if (allowlist.length === 0) return "()";
2503
+ return "(" + allowlist.map((o) => o === "self" ? "self" : `"${o}"`).join(" ") + ")";
2504
+ }
2505
+ function buildPermissionsPolicy(features) {
2506
+ if (!Array.isArray(features) || features.length === 0) return { error: "At least one feature is required" };
2507
+ const warnings = [];
2508
+ const seen = /* @__PURE__ */ new Map();
2509
+ for (const f of features) {
2510
+ if (!f || typeof f.feature !== "string" || f.feature.trim() === "") continue;
2511
+ const name = f.feature.trim().toLowerCase();
2512
+ const allowlist = Array.isArray(f.allowlist) ? f.allowlist.map((o) => typeof o === "string" ? o.trim() : "").filter((o) => o.length > 0) : [];
2513
+ if (seen.has(name)) warnings.push(`duplicate feature "${name}" was merged, the last occurrence wins`);
2514
+ seen.set(name, { feature: name, allowlist });
2515
+ }
2516
+ if (seen.size === 0) return { error: "At least one feature is required" };
2517
+ const directives = [];
2518
+ for (const { feature, allowlist } of seen.values()) {
2519
+ if (!PERMISSIONS_POLICY_NOTES[feature]) {
2520
+ warnings.push(`"${feature}" is not a widely recognized feature name, it will still be included as written`);
2521
+ }
2522
+ if (allowlist.includes("*") && allowlist.length > 1) {
2523
+ warnings.push(`"${feature}" combines "*" with other origins; "*" already allows every origin so the others are redundant`);
2524
+ }
2525
+ const invalidOrigin = allowlist.find((o) => o !== "self" && o !== "*" && !/^https?:\/\//i.test(o));
2526
+ if (invalidOrigin) {
2527
+ warnings.push(`"${invalidOrigin}" on "${feature}" doesn't look like an origin (expected "self", "*", or an http(s):// URL); it will still be quoted as written`);
2528
+ }
2529
+ directives.push({
2530
+ feature,
2531
+ value: _formatPermissionsPolicyAllowlist(allowlist),
2532
+ note: PERMISSIONS_POLICY_NOTES[feature] ?? `Controls access to the "${feature}" feature.`
2533
+ });
2534
+ }
2535
+ const headerValue = directives.map((d) => `${d.feature}=${d.value}`).join(", ");
2536
+ return { header: `Permissions-Policy: ${headerValue}`, headerValue, directives, warnings };
2537
+ }
2538
+ function _splitPermissionsPolicyTopLevel(input) {
2539
+ const segments = [];
2540
+ let depth = 0;
2541
+ let current = "";
2542
+ for (const ch of input) {
2543
+ if (ch === "(") depth++;
2544
+ if (ch === ")") depth--;
2545
+ if (ch === "," && depth === 0) {
2546
+ if (current.trim()) segments.push(current.trim());
2547
+ current = "";
2548
+ } else {
2549
+ current += ch;
2550
+ }
2551
+ }
2552
+ if (current.trim()) segments.push(current.trim());
2553
+ return segments;
2554
+ }
2555
+ function _parsePermissionsPolicyAllowlist(rawValue) {
2556
+ if (rawValue === "*") return ["*"];
2557
+ if (rawValue === "()" || rawValue === "") return [];
2558
+ const inner = rawValue.replace(/^\(/, "").replace(/\)$/, "");
2559
+ const tokens = inner.match(/"[^"]*"|\S+/g) ?? [];
2560
+ return tokens.map((t) => t.replace(/^"|"$/g, ""));
2561
+ }
2562
+ function parsePermissionsPolicy(raw) {
2563
+ if (!raw || raw.trim() === "") return { error: "Input is empty" };
2564
+ const withoutLabel = raw.trim().replace(/^permissions-policy:\s*/i, "");
2565
+ const segments = _splitPermissionsPolicyTopLevel(withoutLabel);
2566
+ if (segments.length === 0) return { error: "No directives found" };
2567
+ const features = [];
2568
+ for (const segment of segments) {
2569
+ const eq = segment.indexOf("=");
2570
+ if (eq === -1) continue;
2571
+ const feature = segment.slice(0, eq).trim();
2572
+ const rawValue = segment.slice(eq + 1).trim();
2573
+ features.push({ feature, allowlist: _parsePermissionsPolicyAllowlist(rawValue) });
2574
+ }
2575
+ if (features.length === 0) return { error: "No directives found" };
2576
+ return buildPermissionsPolicy(features);
2577
+ }
2474
2578
 
2475
- export { DNS_RECORD_TYPES, HTTP_HEADERS, LINK_REL_VALUES, REFERRER_POLICY_VALUES, STATUS_CODES, analyzeEmailHeaders, buildCacheControl, buildDnsQueryUrl, buildGeoUrl, buildLinkHeader, buildMapUrl, buildRangeHeader, buildReferrerPolicy, buildVaryHeader, checkSetCookieHeader, countryCodeToFlag, formatCoordinates, formatTtl, getByCategory, getHeader, getHeadersByCategory, getStatusByCategory, getStatusCode, isClientError, isServerError, isSuccess, isValidIp, isValidIpv4, isValidIpv6, network_exports, parseContentRangeHeader, parseDnsResponse, parseGeoResponse, parseHar, parseIpv6Address, parseUserAgent, parseVaryHeader, searchHeaders, searchStatusCodes, statusCodeToText, typeNumberToLabel, validateDomain, validateHeaderName, validateHeaderValue, validateManifest, validateRobotsTxt, validateSitemap };
2579
+ export { DNS_RECORD_TYPES, HTTP_HEADERS, LINK_REL_VALUES, PERMISSIONS_POLICY_FEATURES, REFERRER_POLICY_VALUES, STATUS_CODES, analyzeEmailHeaders, buildCacheControl, buildDnsQueryUrl, buildGeoUrl, buildLinkHeader, buildMapUrl, buildPermissionsPolicy, buildRangeHeader, buildReferrerPolicy, buildVaryHeader, checkSetCookieHeader, countryCodeToFlag, formatCoordinates, formatTtl, getByCategory, getHeader, getHeadersByCategory, getStatusByCategory, getStatusCode, isClientError, isServerError, isSuccess, isValidIp, isValidIpv4, isValidIpv6, network_exports, parseContentRangeHeader, parseDnsResponse, parseGeoResponse, parseHar, parseIpv6Address, parsePermissionsPolicy, parseUserAgent, parseVaryHeader, searchHeaders, searchStatusCodes, statusCodeToText, typeNumberToLabel, validateDomain, validateHeaderName, validateHeaderValue, validateManifest, validateRobotsTxt, validateSitemap };
@@ -28,6 +28,7 @@ __export(units_exports, {
28
28
  calculateEmi: () => calculateEmi,
29
29
  calculateLoan: () => calculateLoan,
30
30
  calculateMarginMarkup: () => calculateMarginMarkup,
31
+ calculatePaybackPeriod: () => calculatePaybackPeriod,
31
32
  calculatePercentageChange: () => calculatePercentageChange,
32
33
  calculateRoi: () => calculateRoi,
33
34
  calculateRuleOf72: () => calculateRuleOf72,
@@ -1928,5 +1929,59 @@ function calculateChange(amountDue, amountTendered, denominations) {
1928
1929
  remainder: breakdown.remainder
1929
1930
  };
1930
1931
  }
1932
+ function _computePayback(initialInvestment, flows) {
1933
+ const round4 = (n) => Math.round(n * 1e4) / 1e4;
1934
+ let cumulative = 0;
1935
+ const cumulativeCashFlows = [];
1936
+ let period = null;
1937
+ for (let i = 0; i < flows.length; i++) {
1938
+ const prevCumulative = cumulative;
1939
+ cumulative += flows[i];
1940
+ cumulativeCashFlows.push(round4(cumulative));
1941
+ if (period === null && cumulative >= initialInvestment) {
1942
+ const remaining = initialInvestment - prevCumulative;
1943
+ const fraction = flows[i] !== 0 ? remaining / flows[i] : 0;
1944
+ period = i + fraction;
1945
+ }
1946
+ }
1947
+ return { cumulative: cumulativeCashFlows, period };
1948
+ }
1949
+ function calculatePaybackPeriod(input) {
1950
+ const { initialInvestment, cashFlows, discountRatePercent } = input;
1951
+ const round4 = (n) => Math.round(n * 1e4) / 1e4;
1952
+ if (!Number.isFinite(initialInvestment) || initialInvestment <= 0) {
1953
+ return { error: "initialInvestment must be a finite number greater than zero" };
1954
+ }
1955
+ if (!Array.isArray(cashFlows) || cashFlows.length === 0) {
1956
+ return { error: "cashFlows must be a non-empty array of numbers" };
1957
+ }
1958
+ if (cashFlows.some((f) => !Number.isFinite(f))) {
1959
+ return { error: "Every cash flow must be a finite number" };
1960
+ }
1961
+ const { cumulative, period } = _computePayback(initialInvestment, cashFlows);
1962
+ const result = {
1963
+ initialInvestment: round4(initialInvestment),
1964
+ cashFlows: cashFlows.map(round4),
1965
+ cumulativeCashFlows: cumulative,
1966
+ paybackPeriod: period !== null ? round4(period) : null,
1967
+ paybackPeriodRounded: period !== null ? Math.ceil(period) : null,
1968
+ recovered: period !== null
1969
+ };
1970
+ if (discountRatePercent !== void 0) {
1971
+ if (!Number.isFinite(discountRatePercent) || discountRatePercent < 0) {
1972
+ return { error: "discountRatePercent must be a finite, non-negative number when provided" };
1973
+ }
1974
+ const r = discountRatePercent / 100;
1975
+ const discountedCashFlows = cashFlows.map((f, i) => f / Math.pow(1 + r, i + 1));
1976
+ const { cumulative: discountedCumulative, period: discountedPeriod } = _computePayback(initialInvestment, discountedCashFlows);
1977
+ result.discountRatePercent = round4(discountRatePercent);
1978
+ result.discountedCashFlows = discountedCashFlows.map(round4);
1979
+ result.discountedCumulativeCashFlows = discountedCumulative;
1980
+ result.discountedPaybackPeriod = discountedPeriod !== null ? round4(discountedPeriod) : null;
1981
+ result.discountedPaybackPeriodRounded = discountedPeriod !== null ? Math.ceil(discountedPeriod) : null;
1982
+ result.discountedRecovered = discountedPeriod !== null;
1983
+ }
1984
+ return result;
1985
+ }
1931
1986
 
1932
- export { BASE_LABELS, BASE_PREFIXES, BYTE_UNITS, COMMON_CURRENCIES, COMMON_LOCALES, COMMON_PERMISSIONS, COMMON_RATIOS, COMMON_SIZES, COMMON_TAX_RATES, COMMON_TIP_PERCENTAGES, COMMON_VIEWPORTS, USD_DENOMINATIONS, applySuccessiveDiscounts, autoFormat, bumpVersion, calcAspectRatio, calcSubnet, calculateBreakEven, calculateCashBreakdown, calculateChange, calculateCompoundInterest, calculateDiscount, calculateEmi, calculateLoan, calculateMarginMarkup, calculatePercentageChange, calculateRoi, calculateRuleOf72, calculateSavingsGoal, calculateSimpleInterest, calculateTax, calculateTimeValue, calculateTipSplit, calculateVideoBitrate, compareSemver, compareUnitPrices, convert, convertAprApy, convertBytes, convertIp, coverBox, decimalToIp, decimalToIpCidr, describePermissions, fitIntoBox, formatNumber, formatValue, formatVwValue, formatWithSeparator, gcd, ipFromBinary, ipFromDecimal, ipFromHex, ipToBinary, ipToDecimal, ipToDecimalCidr, ipToHex, ipToOctal, isValid, isValidCidr, isValidIp, isValidIpv4, marginToMarkup, markupToMargin, octalToPermissions, parseFileSize, parseInput, parseNumberString, parseSemver, permissionsToChmod, permissionsToOctal, permissionsToSymbolic, ptToPx, pxToAll, pxToViewport, remToPx, satisfiesRange, scaleByHeight, scaleByWidth, sortVersions, splitSubnet, symbolicToPermissions, units_exports, validateBarcode, validateCardNumber, validateIban, validateIsbn, viewportToPx };
1987
+ export { BASE_LABELS, BASE_PREFIXES, BYTE_UNITS, COMMON_CURRENCIES, COMMON_LOCALES, COMMON_PERMISSIONS, COMMON_RATIOS, COMMON_SIZES, COMMON_TAX_RATES, COMMON_TIP_PERCENTAGES, COMMON_VIEWPORTS, USD_DENOMINATIONS, applySuccessiveDiscounts, autoFormat, bumpVersion, calcAspectRatio, calcSubnet, calculateBreakEven, calculateCashBreakdown, calculateChange, calculateCompoundInterest, calculateDiscount, calculateEmi, calculateLoan, calculateMarginMarkup, calculatePaybackPeriod, calculatePercentageChange, calculateRoi, calculateRuleOf72, calculateSavingsGoal, calculateSimpleInterest, calculateTax, calculateTimeValue, calculateTipSplit, calculateVideoBitrate, compareSemver, compareUnitPrices, convert, convertAprApy, convertBytes, convertIp, coverBox, decimalToIp, decimalToIpCidr, describePermissions, fitIntoBox, formatNumber, formatValue, formatVwValue, formatWithSeparator, gcd, ipFromBinary, ipFromDecimal, ipFromHex, ipToBinary, ipToDecimal, ipToDecimalCidr, ipToHex, ipToOctal, isValid, isValidCidr, isValidIp, isValidIpv4, marginToMarkup, markupToMargin, octalToPermissions, parseFileSize, parseInput, parseNumberString, parseSemver, permissionsToChmod, permissionsToOctal, permissionsToSymbolic, ptToPx, pxToAll, pxToViewport, remToPx, satisfiesRange, scaleByHeight, scaleByWidth, sortVersions, splitSubnet, symbolicToPermissions, units_exports, validateBarcode, validateCardNumber, validateIban, validateIsbn, viewportToPx };
package/dist/index.cjs CHANGED
@@ -8005,6 +8005,7 @@ __export(units_exports, {
8005
8005
  calculateEmi: () => calculateEmi,
8006
8006
  calculateLoan: () => calculateLoan,
8007
8007
  calculateMarginMarkup: () => calculateMarginMarkup,
8008
+ calculatePaybackPeriod: () => calculatePaybackPeriod,
8008
8009
  calculatePercentageChange: () => calculatePercentageChange,
8009
8010
  calculateRoi: () => calculateRoi,
8010
8011
  calculateRuleOf72: () => calculateRuleOf72,
@@ -9905,6 +9906,60 @@ function calculateChange(amountDue, amountTendered, denominations) {
9905
9906
  remainder: breakdown.remainder
9906
9907
  };
9907
9908
  }
9909
+ function _computePayback(initialInvestment, flows) {
9910
+ const round4 = (n) => Math.round(n * 1e4) / 1e4;
9911
+ let cumulative = 0;
9912
+ const cumulativeCashFlows = [];
9913
+ let period = null;
9914
+ for (let i = 0; i < flows.length; i++) {
9915
+ const prevCumulative = cumulative;
9916
+ cumulative += flows[i];
9917
+ cumulativeCashFlows.push(round4(cumulative));
9918
+ if (period === null && cumulative >= initialInvestment) {
9919
+ const remaining = initialInvestment - prevCumulative;
9920
+ const fraction = flows[i] !== 0 ? remaining / flows[i] : 0;
9921
+ period = i + fraction;
9922
+ }
9923
+ }
9924
+ return { cumulative: cumulativeCashFlows, period };
9925
+ }
9926
+ function calculatePaybackPeriod(input) {
9927
+ const { initialInvestment, cashFlows, discountRatePercent } = input;
9928
+ const round4 = (n) => Math.round(n * 1e4) / 1e4;
9929
+ if (!Number.isFinite(initialInvestment) || initialInvestment <= 0) {
9930
+ return { error: "initialInvestment must be a finite number greater than zero" };
9931
+ }
9932
+ if (!Array.isArray(cashFlows) || cashFlows.length === 0) {
9933
+ return { error: "cashFlows must be a non-empty array of numbers" };
9934
+ }
9935
+ if (cashFlows.some((f) => !Number.isFinite(f))) {
9936
+ return { error: "Every cash flow must be a finite number" };
9937
+ }
9938
+ const { cumulative, period } = _computePayback(initialInvestment, cashFlows);
9939
+ const result = {
9940
+ initialInvestment: round4(initialInvestment),
9941
+ cashFlows: cashFlows.map(round4),
9942
+ cumulativeCashFlows: cumulative,
9943
+ paybackPeriod: period !== null ? round4(period) : null,
9944
+ paybackPeriodRounded: period !== null ? Math.ceil(period) : null,
9945
+ recovered: period !== null
9946
+ };
9947
+ if (discountRatePercent !== void 0) {
9948
+ if (!Number.isFinite(discountRatePercent) || discountRatePercent < 0) {
9949
+ return { error: "discountRatePercent must be a finite, non-negative number when provided" };
9950
+ }
9951
+ const r = discountRatePercent / 100;
9952
+ const discountedCashFlows = cashFlows.map((f, i) => f / Math.pow(1 + r, i + 1));
9953
+ const { cumulative: discountedCumulative, period: discountedPeriod } = _computePayback(initialInvestment, discountedCashFlows);
9954
+ result.discountRatePercent = round4(discountRatePercent);
9955
+ result.discountedCashFlows = discountedCashFlows.map(round4);
9956
+ result.discountedCumulativeCashFlows = discountedCumulative;
9957
+ result.discountedPaybackPeriod = discountedPeriod !== null ? round4(discountedPeriod) : null;
9958
+ result.discountedPaybackPeriodRounded = discountedPeriod !== null ? Math.ceil(discountedPeriod) : null;
9959
+ result.discountedRecovered = discountedPeriod !== null;
9960
+ }
9961
+ return result;
9962
+ }
9908
9963
 
9909
9964
  // src/tools/network.ts
9910
9965
  var network_exports = {};
@@ -9912,6 +9967,7 @@ __export(network_exports, {
9912
9967
  DNS_RECORD_TYPES: () => DNS_RECORD_TYPES,
9913
9968
  HTTP_HEADERS: () => HTTP_HEADERS,
9914
9969
  LINK_REL_VALUES: () => LINK_REL_VALUES,
9970
+ PERMISSIONS_POLICY_FEATURES: () => PERMISSIONS_POLICY_FEATURES,
9915
9971
  REFERRER_POLICY_VALUES: () => REFERRER_POLICY_VALUES,
9916
9972
  STATUS_CODES: () => STATUS_CODES,
9917
9973
  analyzeEmailHeaders: () => analyzeEmailHeaders,
@@ -9920,6 +9976,7 @@ __export(network_exports, {
9920
9976
  buildGeoUrl: () => buildGeoUrl,
9921
9977
  buildLinkHeader: () => buildLinkHeader,
9922
9978
  buildMapUrl: () => buildMapUrl,
9979
+ buildPermissionsPolicy: () => buildPermissionsPolicy,
9923
9980
  buildRangeHeader: () => buildRangeHeader,
9924
9981
  buildReferrerPolicy: () => buildReferrerPolicy,
9925
9982
  buildVaryHeader: () => buildVaryHeader,
@@ -9943,6 +10000,7 @@ __export(network_exports, {
9943
10000
  parseGeoResponse: () => parseGeoResponse,
9944
10001
  parseHar: () => parseHar,
9945
10002
  parseIpv6Address: () => parseIpv6Address,
10003
+ parsePermissionsPolicy: () => parsePermissionsPolicy,
9946
10004
  parseUserAgent: () => parseUserAgent,
9947
10005
  parseVaryHeader: () => parseVaryHeader,
9948
10006
  searchHeaders: () => searchHeaders,
@@ -12377,6 +12435,107 @@ function validateManifest(jsonText) {
12377
12435
  }
12378
12436
  };
12379
12437
  }
12438
+ var PERMISSIONS_POLICY_NOTES = {
12439
+ camera: "Controls access to video capture devices (getUserMedia video).",
12440
+ microphone: "Controls access to audio capture devices (getUserMedia audio).",
12441
+ geolocation: "Controls access to the Geolocation API.",
12442
+ autoplay: "Controls whether media elements can autoplay without a user gesture.",
12443
+ fullscreen: "Controls access to the Fullscreen API (requestFullscreen).",
12444
+ payment: "Controls access to the Payment Request API.",
12445
+ usb: "Controls access to the WebUSB API.",
12446
+ accelerometer: "Controls access to the Accelerometer sensor API.",
12447
+ gyroscope: "Controls access to the Gyroscope sensor API.",
12448
+ magnetometer: "Controls access to the Magnetometer sensor API.",
12449
+ midi: "Controls access to the Web MIDI API.",
12450
+ "picture-in-picture": "Controls whether video elements can enter picture-in-picture mode.",
12451
+ "sync-xhr": "Controls whether synchronous XMLHttpRequest is allowed.",
12452
+ "display-capture": "Controls access to screen/tab capture (getDisplayMedia).",
12453
+ "encrypted-media": "Controls access to the Encrypted Media Extensions API (DRM playback).",
12454
+ "clipboard-read": "Controls read access to the async Clipboard API.",
12455
+ "clipboard-write": "Controls write access to the async Clipboard API.",
12456
+ "screen-wake-lock": "Controls access to the Screen Wake Lock API.",
12457
+ "web-share": "Controls access to the Web Share API.",
12458
+ "xr-spatial-tracking": "Controls access to WebXR device sensors and spatial tracking."
12459
+ };
12460
+ var PERMISSIONS_POLICY_FEATURES = Object.keys(PERMISSIONS_POLICY_NOTES);
12461
+ function _formatPermissionsPolicyAllowlist(allowlist) {
12462
+ if (allowlist.includes("*")) return "*";
12463
+ if (allowlist.length === 0) return "()";
12464
+ return "(" + allowlist.map((o) => o === "self" ? "self" : `"${o}"`).join(" ") + ")";
12465
+ }
12466
+ function buildPermissionsPolicy(features) {
12467
+ if (!Array.isArray(features) || features.length === 0) return { error: "At least one feature is required" };
12468
+ const warnings = [];
12469
+ const seen = /* @__PURE__ */ new Map();
12470
+ for (const f of features) {
12471
+ if (!f || typeof f.feature !== "string" || f.feature.trim() === "") continue;
12472
+ const name = f.feature.trim().toLowerCase();
12473
+ const allowlist = Array.isArray(f.allowlist) ? f.allowlist.map((o) => typeof o === "string" ? o.trim() : "").filter((o) => o.length > 0) : [];
12474
+ if (seen.has(name)) warnings.push(`duplicate feature "${name}" was merged, the last occurrence wins`);
12475
+ seen.set(name, { feature: name, allowlist });
12476
+ }
12477
+ if (seen.size === 0) return { error: "At least one feature is required" };
12478
+ const directives = [];
12479
+ for (const { feature, allowlist } of seen.values()) {
12480
+ if (!PERMISSIONS_POLICY_NOTES[feature]) {
12481
+ warnings.push(`"${feature}" is not a widely recognized feature name, it will still be included as written`);
12482
+ }
12483
+ if (allowlist.includes("*") && allowlist.length > 1) {
12484
+ warnings.push(`"${feature}" combines "*" with other origins; "*" already allows every origin so the others are redundant`);
12485
+ }
12486
+ const invalidOrigin = allowlist.find((o) => o !== "self" && o !== "*" && !/^https?:\/\//i.test(o));
12487
+ if (invalidOrigin) {
12488
+ warnings.push(`"${invalidOrigin}" on "${feature}" doesn't look like an origin (expected "self", "*", or an http(s):// URL); it will still be quoted as written`);
12489
+ }
12490
+ directives.push({
12491
+ feature,
12492
+ value: _formatPermissionsPolicyAllowlist(allowlist),
12493
+ note: PERMISSIONS_POLICY_NOTES[feature] ?? `Controls access to the "${feature}" feature.`
12494
+ });
12495
+ }
12496
+ const headerValue = directives.map((d) => `${d.feature}=${d.value}`).join(", ");
12497
+ return { header: `Permissions-Policy: ${headerValue}`, headerValue, directives, warnings };
12498
+ }
12499
+ function _splitPermissionsPolicyTopLevel(input) {
12500
+ const segments = [];
12501
+ let depth = 0;
12502
+ let current = "";
12503
+ for (const ch of input) {
12504
+ if (ch === "(") depth++;
12505
+ if (ch === ")") depth--;
12506
+ if (ch === "," && depth === 0) {
12507
+ if (current.trim()) segments.push(current.trim());
12508
+ current = "";
12509
+ } else {
12510
+ current += ch;
12511
+ }
12512
+ }
12513
+ if (current.trim()) segments.push(current.trim());
12514
+ return segments;
12515
+ }
12516
+ function _parsePermissionsPolicyAllowlist(rawValue) {
12517
+ if (rawValue === "*") return ["*"];
12518
+ if (rawValue === "()" || rawValue === "") return [];
12519
+ const inner = rawValue.replace(/^\(/, "").replace(/\)$/, "");
12520
+ const tokens = inner.match(/"[^"]*"|\S+/g) ?? [];
12521
+ return tokens.map((t) => t.replace(/^"|"$/g, ""));
12522
+ }
12523
+ function parsePermissionsPolicy(raw) {
12524
+ if (!raw || raw.trim() === "") return { error: "Input is empty" };
12525
+ const withoutLabel = raw.trim().replace(/^permissions-policy:\s*/i, "");
12526
+ const segments = _splitPermissionsPolicyTopLevel(withoutLabel);
12527
+ if (segments.length === 0) return { error: "No directives found" };
12528
+ const features = [];
12529
+ for (const segment of segments) {
12530
+ const eq = segment.indexOf("=");
12531
+ if (eq === -1) continue;
12532
+ const feature = segment.slice(0, eq).trim();
12533
+ const rawValue = segment.slice(eq + 1).trim();
12534
+ features.push({ feature, allowlist: _parsePermissionsPolicyAllowlist(rawValue) });
12535
+ }
12536
+ if (features.length === 0) return { error: "No directives found" };
12537
+ return buildPermissionsPolicy(features);
12538
+ }
12380
12539
 
12381
12540
  // src/tools/api.ts
12382
12541
  var api_exports = {};
package/dist/index.d.cts CHANGED
@@ -5,8 +5,8 @@ export { t as text } from './text-kHkT9VtT.cjs';
5
5
  export { d as data } from './data-BKpEOcOX.cjs';
6
6
  export { g as generators } from './generators-Du8cBesn.cjs';
7
7
  export { t as time } from './time-KqJjdqII.cjs';
8
- export { u as units } from './units-CzPwRC03.cjs';
9
- export { n as network } from './network-DISiPMoK.cjs';
8
+ export { u as units } from './units-WAgBQ7D7.cjs';
9
+ export { n as network } from './network-BlOVDE3Y.cjs';
10
10
  export { a as api } from './api-DmTNE4c1.cjs';
11
11
  export { c as code } from './code-KXoRsHtl.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-kHkT9VtT.js';
5
5
  export { d as data } from './data-BKpEOcOX.js';
6
6
  export { g as generators } from './generators-Du8cBesn.js';
7
7
  export { t as time } from './time-KqJjdqII.js';
8
- export { u as units } from './units-CzPwRC03.js';
9
- export { n as network } from './network-DISiPMoK.js';
8
+ export { u as units } from './units-WAgBQ7D7.js';
9
+ export { n as network } from './network-BlOVDE3Y.js';
10
10
  export { a as api } from './api-DmTNE4c1.js';
11
11
  export { c as code } from './code-KXoRsHtl.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-L6V4W4SU.js';
2
- export { units_exports as units } from './chunk-2MTHD2LG.js';
3
- export { network_exports as network } from './chunk-XPNZYPM5.js';
2
+ export { units_exports as units } from './chunk-WT3Q5LCN.js';
3
+ export { network_exports as network } from './chunk-GZBSKZ6F.js';
4
4
  export { api_exports as api } from './chunk-52ZDKSIX.js';
5
5
  export { code_exports as code } from './chunk-JL7YTXRB.js';
6
6
  export { color_exports as color } from './chunk-BPVAB4P2.js';
@@ -19,6 +19,7 @@
19
19
  * - email-header-analyzer: analyzeEmailHeaders
20
20
  * - http-range-header-builder: buildRangeHeader, parseContentRangeHeader
21
21
  * - vary-header-builder: buildVaryHeader, parseVaryHeader
22
+ * - permissions-policy-builder: buildPermissionsPolicy, parsePermissionsPolicy
22
23
  */
23
24
  declare const DNS_RECORD_TYPES: readonly ["A", "AAAA", "CNAME", "MX", "TXT", "NS", "SOA", "PTR", "SRV", "CAA"];
24
25
  type DnsRecordType = typeof DNS_RECORD_TYPES[number];
@@ -558,6 +559,40 @@ interface ManifestValidationResult {
558
559
  declare function validateManifest(jsonText: string): ManifestValidationResult | {
559
560
  error: string;
560
561
  };
562
+ interface PermissionsPolicyFeatureInput {
563
+ feature: string;
564
+ allowlist: string[];
565
+ }
566
+ interface PermissionsPolicyDirective {
567
+ feature: string;
568
+ value: string;
569
+ note: string;
570
+ }
571
+ interface PermissionsPolicyResult {
572
+ header: string;
573
+ headerValue: string;
574
+ directives: PermissionsPolicyDirective[];
575
+ warnings: string[];
576
+ }
577
+ declare const PERMISSIONS_POLICY_FEATURES: string[];
578
+ /**
579
+ * Build a `Permissions-Policy` response-header value from a list of browser
580
+ * features and their per-feature allowlist (`self`, specific origins, `*`
581
+ * for all origins, or an empty allowlist to disable the feature entirely),
582
+ * attaching a plain-English note on what each feature restricts.
583
+ */
584
+ declare function buildPermissionsPolicy(features: PermissionsPolicyFeatureInput[]): PermissionsPolicyResult | {
585
+ error: string;
586
+ };
587
+ /**
588
+ * Parse an existing `Permissions-Policy` header value (with or without a
589
+ * leading `Permissions-Policy:` label) into the same shape
590
+ * `buildPermissionsPolicy` returns, for explaining a header you found on a
591
+ * real response rather than building one from scratch.
592
+ */
593
+ declare function parsePermissionsPolicy(raw: string): PermissionsPolicyResult | {
594
+ error: string;
595
+ };
561
596
 
562
597
  type network_AuthResultEntry = AuthResultEntry;
563
598
  type network_BuildRangeHeaderOptions = BuildRangeHeaderOptions;
@@ -590,8 +625,12 @@ type network_LinkRel = LinkRel;
590
625
  type network_ManifestIconInfo = ManifestIconInfo;
591
626
  type network_ManifestIssue = ManifestIssue;
592
627
  type network_ManifestValidationResult = ManifestValidationResult;
628
+ declare const network_PERMISSIONS_POLICY_FEATURES: typeof PERMISSIONS_POLICY_FEATURES;
593
629
  type network_ParsedDnsResult = ParsedDnsResult;
594
630
  type network_ParsedGeoResult = ParsedGeoResult;
631
+ type network_PermissionsPolicyDirective = PermissionsPolicyDirective;
632
+ type network_PermissionsPolicyFeatureInput = PermissionsPolicyFeatureInput;
633
+ type network_PermissionsPolicyResult = PermissionsPolicyResult;
595
634
  declare const network_REFERRER_POLICY_VALUES: typeof REFERRER_POLICY_VALUES;
596
635
  type network_RangeEntry = RangeEntry;
597
636
  type network_RangeEntryInput = RangeEntryInput;
@@ -621,6 +660,7 @@ declare const network_buildDnsQueryUrl: typeof buildDnsQueryUrl;
621
660
  declare const network_buildGeoUrl: typeof buildGeoUrl;
622
661
  declare const network_buildLinkHeader: typeof buildLinkHeader;
623
662
  declare const network_buildMapUrl: typeof buildMapUrl;
663
+ declare const network_buildPermissionsPolicy: typeof buildPermissionsPolicy;
624
664
  declare const network_buildRangeHeader: typeof buildRangeHeader;
625
665
  declare const network_buildReferrerPolicy: typeof buildReferrerPolicy;
626
666
  declare const network_buildVaryHeader: typeof buildVaryHeader;
@@ -644,6 +684,7 @@ declare const network_parseDnsResponse: typeof parseDnsResponse;
644
684
  declare const network_parseGeoResponse: typeof parseGeoResponse;
645
685
  declare const network_parseHar: typeof parseHar;
646
686
  declare const network_parseIpv6Address: typeof parseIpv6Address;
687
+ declare const network_parsePermissionsPolicy: typeof parsePermissionsPolicy;
647
688
  declare const network_parseUserAgent: typeof parseUserAgent;
648
689
  declare const network_parseVaryHeader: typeof parseVaryHeader;
649
690
  declare const network_searchHeaders: typeof searchHeaders;
@@ -657,7 +698,7 @@ declare const network_validateManifest: typeof validateManifest;
657
698
  declare const network_validateRobotsTxt: typeof validateRobotsTxt;
658
699
  declare const network_validateSitemap: typeof validateSitemap;
659
700
  declare namespace network {
660
- export { type network_AuthResultEntry as AuthResultEntry, type network_BuildRangeHeaderOptions as BuildRangeHeaderOptions, type network_CacheControlDirective as CacheControlDirective, type network_CacheControlOptions as CacheControlOptions, type network_CacheControlResult as CacheControlResult, type network_ContentRangeResult as ContentRangeResult, type network_CookieAttributes as CookieAttributes, type network_CookieCheckResult as CookieCheckResult, 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_EmailHeaderAnalysis as EmailHeaderAnalysis, type network_EmailHeaderField as EmailHeaderField, 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_Ipv6AddressType as Ipv6AddressType, type network_Ipv6ParseResult as Ipv6ParseResult, network_LINK_REL_VALUES as LINK_REL_VALUES, type network_LinkHeaderEntry as LinkHeaderEntry, type network_LinkHeaderEntryInput as LinkHeaderEntryInput, type network_LinkHeaderResult as LinkHeaderResult, type network_LinkRel as LinkRel, type network_ManifestIconInfo as ManifestIconInfo, type network_ManifestIssue as ManifestIssue, type network_ManifestValidationResult as ManifestValidationResult, type network_ParsedDnsResult as ParsedDnsResult, type network_ParsedGeoResult as ParsedGeoResult, network_REFERRER_POLICY_VALUES as REFERRER_POLICY_VALUES, type network_RangeEntry as RangeEntry, type network_RangeEntryInput as RangeEntryInput, type network_RangeHeaderResult as RangeHeaderResult, type network_ReceivedHop as ReceivedHop, type network_ReferrerPolicyEntry as ReferrerPolicyEntry, type network_ReferrerPolicyResult as ReferrerPolicyResult, type network_ReferrerPolicyValue as ReferrerPolicyValue, 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_SameSiteValue as SameSiteValue, 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, type network_UaDeviceType as UaDeviceType, type network_UserAgentInfo as UserAgentInfo, type network_VaryHeaderEntry as VaryHeaderEntry, type network_VaryHeaderResult as VaryHeaderResult, network_analyzeEmailHeaders as analyzeEmailHeaders, network_buildCacheControl as buildCacheControl, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildLinkHeader as buildLinkHeader, network_buildMapUrl as buildMapUrl, network_buildRangeHeader as buildRangeHeader, network_buildReferrerPolicy as buildReferrerPolicy, network_buildVaryHeader as buildVaryHeader, network_checkSetCookieHeader as checkSetCookieHeader, 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_parseContentRangeHeader as parseContentRangeHeader, network_parseDnsResponse as parseDnsResponse, network_parseGeoResponse as parseGeoResponse, network_parseHar as parseHar, network_parseIpv6Address as parseIpv6Address, network_parseUserAgent as parseUserAgent, network_parseVaryHeader as parseVaryHeader, 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_validateManifest as validateManifest, network_validateRobotsTxt as validateRobotsTxt, network_validateSitemap as validateSitemap };
701
+ export { type network_AuthResultEntry as AuthResultEntry, type network_BuildRangeHeaderOptions as BuildRangeHeaderOptions, type network_CacheControlDirective as CacheControlDirective, type network_CacheControlOptions as CacheControlOptions, type network_CacheControlResult as CacheControlResult, type network_ContentRangeResult as ContentRangeResult, type network_CookieAttributes as CookieAttributes, type network_CookieCheckResult as CookieCheckResult, 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_EmailHeaderAnalysis as EmailHeaderAnalysis, type network_EmailHeaderField as EmailHeaderField, 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_Ipv6AddressType as Ipv6AddressType, type network_Ipv6ParseResult as Ipv6ParseResult, network_LINK_REL_VALUES as LINK_REL_VALUES, type network_LinkHeaderEntry as LinkHeaderEntry, type network_LinkHeaderEntryInput as LinkHeaderEntryInput, type network_LinkHeaderResult as LinkHeaderResult, type network_LinkRel as LinkRel, type network_ManifestIconInfo as ManifestIconInfo, type network_ManifestIssue as ManifestIssue, type network_ManifestValidationResult as ManifestValidationResult, network_PERMISSIONS_POLICY_FEATURES as PERMISSIONS_POLICY_FEATURES, type network_ParsedDnsResult as ParsedDnsResult, type network_ParsedGeoResult as ParsedGeoResult, type network_PermissionsPolicyDirective as PermissionsPolicyDirective, type network_PermissionsPolicyFeatureInput as PermissionsPolicyFeatureInput, type network_PermissionsPolicyResult as PermissionsPolicyResult, network_REFERRER_POLICY_VALUES as REFERRER_POLICY_VALUES, type network_RangeEntry as RangeEntry, type network_RangeEntryInput as RangeEntryInput, type network_RangeHeaderResult as RangeHeaderResult, type network_ReceivedHop as ReceivedHop, type network_ReferrerPolicyEntry as ReferrerPolicyEntry, type network_ReferrerPolicyResult as ReferrerPolicyResult, type network_ReferrerPolicyValue as ReferrerPolicyValue, 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_SameSiteValue as SameSiteValue, 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, type network_UaDeviceType as UaDeviceType, type network_UserAgentInfo as UserAgentInfo, type network_VaryHeaderEntry as VaryHeaderEntry, type network_VaryHeaderResult as VaryHeaderResult, network_analyzeEmailHeaders as analyzeEmailHeaders, network_buildCacheControl as buildCacheControl, network_buildDnsQueryUrl as buildDnsQueryUrl, network_buildGeoUrl as buildGeoUrl, network_buildLinkHeader as buildLinkHeader, network_buildMapUrl as buildMapUrl, network_buildPermissionsPolicy as buildPermissionsPolicy, network_buildRangeHeader as buildRangeHeader, network_buildReferrerPolicy as buildReferrerPolicy, network_buildVaryHeader as buildVaryHeader, network_checkSetCookieHeader as checkSetCookieHeader, 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_parseContentRangeHeader as parseContentRangeHeader, network_parseDnsResponse as parseDnsResponse, network_parseGeoResponse as parseGeoResponse, network_parseHar as parseHar, network_parseIpv6Address as parseIpv6Address, network_parsePermissionsPolicy as parsePermissionsPolicy, network_parseUserAgent as parseUserAgent, network_parseVaryHeader as parseVaryHeader, 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_validateManifest as validateManifest, network_validateRobotsTxt as validateRobotsTxt, network_validateSitemap as validateSitemap };
661
702
  }
662
703
 
663
- export { type UaDeviceType as $, type AuthResultEntry as A, type BuildRangeHeaderOptions as B, type CacheControlDirective as C, DNS_RECORD_TYPES as D, type EmailHeaderAnalysis as E, type ReceivedHop as F, type GeoResult as G, HTTP_HEADERS as H, type Ipv6AddressType as I, type ReferrerPolicyEntry as J, type ReferrerPolicyResult as K, LINK_REL_VALUES as L, type ManifestIconInfo as M, type ReferrerPolicyValue as N, type RobotsGroup as O, type ParsedDnsResult as P, type RobotsIssue as Q, REFERRER_POLICY_VALUES as R, type RobotsRule as S, type RobotsValidationResult as T, STATUS_CODES as U, type SameSiteValue as V, type SitemapIndexEntry as W, type SitemapIssue as X, type SitemapUrlEntry as Y, type SitemapValidationResult as Z, type StatusCode as _, type CacheControlOptions as a, type UserAgentInfo as a0, type VaryHeaderEntry as a1, type VaryHeaderResult as a2, analyzeEmailHeaders as a3, buildCacheControl as a4, buildDnsQueryUrl as a5, buildGeoUrl as a6, buildLinkHeader as a7, buildMapUrl as a8, buildRangeHeader as a9, statusCodeToText as aA, typeNumberToLabel as aB, validateDomain as aC, validateHeaderName as aD, validateHeaderValue as aE, validateManifest as aF, validateRobotsTxt as aG, validateSitemap as aH, buildReferrerPolicy as aa, buildVaryHeader as ab, checkSetCookieHeader as ac, countryCodeToFlag as ad, formatCoordinates as ae, formatTtl as af, getByCategory as ag, getHeader as ah, getHeadersByCategory as ai, getStatusByCategory as aj, getStatusCode as ak, isClientError as al, isServerError as am, isSuccess as an, isValidIp as ao, isValidIpv4 as ap, isValidIpv6 as aq, parseContentRangeHeader as ar, parseDnsResponse as as, parseGeoResponse as at, parseHar as au, parseIpv6Address as av, parseUserAgent as aw, parseVaryHeader as ax, searchHeaders as ay, searchStatusCodes as az, type CacheControlResult as b, type ContentRangeResult as c, type CookieAttributes as d, type CookieCheckResult as e, type DnsRecord as f, type DnsRecordType as g, type DnsResponse as h, type EmailHeaderField as i, type HarEntry as j, type HarParseResult as k, type HarSummary as l, type HeaderCategory as m, network as n, type HttpHeader as o, type Ipv6ParseResult as p, type LinkHeaderEntry as q, type LinkHeaderEntryInput as r, type LinkHeaderResult as s, type LinkRel as t, type ManifestIssue as u, type ManifestValidationResult as v, type ParsedGeoResult as w, type RangeEntry as x, type RangeEntryInput as y, type RangeHeaderResult as z };
704
+ export { type SitemapIssue as $, type AuthResultEntry as A, type BuildRangeHeaderOptions as B, type CacheControlDirective as C, DNS_RECORD_TYPES as D, type EmailHeaderAnalysis as E, type PermissionsPolicyResult as F, type GeoResult as G, HTTP_HEADERS as H, type Ipv6AddressType as I, type RangeEntry as J, type RangeEntryInput as K, LINK_REL_VALUES as L, type ManifestIconInfo as M, type RangeHeaderResult as N, type ReceivedHop as O, PERMISSIONS_POLICY_FEATURES as P, type ReferrerPolicyEntry as Q, REFERRER_POLICY_VALUES as R, type ReferrerPolicyResult as S, type ReferrerPolicyValue as T, type RobotsGroup as U, type RobotsIssue as V, type RobotsRule as W, type RobotsValidationResult as X, STATUS_CODES as Y, type SameSiteValue as Z, type SitemapIndexEntry as _, type CacheControlOptions as a, type SitemapUrlEntry as a0, type SitemapValidationResult as a1, type StatusCode as a2, type UaDeviceType as a3, type UserAgentInfo as a4, type VaryHeaderEntry as a5, type VaryHeaderResult as a6, analyzeEmailHeaders as a7, buildCacheControl as a8, buildDnsQueryUrl as a9, parseIpv6Address as aA, parsePermissionsPolicy as aB, parseUserAgent as aC, parseVaryHeader as aD, searchHeaders as aE, searchStatusCodes as aF, statusCodeToText as aG, typeNumberToLabel as aH, validateDomain as aI, validateHeaderName as aJ, validateHeaderValue as aK, validateManifest as aL, validateRobotsTxt as aM, validateSitemap as aN, buildGeoUrl as aa, buildLinkHeader as ab, buildMapUrl as ac, buildPermissionsPolicy as ad, buildRangeHeader as ae, buildReferrerPolicy as af, buildVaryHeader as ag, checkSetCookieHeader as ah, countryCodeToFlag as ai, formatCoordinates as aj, formatTtl as ak, getByCategory as al, getHeader as am, getHeadersByCategory as an, getStatusByCategory as ao, getStatusCode as ap, isClientError as aq, isServerError as ar, isSuccess as as, isValidIp as at, isValidIpv4 as au, isValidIpv6 as av, parseContentRangeHeader as aw, parseDnsResponse as ax, parseGeoResponse as ay, parseHar as az, type CacheControlResult as b, type ContentRangeResult as c, type CookieAttributes as d, type CookieCheckResult as e, type DnsRecord as f, type DnsRecordType as g, type DnsResponse as h, type EmailHeaderField as i, type HarEntry as j, type HarParseResult as k, type HarSummary as l, type HeaderCategory as m, network as n, type HttpHeader as o, type Ipv6ParseResult as p, type LinkHeaderEntry as q, type LinkHeaderEntryInput as r, type LinkHeaderResult as s, type LinkRel as t, type ManifestIssue as u, type ManifestValidationResult as v, type ParsedDnsResult as w, type ParsedGeoResult as x, type PermissionsPolicyDirective as y, type PermissionsPolicyFeatureInput as z };