@utilix-tech/sdk 0.47.0 → 0.49.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 +7 -0
- package/README.md +16 -6
- package/dist/{chunk-KMQHBUYO.js → chunk-24OT376F.js} +22 -1
- package/dist/{chunk-JR354NH4.js → chunk-4TIY6COQ.js} +64 -1
- package/dist/{chunk-S3OA5VCX.js → chunk-Y7YY733Z.js} +49 -1
- package/dist/{data-BKpEOcOX.d.ts → data-BJVJ879p.d.cts} +30 -2
- package/dist/{data-BKpEOcOX.d.cts → data-BJVJ879p.d.ts} +30 -2
- package/dist/index.cjs +139 -7
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/{network-BG0XDx5W.d.ts → network-DelcJeJa.d.cts} +32 -2
- package/dist/{network-BG0XDx5W.d.cts → network-DelcJeJa.d.ts} +32 -2
- package/dist/tools/data.cjs +63 -0
- package/dist/tools/data.d.cts +1 -1
- package/dist/tools/data.d.ts +1 -1
- package/dist/tools/data.js +1 -1
- package/dist/tools/network.cjs +48 -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 +21 -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-DU4Pisfx.d.cts → units-cVnt1_f6.d.cts} +24 -2
- package/dist/{units-DU4Pisfx.d.ts → units-cVnt1_f6.d.ts} +24 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,13 @@
|
|
|
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.49.0
|
|
6
|
+
- Add `calculateCashRounding` (cash-rounding-calculator): round a cashless total to the nearest payable cash denomination ("Swedish rounding"), with round-nearest, round-up, and round-down modes.
|
|
7
|
+
|
|
8
|
+
## 0.48.0
|
|
9
|
+
- Add `resolveYamlAnchors` (yaml-anchor-resolver): expand YAML anchors, aliases, and merge keys inline, and list which anchors were referenced vs. left unused.
|
|
10
|
+
- Add `splitSitemap` (sitemap-index-splitter): split a URL list exceeding the sitemaps.org 50,000-URL cap into multiple sitemap.xml files plus a sitemap index file.
|
|
11
|
+
|
|
5
12
|
## 0.47.0
|
|
6
13
|
- Add `buildContentDisposition`, `parseContentDisposition` (content-disposition-builder): build a `Content-Disposition` response header from a disposition type and filename, with an RFC 5987 `filename*` extended parameter for non-ASCII filenames, or parse an existing header into its type, filename, and raw parameters.
|
|
7
14
|
- Add `inspectGifFrames` (gif-frame-inspector): walk a GIF87a/89a file's block structure to report frame count, total animation duration, and loop count, without decoding any LZW-compressed pixel data.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @utilix-tech/sdk
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**638 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)
|
|
@@ -201,7 +201,7 @@ analyzeKeywordDensity("machine learning models power machine learning systems");
|
|
|
201
201
|
### `/data`: CSV / YAML / TOML / XML / INI / NDJSON / .env diff / subtitles / Markdown front matter & TOC
|
|
202
202
|
|
|
203
203
|
```ts
|
|
204
|
-
import { parseCsv, csvToJson, validateYaml, tomlToJson, jsonToToml,
|
|
204
|
+
import { parseCsv, csvToJson, validateYaml, resolveYamlAnchors, tomlToJson, jsonToToml,
|
|
205
205
|
formatXml, xmlToJson, jsonToXml, parseIni,
|
|
206
206
|
validateNdjson, formatNdjson, ndjsonToJsonArray, diffEnvExample,
|
|
207
207
|
parseSubtitles, convertSubtitles, shiftSubtitles, parseFrontMatter,
|
|
@@ -213,6 +213,8 @@ csvToJson("name,age\nalice,30"); // [{ name: "alice", age: "30" }]
|
|
|
213
213
|
|
|
214
214
|
// YAML
|
|
215
215
|
validateYaml("key: value\nlist:\n - a\n - b");
|
|
216
|
+
resolveYamlAnchors("defaults: &defaults\n timeout: 30\nprod:\n <<: *defaults\n timeout: 60\n");
|
|
217
|
+
// { resolvedYaml: "defaults:\n timeout: 30\nprod:\n timeout: 60\n", anchors: [...], unusedAnchors: [], aliasCount: 1 }
|
|
216
218
|
|
|
217
219
|
// TOML
|
|
218
220
|
tomlToJson('[server]\nhost = "localhost"\nport = 8080');
|
|
@@ -316,7 +318,7 @@ formatIso8601Duration(90061); // { iso: "P1DT1H1M1S", ... }
|
|
|
316
318
|
### `/units`: Conversions
|
|
317
319
|
|
|
318
320
|
```ts
|
|
319
|
-
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, calculateCdMaturity, calculateDepreciationSchedule } from "@utilix-tech/sdk/units";
|
|
321
|
+
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, calculateCdMaturity, calculateDepreciationSchedule, calculateCashRounding } from "@utilix-tech/sdk/units";
|
|
320
322
|
|
|
321
323
|
// File sizes
|
|
322
324
|
convertBytes(1073741824, "GB"); // 1
|
|
@@ -438,6 +440,10 @@ calculateCdMaturity(1000, 12, 12, 12, 3);
|
|
|
438
440
|
// Year-by-year depreciation schedule: straight-line, double-declining-balance, or sum-of-years-digits
|
|
439
441
|
calculateDepreciationSchedule(10000, 1000, 5, "straight-line");
|
|
440
442
|
// { totalDepreciation: 9000, schedule: [{ year: 1, depreciationExpense: 1800, accumulatedDepreciation: 1800, bookValue: 8200 }, ...] }
|
|
443
|
+
|
|
444
|
+
// Round a cashless total to the nearest payable cash denomination ("Swedish rounding")
|
|
445
|
+
calculateCashRounding(2.02, 0.05);
|
|
446
|
+
// { total: 2.02, roundingUnit: 0.05, mode: "nearest", roundedTotal: 2, adjustment: -0.02 }
|
|
441
447
|
```
|
|
442
448
|
|
|
443
449
|
---
|
|
@@ -447,7 +453,7 @@ calculateDepreciationSchedule(10000, 1000, 5, "straight-line");
|
|
|
447
453
|
```ts
|
|
448
454
|
import { getStatusCode, isValidIp, isValidIpv4, isValidIpv6,
|
|
449
455
|
searchStatusCodes, buildGeoUrl, countryCodeToFlag,
|
|
450
|
-
parseHar, validateSitemap, validateRobotsTxt,
|
|
456
|
+
parseHar, validateSitemap, splitSitemap, validateRobotsTxt,
|
|
451
457
|
parseUserAgent, buildCacheControl, buildReferrerPolicy, parseIpv6Address, buildLinkHeader, checkSetCookieHeader, analyzeEmailHeaders,
|
|
452
458
|
buildRangeHeader, parseContentRangeHeader, buildVaryHeader, parseVaryHeader, validateManifest,
|
|
453
459
|
buildPermissionsPolicy, parsePermissionsPolicy, buildClientHints, parseClientHintHeaders,
|
|
@@ -478,6 +484,10 @@ parseHar(har);
|
|
|
478
484
|
validateSitemap('<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"><url><loc>https://example.com/</loc></url></urlset>');
|
|
479
485
|
// { type: "urlset", urlCount: 1, entries: [...], issues: [...], valid: true }
|
|
480
486
|
|
|
487
|
+
// Split a URL list exceeding the 50,000-URL sitemap cap into multiple sitemap.xml files + a sitemap index
|
|
488
|
+
splitSitemap("https://example.com/a\nhttps://example.com/b\nhttps://example.com/c", { baseUrl: "https://example.com", urlsPerFile: 2 });
|
|
489
|
+
// { files: [{ filename: "sitemap-1.xml", urlCount: 2, xml: "..." }, { filename: "sitemap-2.xml", urlCount: 1, xml: "..." }], indexXml: "...", totalUrls: 3 }
|
|
490
|
+
|
|
481
491
|
// Validate a robots.txt file: User-agent groups, rules, and syntax mistakes
|
|
482
492
|
validateRobotsTxt("User-agent: *\nDisallow: /admin\nSitemap: https://example.com/sitemap.xml");
|
|
483
493
|
// { groups: [...], sitemaps: [...], issues: [...], valid: true }
|
|
@@ -794,11 +804,11 @@ inspectGifFrames(new Uint8Array(gifBytes));
|
|
|
794
804
|
| `@utilix-tech/sdk/encoding` | Base64, URL, HTML entities, Base32/Base58/Base62 encode/decode |
|
|
795
805
|
| `@utilix-tech/sdk/hashing` | MD5, SHA-1/256/512, bcrypt, HMAC, .htpasswd, SRI hashes, content-hash ETag generation |
|
|
796
806
|
| `@utilix-tech/sdk/text` | Case convert, slugify, word count, lorem ipsum, line ops, HTML→Markdown, Levenshtein/Damerau string distance, readability scoring, sentence length distribution, emoji lookup |
|
|
797
|
-
| `@utilix-tech/sdk/data` | CSV, YAML, TOML, XML, INI, NDJSON parse and convert, SRT/WebVTT subtitles, Markdown front matter parser |
|
|
807
|
+
| `@utilix-tech/sdk/data` | CSV, YAML, TOML, XML, INI, NDJSON parse and convert, SRT/WebVTT subtitles, Markdown front matter parser, YAML anchor/alias resolver |
|
|
798
808
|
| `@utilix-tech/sdk/generators` | UUID v4/v7, ULID, passwords, strength check, entropy estimator, fake data |
|
|
799
809
|
| `@utilix-tech/sdk/time` | Date diff, timezone convert, cron parse, relative time |
|
|
800
810
|
| `@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, CD maturity calculator |
|
|
801
|
-
| `@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, Client Hints header builder/parser, Content-Disposition header builder/parser |
|
|
811
|
+
| `@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, Client Hints header builder/parser, Content-Disposition header builder/parser, sitemap.xml validator, sitemap index splitter |
|
|
802
812
|
| `@utilix-tech/sdk/api` | cURL build/parse, JWT decode/sign, JWKS parse, CORS headers, CSP header |
|
|
803
813
|
| `@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 |
|
|
804
814
|
| `@utilix-tech/sdk/color` | Hex/RGB/HSL/HSV/CMYK convert, palette generation, contrast check |
|
|
@@ -22,6 +22,7 @@ __export(units_exports, {
|
|
|
22
22
|
calcSubnet: () => calcSubnet,
|
|
23
23
|
calculateBreakEven: () => calculateBreakEven,
|
|
24
24
|
calculateCashBreakdown: () => calculateCashBreakdown,
|
|
25
|
+
calculateCashRounding: () => calculateCashRounding,
|
|
25
26
|
calculateCdMaturity: () => calculateCdMaturity,
|
|
26
27
|
calculateChange: () => calculateChange,
|
|
27
28
|
calculateCompoundInterest: () => calculateCompoundInterest,
|
|
@@ -2076,5 +2077,25 @@ function calculateDepreciationSchedule(cost, salvageValue, usefulLifeYears, meth
|
|
|
2076
2077
|
schedule
|
|
2077
2078
|
};
|
|
2078
2079
|
}
|
|
2080
|
+
function calculateCashRounding(total, roundingUnit, mode = "nearest") {
|
|
2081
|
+
if (!Number.isFinite(total)) return { error: "total must be a finite number" };
|
|
2082
|
+
if (!Number.isFinite(roundingUnit) || roundingUnit <= 0) {
|
|
2083
|
+
return { error: "roundingUnit must be a finite number greater than zero" };
|
|
2084
|
+
}
|
|
2085
|
+
if (mode !== "nearest" && mode !== "up" && mode !== "down") {
|
|
2086
|
+
return { error: 'mode must be one of: "nearest", "up", "down"' };
|
|
2087
|
+
}
|
|
2088
|
+
const round22 = (n) => Math.round(n * 100) / 100;
|
|
2089
|
+
const steps = total / roundingUnit;
|
|
2090
|
+
const roundedSteps = mode === "up" ? Math.ceil(steps) : mode === "down" ? Math.floor(steps) : Math.round(steps);
|
|
2091
|
+
const roundedTotal = round22(roundedSteps * roundingUnit);
|
|
2092
|
+
return {
|
|
2093
|
+
total: round22(total),
|
|
2094
|
+
roundingUnit,
|
|
2095
|
+
mode,
|
|
2096
|
+
roundedTotal,
|
|
2097
|
+
adjustment: round22(roundedTotal - total)
|
|
2098
|
+
};
|
|
2099
|
+
}
|
|
2079
2100
|
|
|
2080
|
-
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, calculateCdMaturity, calculateChange, calculateCompoundInterest, calculateDepreciationSchedule, 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 };
|
|
2101
|
+
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, calculateCashRounding, calculateCdMaturity, calculateChange, calculateCompoundInterest, calculateDepreciationSchedule, 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 };
|
|
@@ -40,6 +40,7 @@ __export(data_exports, {
|
|
|
40
40
|
parseSubtitleTimestamp: () => parseSubtitleTimestamp,
|
|
41
41
|
parseSubtitles: () => parseSubtitles,
|
|
42
42
|
parseXmlToObject: () => parseXmlToObject,
|
|
43
|
+
resolveYamlAnchors: () => resolveYamlAnchors,
|
|
43
44
|
serializeSubtitles: () => serializeSubtitles,
|
|
44
45
|
shiftSubtitles: () => shiftSubtitles,
|
|
45
46
|
stringifyIni: () => stringifyIni,
|
|
@@ -1560,5 +1561,67 @@ function findCsvDuplicateRows(input, options) {
|
|
|
1560
1561
|
uniqueRowCount: parsed.rows.length - duplicateRowCount + duplicateGroups.length
|
|
1561
1562
|
};
|
|
1562
1563
|
}
|
|
1564
|
+
var _YAML_ANCHOR_RE = /(?:^|\s)&([A-Za-z0-9_.-]+)/g;
|
|
1565
|
+
var _YAML_ALIAS_RE = /(?:^|\s)\*([A-Za-z0-9_.-]+)/g;
|
|
1566
|
+
function _stripYamlLineComment(line) {
|
|
1567
|
+
let inSingle = false;
|
|
1568
|
+
let inDouble = false;
|
|
1569
|
+
for (let i = 0; i < line.length; i++) {
|
|
1570
|
+
const ch = line[i];
|
|
1571
|
+
if (ch === "'" && !inDouble) {
|
|
1572
|
+
inSingle = !inSingle;
|
|
1573
|
+
} else if (ch === '"' && !inSingle) {
|
|
1574
|
+
inDouble = !inDouble;
|
|
1575
|
+
} else if (ch === "#" && !inSingle && !inDouble && (i === 0 || /\s/.test(line[i - 1]))) {
|
|
1576
|
+
return line.slice(0, i);
|
|
1577
|
+
}
|
|
1578
|
+
}
|
|
1579
|
+
return line;
|
|
1580
|
+
}
|
|
1581
|
+
function resolveYamlAnchors(yamlText) {
|
|
1582
|
+
if (!yamlText || !yamlText.trim()) return { error: "Input is empty" };
|
|
1583
|
+
const anchorDefs = [];
|
|
1584
|
+
const referencedNames = /* @__PURE__ */ new Set();
|
|
1585
|
+
let aliasCount = 0;
|
|
1586
|
+
const lines = yamlText.split("\n");
|
|
1587
|
+
for (let i = 0; i < lines.length; i++) {
|
|
1588
|
+
const line = _stripYamlLineComment(lines[i]);
|
|
1589
|
+
const lineNum = i + 1;
|
|
1590
|
+
_YAML_ANCHOR_RE.lastIndex = 0;
|
|
1591
|
+
let m;
|
|
1592
|
+
while ((m = _YAML_ANCHOR_RE.exec(line)) !== null) {
|
|
1593
|
+
anchorDefs.push({ name: m[1], line: lineNum });
|
|
1594
|
+
}
|
|
1595
|
+
_YAML_ALIAS_RE.lastIndex = 0;
|
|
1596
|
+
while ((m = _YAML_ALIAS_RE.exec(line)) !== null) {
|
|
1597
|
+
referencedNames.add(m[1]);
|
|
1598
|
+
aliasCount++;
|
|
1599
|
+
}
|
|
1600
|
+
}
|
|
1601
|
+
let parsed;
|
|
1602
|
+
try {
|
|
1603
|
+
parsed = yaml.load(yamlText);
|
|
1604
|
+
} catch (e) {
|
|
1605
|
+
const err = e;
|
|
1606
|
+
return { error: err.reason ?? err.message };
|
|
1607
|
+
}
|
|
1608
|
+
let resolvedYaml;
|
|
1609
|
+
try {
|
|
1610
|
+
resolvedYaml = yaml.dump(parsed, { noRefs: true, lineWidth: -1 });
|
|
1611
|
+
} catch (e) {
|
|
1612
|
+
return { error: e instanceof Error ? e.message : String(e) };
|
|
1613
|
+
}
|
|
1614
|
+
const anchors = anchorDefs.map((a) => ({
|
|
1615
|
+
name: a.name,
|
|
1616
|
+
line: a.line,
|
|
1617
|
+
referenced: referencedNames.has(a.name)
|
|
1618
|
+
}));
|
|
1619
|
+
const seenAnchorNames = [];
|
|
1620
|
+
for (const a of anchorDefs) {
|
|
1621
|
+
if (!seenAnchorNames.includes(a.name)) seenAnchorNames.push(a.name);
|
|
1622
|
+
}
|
|
1623
|
+
const unusedAnchors = seenAnchorNames.filter((name) => !referencedNames.has(name));
|
|
1624
|
+
return { resolvedYaml, anchors, unusedAnchors, aliasCount };
|
|
1625
|
+
}
|
|
1563
1626
|
|
|
1564
|
-
export { convertSubtitles, csvToJson, csvToSqlInsert, data_exports, detectDelimiter, detectSubtitleFormat, diffEnvExample, envToExport, envToJson, findCsvDuplicateRows, formatNdjson, formatSubtitleTimestamp, formatToml, formatXml, generateMarkdownToc, getSection, getSectionNames, getTomlStats, getXmlStats, getYamlStats, iniToJson, jsonArrayToNdjson, jsonToIni, jsonToToml, jsonToXml, minifyNdjson, minifyToml, minifyXml, ndjsonToJsonArray, parseCsv, parseEnv, parseFrontMatter, parseIni, parseSubtitleTimestamp, parseSubtitles, parseXmlToObject, serializeSubtitles, shiftSubtitles, stringifyIni, toCsvString, tomlToJson, validateEnvKey, validateIni, validateNdjson, validateToml, validateXml, validateYaml, xmlToJson };
|
|
1627
|
+
export { convertSubtitles, csvToJson, csvToSqlInsert, data_exports, detectDelimiter, detectSubtitleFormat, diffEnvExample, envToExport, envToJson, findCsvDuplicateRows, formatNdjson, formatSubtitleTimestamp, formatToml, formatXml, generateMarkdownToc, getSection, getSectionNames, getTomlStats, getXmlStats, getYamlStats, iniToJson, jsonArrayToNdjson, jsonToIni, jsonToToml, jsonToXml, minifyNdjson, minifyToml, minifyXml, ndjsonToJsonArray, parseCsv, parseEnv, parseFrontMatter, parseIni, parseSubtitleTimestamp, parseSubtitles, parseXmlToObject, resolveYamlAnchors, serializeSubtitles, shiftSubtitles, stringifyIni, toCsvString, tomlToJson, validateEnvKey, validateIni, validateNdjson, validateToml, validateXml, validateYaml, xmlToJson };
|
|
@@ -49,6 +49,7 @@ __export(network_exports, {
|
|
|
49
49
|
parseVaryHeader: () => parseVaryHeader,
|
|
50
50
|
searchHeaders: () => searchHeaders,
|
|
51
51
|
searchStatusCodes: () => searchStatusCodes,
|
|
52
|
+
splitSitemap: () => splitSitemap,
|
|
52
53
|
statusCodeToText: () => statusCodeToText,
|
|
53
54
|
typeNumberToLabel: () => typeNumberToLabel,
|
|
54
55
|
validateDomain: () => validateDomain,
|
|
@@ -1554,6 +1555,53 @@ function validateSitemap(xml) {
|
|
|
1554
1555
|
const valid = !issues.some((i) => i.severity === "error");
|
|
1555
1556
|
return { type, urlCount: entries.length, entries, issues, valid };
|
|
1556
1557
|
}
|
|
1558
|
+
var SITEMAP_SPLITTER_MAX_URLS_PER_FILE = 5e4;
|
|
1559
|
+
function escapeXmlUrl(url) {
|
|
1560
|
+
return url.replace(/&(?!amp;|lt;|gt;|apos;|quot;|#\d+;)/g, "&").replace(/</g, "<").replace(/>/g, ">").replace(/"/g, """);
|
|
1561
|
+
}
|
|
1562
|
+
function splitSitemap(urlsText, options) {
|
|
1563
|
+
const urls = (urlsText ?? "").split("\n").map((line) => line.trim()).filter((line) => line.length > 0);
|
|
1564
|
+
if (urls.length === 0) return { error: "No URLs provided" };
|
|
1565
|
+
for (let i = 0; i < urls.length; i++) {
|
|
1566
|
+
if (!/^https?:\/\//i.test(urls[i])) {
|
|
1567
|
+
return { error: `Line ${i + 1}: "${urls[i]}" is not an absolute URL starting with http:// or https://` };
|
|
1568
|
+
}
|
|
1569
|
+
}
|
|
1570
|
+
if (!options || !/^https?:\/\//i.test(options.baseUrl ?? "")) {
|
|
1571
|
+
return { error: "baseUrl must be an absolute URL starting with http:// or https://" };
|
|
1572
|
+
}
|
|
1573
|
+
const baseUrl = options.baseUrl.replace(/\/+$/, "") + "/";
|
|
1574
|
+
let urlsPerFile = options.urlsPerFile ?? SITEMAP_SPLITTER_MAX_URLS_PER_FILE;
|
|
1575
|
+
if (urlsPerFile <= 0) urlsPerFile = SITEMAP_SPLITTER_MAX_URLS_PER_FILE;
|
|
1576
|
+
if (urlsPerFile > SITEMAP_SPLITTER_MAX_URLS_PER_FILE) urlsPerFile = SITEMAP_SPLITTER_MAX_URLS_PER_FILE;
|
|
1577
|
+
const filePrefix = (options.filePrefix || "sitemap").replace(/[^A-Za-z0-9_-]/g, "");
|
|
1578
|
+
const files = [];
|
|
1579
|
+
for (let i = 0; i < urls.length; i += urlsPerFile) {
|
|
1580
|
+
const chunk = urls.slice(i, i + urlsPerFile);
|
|
1581
|
+
const fileIndex = files.length + 1;
|
|
1582
|
+
const filename = `${filePrefix}-${fileIndex}.xml`;
|
|
1583
|
+
const urlLines = chunk.map((url) => ` <url>
|
|
1584
|
+
<loc>${escapeXmlUrl(url)}</loc>
|
|
1585
|
+
</url>`).join("\n");
|
|
1586
|
+
const xml = `<?xml version="1.0" encoding="UTF-8"?>
|
|
1587
|
+
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
1588
|
+
${urlLines}
|
|
1589
|
+
</urlset>
|
|
1590
|
+
`;
|
|
1591
|
+
files.push({ filename, urlCount: chunk.length, xml });
|
|
1592
|
+
}
|
|
1593
|
+
const today = (/* @__PURE__ */ new Date()).toISOString().slice(0, 10);
|
|
1594
|
+
const indexEntries = files.map((f) => ` <sitemap>
|
|
1595
|
+
<loc>${escapeXmlUrl(baseUrl + f.filename)}</loc>
|
|
1596
|
+
<lastmod>${today}</lastmod>
|
|
1597
|
+
</sitemap>`).join("\n");
|
|
1598
|
+
const indexXml = `<?xml version="1.0" encoding="UTF-8"?>
|
|
1599
|
+
<sitemapindex xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
|
1600
|
+
${indexEntries}
|
|
1601
|
+
</sitemapindex>
|
|
1602
|
+
`;
|
|
1603
|
+
return { files, indexXml, totalUrls: urls.length };
|
|
1604
|
+
}
|
|
1557
1605
|
var KNOWN_ROBOTS_DIRECTIVES = /* @__PURE__ */ new Set(["user-agent", "disallow", "allow", "sitemap", "crawl-delay", "host"]);
|
|
1558
1606
|
function validateRobotsTxt(text) {
|
|
1559
1607
|
if (!text || !text.trim()) return { error: "Input is empty" };
|
|
@@ -2728,4 +2776,4 @@ function parseContentDisposition(header) {
|
|
|
2728
2776
|
return { type, filename, filenameIsExtended, params };
|
|
2729
2777
|
}
|
|
2730
2778
|
|
|
2731
|
-
export { CLIENT_HINTS, DNS_RECORD_TYPES, HTTP_HEADERS, LINK_REL_VALUES, PERMISSIONS_POLICY_FEATURES, REFERRER_POLICY_VALUES, STATUS_CODES, analyzeEmailHeaders, buildCacheControl, buildClientHints, buildContentDisposition, 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, parseClientHintHeaders, parseContentDisposition, parseContentRangeHeader, parseDnsResponse, parseGeoResponse, parseHar, parseIpv6Address, parsePermissionsPolicy, parseUserAgent, parseVaryHeader, searchHeaders, searchStatusCodes, statusCodeToText, typeNumberToLabel, validateDomain, validateHeaderName, validateHeaderValue, validateManifest, validateRobotsTxt, validateSitemap };
|
|
2779
|
+
export { CLIENT_HINTS, DNS_RECORD_TYPES, HTTP_HEADERS, LINK_REL_VALUES, PERMISSIONS_POLICY_FEATURES, REFERRER_POLICY_VALUES, STATUS_CODES, analyzeEmailHeaders, buildCacheControl, buildClientHints, buildContentDisposition, 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, parseClientHintHeaders, parseContentDisposition, parseContentRangeHeader, parseDnsResponse, parseGeoResponse, parseHar, parseIpv6Address, parsePermissionsPolicy, parseUserAgent, parseVaryHeader, searchHeaders, searchStatusCodes, splitSitemap, statusCodeToText, typeNumberToLabel, validateDomain, validateHeaderName, validateHeaderValue, validateManifest, validateRobotsTxt, validateSitemap };
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
* - markdown-toc-generator: generateMarkdownToc
|
|
18
18
|
* - csv-to-sql-insert-generator: csvToSqlInsert
|
|
19
19
|
* - csv-duplicate-row-finder: findCsvDuplicateRows
|
|
20
|
+
* - yaml-anchor-resolver: resolveYamlAnchors
|
|
20
21
|
*/
|
|
21
22
|
interface ValidationResult {
|
|
22
23
|
valid: boolean;
|
|
@@ -372,6 +373,29 @@ interface CsvDuplicateResult {
|
|
|
372
373
|
declare function findCsvDuplicateRows(input: string, options?: CsvDuplicateOptions): CsvDuplicateResult | {
|
|
373
374
|
error: string;
|
|
374
375
|
};
|
|
376
|
+
interface YamlAnchorInfo {
|
|
377
|
+
name: string;
|
|
378
|
+
line: number;
|
|
379
|
+
referenced: boolean;
|
|
380
|
+
}
|
|
381
|
+
interface YamlAnchorResolveResult {
|
|
382
|
+
resolvedYaml: string;
|
|
383
|
+
anchors: YamlAnchorInfo[];
|
|
384
|
+
unusedAnchors: string[];
|
|
385
|
+
aliasCount: number;
|
|
386
|
+
}
|
|
387
|
+
interface YamlAnchorResolveError {
|
|
388
|
+
error: string;
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* Expand every YAML anchor, alias, and merge key in the input inline, and
|
|
392
|
+
* report which anchors were referenced vs. left unused. Unlike
|
|
393
|
+
* `validateYaml`, which only checks syntax, this fully resolves the
|
|
394
|
+
* document via js-yaml (which already implements anchor/alias/merge-key
|
|
395
|
+
* resolution per the YAML spec) and re-serializes it with no `&`/`*`
|
|
396
|
+
* syntax remaining.
|
|
397
|
+
*/
|
|
398
|
+
declare function resolveYamlAnchors(yamlText: string): YamlAnchorResolveResult | YamlAnchorResolveError;
|
|
375
399
|
|
|
376
400
|
type data_ConvertedSubtitles = ConvertedSubtitles;
|
|
377
401
|
type data_CsvDuplicateGroup = CsvDuplicateGroup;
|
|
@@ -401,6 +425,9 @@ type data_TomlFormatResult = TomlFormatResult;
|
|
|
401
425
|
type data_ValidationResult = ValidationResult;
|
|
402
426
|
type data_XmlFormatResult = XmlFormatResult;
|
|
403
427
|
type data_XmlToJsonOptions = XmlToJsonOptions;
|
|
428
|
+
type data_YamlAnchorInfo = YamlAnchorInfo;
|
|
429
|
+
type data_YamlAnchorResolveError = YamlAnchorResolveError;
|
|
430
|
+
type data_YamlAnchorResolveResult = YamlAnchorResolveResult;
|
|
404
431
|
declare const data_convertSubtitles: typeof convertSubtitles;
|
|
405
432
|
declare const data_csvToJson: typeof csvToJson;
|
|
406
433
|
declare const data_csvToSqlInsert: typeof csvToSqlInsert;
|
|
@@ -436,6 +463,7 @@ declare const data_parseIni: typeof parseIni;
|
|
|
436
463
|
declare const data_parseSubtitleTimestamp: typeof parseSubtitleTimestamp;
|
|
437
464
|
declare const data_parseSubtitles: typeof parseSubtitles;
|
|
438
465
|
declare const data_parseXmlToObject: typeof parseXmlToObject;
|
|
466
|
+
declare const data_resolveYamlAnchors: typeof resolveYamlAnchors;
|
|
439
467
|
declare const data_serializeSubtitles: typeof serializeSubtitles;
|
|
440
468
|
declare const data_shiftSubtitles: typeof shiftSubtitles;
|
|
441
469
|
declare const data_stringifyIni: typeof stringifyIni;
|
|
@@ -449,7 +477,7 @@ declare const data_validateXml: typeof validateXml;
|
|
|
449
477
|
declare const data_validateYaml: typeof validateYaml;
|
|
450
478
|
declare const data_xmlToJson: typeof xmlToJson;
|
|
451
479
|
declare namespace data {
|
|
452
|
-
export { type data_ConvertedSubtitles as ConvertedSubtitles, type data_CsvDuplicateGroup as CsvDuplicateGroup, type data_CsvDuplicateOptions as CsvDuplicateOptions, type data_CsvDuplicateResult as CsvDuplicateResult, type data_CsvParseResult as CsvParseResult, type data_CsvToSqlOptions as CsvToSqlOptions, type data_CsvToSqlResult as CsvToSqlResult, type data_EnvDiffError as EnvDiffError, type data_EnvDiffResult as EnvDiffResult, type data_EnvEntry as EnvEntry, type data_EnvParseResult as EnvParseResult, type data_FrontMatterError as FrontMatterError, type data_FrontMatterResult as FrontMatterResult, type data_IniSection as IniSection, type data_MarkdownTocEntry as MarkdownTocEntry, type data_MarkdownTocOptions as MarkdownTocOptions, type data_MarkdownTocResult as MarkdownTocResult, type data_NdjsonLineResult as NdjsonLineResult, type data_NdjsonValidateResult as NdjsonValidateResult, type data_ParseOptions as ParseOptions, type data_ParsedIni as ParsedIni, type data_ParsedSubtitles as ParsedSubtitles, type data_SubtitleCue as SubtitleCue, type data_SubtitleFormat as SubtitleFormat, type data_TomlFormatResult as TomlFormatResult, type data_ValidationResult as ValidationResult, type data_XmlFormatResult as XmlFormatResult, type data_XmlToJsonOptions as XmlToJsonOptions, data_convertSubtitles as convertSubtitles, data_csvToJson as csvToJson, data_csvToSqlInsert as csvToSqlInsert, data_detectDelimiter as detectDelimiter, data_detectSubtitleFormat as detectSubtitleFormat, data_diffEnvExample as diffEnvExample, data_envToExport as envToExport, data_envToJson as envToJson, data_findCsvDuplicateRows as findCsvDuplicateRows, data_formatNdjson as formatNdjson, data_formatSubtitleTimestamp as formatSubtitleTimestamp, data_formatToml as formatToml, data_formatXml as formatXml, data_generateMarkdownToc as generateMarkdownToc, data_getSection as getSection, data_getSectionNames as getSectionNames, data_getTomlStats as getTomlStats, data_getXmlStats as getXmlStats, data_getYamlStats as getYamlStats, data_iniToJson as iniToJson, data_jsonArrayToNdjson as jsonArrayToNdjson, data_jsonToIni as jsonToIni, data_jsonToToml as jsonToToml, data_jsonToXml as jsonToXml, data_minifyNdjson as minifyNdjson, data_minifyToml as minifyToml, data_minifyXml as minifyXml, data_ndjsonToJsonArray as ndjsonToJsonArray, data_parseCsv as parseCsv, data_parseEnv as parseEnv, data_parseFrontMatter as parseFrontMatter, data_parseIni as parseIni, data_parseSubtitleTimestamp as parseSubtitleTimestamp, data_parseSubtitles as parseSubtitles, data_parseXmlToObject as parseXmlToObject, data_serializeSubtitles as serializeSubtitles, data_shiftSubtitles as shiftSubtitles, data_stringifyIni as stringifyIni, data_toCsvString as toCsvString, data_tomlToJson as tomlToJson, data_validateEnvKey as validateEnvKey, data_validateIni as validateIni, data_validateNdjson as validateNdjson, data_validateToml as validateToml, data_validateXml as validateXml, data_validateYaml as validateYaml, data_xmlToJson as xmlToJson };
|
|
480
|
+
export { type data_ConvertedSubtitles as ConvertedSubtitles, type data_CsvDuplicateGroup as CsvDuplicateGroup, type data_CsvDuplicateOptions as CsvDuplicateOptions, type data_CsvDuplicateResult as CsvDuplicateResult, type data_CsvParseResult as CsvParseResult, type data_CsvToSqlOptions as CsvToSqlOptions, type data_CsvToSqlResult as CsvToSqlResult, type data_EnvDiffError as EnvDiffError, type data_EnvDiffResult as EnvDiffResult, type data_EnvEntry as EnvEntry, type data_EnvParseResult as EnvParseResult, type data_FrontMatterError as FrontMatterError, type data_FrontMatterResult as FrontMatterResult, type data_IniSection as IniSection, type data_MarkdownTocEntry as MarkdownTocEntry, type data_MarkdownTocOptions as MarkdownTocOptions, type data_MarkdownTocResult as MarkdownTocResult, type data_NdjsonLineResult as NdjsonLineResult, type data_NdjsonValidateResult as NdjsonValidateResult, type data_ParseOptions as ParseOptions, type data_ParsedIni as ParsedIni, type data_ParsedSubtitles as ParsedSubtitles, type data_SubtitleCue as SubtitleCue, type data_SubtitleFormat as SubtitleFormat, type data_TomlFormatResult as TomlFormatResult, type data_ValidationResult as ValidationResult, type data_XmlFormatResult as XmlFormatResult, type data_XmlToJsonOptions as XmlToJsonOptions, type data_YamlAnchorInfo as YamlAnchorInfo, type data_YamlAnchorResolveError as YamlAnchorResolveError, type data_YamlAnchorResolveResult as YamlAnchorResolveResult, data_convertSubtitles as convertSubtitles, data_csvToJson as csvToJson, data_csvToSqlInsert as csvToSqlInsert, data_detectDelimiter as detectDelimiter, data_detectSubtitleFormat as detectSubtitleFormat, data_diffEnvExample as diffEnvExample, data_envToExport as envToExport, data_envToJson as envToJson, data_findCsvDuplicateRows as findCsvDuplicateRows, data_formatNdjson as formatNdjson, data_formatSubtitleTimestamp as formatSubtitleTimestamp, data_formatToml as formatToml, data_formatXml as formatXml, data_generateMarkdownToc as generateMarkdownToc, data_getSection as getSection, data_getSectionNames as getSectionNames, data_getTomlStats as getTomlStats, data_getXmlStats as getXmlStats, data_getYamlStats as getYamlStats, data_iniToJson as iniToJson, data_jsonArrayToNdjson as jsonArrayToNdjson, data_jsonToIni as jsonToIni, data_jsonToToml as jsonToToml, data_jsonToXml as jsonToXml, data_minifyNdjson as minifyNdjson, data_minifyToml as minifyToml, data_minifyXml as minifyXml, data_ndjsonToJsonArray as ndjsonToJsonArray, data_parseCsv as parseCsv, data_parseEnv as parseEnv, data_parseFrontMatter as parseFrontMatter, data_parseIni as parseIni, data_parseSubtitleTimestamp as parseSubtitleTimestamp, data_parseSubtitles as parseSubtitles, data_parseXmlToObject as parseXmlToObject, data_resolveYamlAnchors as resolveYamlAnchors, data_serializeSubtitles as serializeSubtitles, data_shiftSubtitles as shiftSubtitles, data_stringifyIni as stringifyIni, data_toCsvString as toCsvString, data_tomlToJson as tomlToJson, data_validateEnvKey as validateEnvKey, data_validateIni as validateIni, data_validateNdjson as validateNdjson, data_validateToml as validateToml, data_validateXml as validateXml, data_validateYaml as validateYaml, data_xmlToJson as xmlToJson };
|
|
453
481
|
}
|
|
454
482
|
|
|
455
|
-
export {
|
|
483
|
+
export { jsonToIni as $, envToExport as A, envToJson as B, type ConvertedSubtitles as C, findCsvDuplicateRows as D, type EnvDiffError as E, type FrontMatterError as F, formatNdjson as G, formatSubtitleTimestamp as H, type IniSection as I, formatToml as J, formatXml as K, generateMarkdownToc as L, type MarkdownTocEntry as M, type NdjsonLineResult as N, getSection as O, type ParseOptions as P, getSectionNames as Q, getTomlStats as R, type SubtitleCue as S, type TomlFormatResult as T, getXmlStats as U, type ValidationResult as V, getYamlStats as W, type XmlFormatResult as X, type YamlAnchorInfo as Y, iniToJson as Z, jsonArrayToNdjson as _, type CsvDuplicateGroup as a, jsonToToml as a0, jsonToXml as a1, minifyNdjson as a2, minifyToml as a3, minifyXml as a4, ndjsonToJsonArray as a5, parseCsv as a6, parseEnv as a7, parseFrontMatter as a8, parseIni as a9, parseSubtitleTimestamp as aa, parseSubtitles as ab, parseXmlToObject as ac, resolveYamlAnchors as ad, serializeSubtitles as ae, shiftSubtitles as af, stringifyIni as ag, toCsvString as ah, tomlToJson as ai, validateEnvKey as aj, validateIni as ak, validateNdjson as al, validateToml as am, validateXml as an, validateYaml as ao, xmlToJson as ap, type CsvDuplicateOptions as b, type CsvDuplicateResult as c, data as d, type CsvParseResult as e, type CsvToSqlOptions as f, type CsvToSqlResult as g, type EnvDiffResult as h, type EnvEntry as i, type EnvParseResult as j, type FrontMatterResult as k, type MarkdownTocOptions as l, type MarkdownTocResult as m, type NdjsonValidateResult as n, type ParsedIni as o, type ParsedSubtitles as p, type SubtitleFormat as q, type XmlToJsonOptions as r, type YamlAnchorResolveError as s, type YamlAnchorResolveResult as t, convertSubtitles as u, csvToJson as v, csvToSqlInsert as w, detectDelimiter as x, detectSubtitleFormat as y, diffEnvExample as z };
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
* - markdown-toc-generator: generateMarkdownToc
|
|
18
18
|
* - csv-to-sql-insert-generator: csvToSqlInsert
|
|
19
19
|
* - csv-duplicate-row-finder: findCsvDuplicateRows
|
|
20
|
+
* - yaml-anchor-resolver: resolveYamlAnchors
|
|
20
21
|
*/
|
|
21
22
|
interface ValidationResult {
|
|
22
23
|
valid: boolean;
|
|
@@ -372,6 +373,29 @@ interface CsvDuplicateResult {
|
|
|
372
373
|
declare function findCsvDuplicateRows(input: string, options?: CsvDuplicateOptions): CsvDuplicateResult | {
|
|
373
374
|
error: string;
|
|
374
375
|
};
|
|
376
|
+
interface YamlAnchorInfo {
|
|
377
|
+
name: string;
|
|
378
|
+
line: number;
|
|
379
|
+
referenced: boolean;
|
|
380
|
+
}
|
|
381
|
+
interface YamlAnchorResolveResult {
|
|
382
|
+
resolvedYaml: string;
|
|
383
|
+
anchors: YamlAnchorInfo[];
|
|
384
|
+
unusedAnchors: string[];
|
|
385
|
+
aliasCount: number;
|
|
386
|
+
}
|
|
387
|
+
interface YamlAnchorResolveError {
|
|
388
|
+
error: string;
|
|
389
|
+
}
|
|
390
|
+
/**
|
|
391
|
+
* Expand every YAML anchor, alias, and merge key in the input inline, and
|
|
392
|
+
* report which anchors were referenced vs. left unused. Unlike
|
|
393
|
+
* `validateYaml`, which only checks syntax, this fully resolves the
|
|
394
|
+
* document via js-yaml (which already implements anchor/alias/merge-key
|
|
395
|
+
* resolution per the YAML spec) and re-serializes it with no `&`/`*`
|
|
396
|
+
* syntax remaining.
|
|
397
|
+
*/
|
|
398
|
+
declare function resolveYamlAnchors(yamlText: string): YamlAnchorResolveResult | YamlAnchorResolveError;
|
|
375
399
|
|
|
376
400
|
type data_ConvertedSubtitles = ConvertedSubtitles;
|
|
377
401
|
type data_CsvDuplicateGroup = CsvDuplicateGroup;
|
|
@@ -401,6 +425,9 @@ type data_TomlFormatResult = TomlFormatResult;
|
|
|
401
425
|
type data_ValidationResult = ValidationResult;
|
|
402
426
|
type data_XmlFormatResult = XmlFormatResult;
|
|
403
427
|
type data_XmlToJsonOptions = XmlToJsonOptions;
|
|
428
|
+
type data_YamlAnchorInfo = YamlAnchorInfo;
|
|
429
|
+
type data_YamlAnchorResolveError = YamlAnchorResolveError;
|
|
430
|
+
type data_YamlAnchorResolveResult = YamlAnchorResolveResult;
|
|
404
431
|
declare const data_convertSubtitles: typeof convertSubtitles;
|
|
405
432
|
declare const data_csvToJson: typeof csvToJson;
|
|
406
433
|
declare const data_csvToSqlInsert: typeof csvToSqlInsert;
|
|
@@ -436,6 +463,7 @@ declare const data_parseIni: typeof parseIni;
|
|
|
436
463
|
declare const data_parseSubtitleTimestamp: typeof parseSubtitleTimestamp;
|
|
437
464
|
declare const data_parseSubtitles: typeof parseSubtitles;
|
|
438
465
|
declare const data_parseXmlToObject: typeof parseXmlToObject;
|
|
466
|
+
declare const data_resolveYamlAnchors: typeof resolveYamlAnchors;
|
|
439
467
|
declare const data_serializeSubtitles: typeof serializeSubtitles;
|
|
440
468
|
declare const data_shiftSubtitles: typeof shiftSubtitles;
|
|
441
469
|
declare const data_stringifyIni: typeof stringifyIni;
|
|
@@ -449,7 +477,7 @@ declare const data_validateXml: typeof validateXml;
|
|
|
449
477
|
declare const data_validateYaml: typeof validateYaml;
|
|
450
478
|
declare const data_xmlToJson: typeof xmlToJson;
|
|
451
479
|
declare namespace data {
|
|
452
|
-
export { type data_ConvertedSubtitles as ConvertedSubtitles, type data_CsvDuplicateGroup as CsvDuplicateGroup, type data_CsvDuplicateOptions as CsvDuplicateOptions, type data_CsvDuplicateResult as CsvDuplicateResult, type data_CsvParseResult as CsvParseResult, type data_CsvToSqlOptions as CsvToSqlOptions, type data_CsvToSqlResult as CsvToSqlResult, type data_EnvDiffError as EnvDiffError, type data_EnvDiffResult as EnvDiffResult, type data_EnvEntry as EnvEntry, type data_EnvParseResult as EnvParseResult, type data_FrontMatterError as FrontMatterError, type data_FrontMatterResult as FrontMatterResult, type data_IniSection as IniSection, type data_MarkdownTocEntry as MarkdownTocEntry, type data_MarkdownTocOptions as MarkdownTocOptions, type data_MarkdownTocResult as MarkdownTocResult, type data_NdjsonLineResult as NdjsonLineResult, type data_NdjsonValidateResult as NdjsonValidateResult, type data_ParseOptions as ParseOptions, type data_ParsedIni as ParsedIni, type data_ParsedSubtitles as ParsedSubtitles, type data_SubtitleCue as SubtitleCue, type data_SubtitleFormat as SubtitleFormat, type data_TomlFormatResult as TomlFormatResult, type data_ValidationResult as ValidationResult, type data_XmlFormatResult as XmlFormatResult, type data_XmlToJsonOptions as XmlToJsonOptions, data_convertSubtitles as convertSubtitles, data_csvToJson as csvToJson, data_csvToSqlInsert as csvToSqlInsert, data_detectDelimiter as detectDelimiter, data_detectSubtitleFormat as detectSubtitleFormat, data_diffEnvExample as diffEnvExample, data_envToExport as envToExport, data_envToJson as envToJson, data_findCsvDuplicateRows as findCsvDuplicateRows, data_formatNdjson as formatNdjson, data_formatSubtitleTimestamp as formatSubtitleTimestamp, data_formatToml as formatToml, data_formatXml as formatXml, data_generateMarkdownToc as generateMarkdownToc, data_getSection as getSection, data_getSectionNames as getSectionNames, data_getTomlStats as getTomlStats, data_getXmlStats as getXmlStats, data_getYamlStats as getYamlStats, data_iniToJson as iniToJson, data_jsonArrayToNdjson as jsonArrayToNdjson, data_jsonToIni as jsonToIni, data_jsonToToml as jsonToToml, data_jsonToXml as jsonToXml, data_minifyNdjson as minifyNdjson, data_minifyToml as minifyToml, data_minifyXml as minifyXml, data_ndjsonToJsonArray as ndjsonToJsonArray, data_parseCsv as parseCsv, data_parseEnv as parseEnv, data_parseFrontMatter as parseFrontMatter, data_parseIni as parseIni, data_parseSubtitleTimestamp as parseSubtitleTimestamp, data_parseSubtitles as parseSubtitles, data_parseXmlToObject as parseXmlToObject, data_serializeSubtitles as serializeSubtitles, data_shiftSubtitles as shiftSubtitles, data_stringifyIni as stringifyIni, data_toCsvString as toCsvString, data_tomlToJson as tomlToJson, data_validateEnvKey as validateEnvKey, data_validateIni as validateIni, data_validateNdjson as validateNdjson, data_validateToml as validateToml, data_validateXml as validateXml, data_validateYaml as validateYaml, data_xmlToJson as xmlToJson };
|
|
480
|
+
export { type data_ConvertedSubtitles as ConvertedSubtitles, type data_CsvDuplicateGroup as CsvDuplicateGroup, type data_CsvDuplicateOptions as CsvDuplicateOptions, type data_CsvDuplicateResult as CsvDuplicateResult, type data_CsvParseResult as CsvParseResult, type data_CsvToSqlOptions as CsvToSqlOptions, type data_CsvToSqlResult as CsvToSqlResult, type data_EnvDiffError as EnvDiffError, type data_EnvDiffResult as EnvDiffResult, type data_EnvEntry as EnvEntry, type data_EnvParseResult as EnvParseResult, type data_FrontMatterError as FrontMatterError, type data_FrontMatterResult as FrontMatterResult, type data_IniSection as IniSection, type data_MarkdownTocEntry as MarkdownTocEntry, type data_MarkdownTocOptions as MarkdownTocOptions, type data_MarkdownTocResult as MarkdownTocResult, type data_NdjsonLineResult as NdjsonLineResult, type data_NdjsonValidateResult as NdjsonValidateResult, type data_ParseOptions as ParseOptions, type data_ParsedIni as ParsedIni, type data_ParsedSubtitles as ParsedSubtitles, type data_SubtitleCue as SubtitleCue, type data_SubtitleFormat as SubtitleFormat, type data_TomlFormatResult as TomlFormatResult, type data_ValidationResult as ValidationResult, type data_XmlFormatResult as XmlFormatResult, type data_XmlToJsonOptions as XmlToJsonOptions, type data_YamlAnchorInfo as YamlAnchorInfo, type data_YamlAnchorResolveError as YamlAnchorResolveError, type data_YamlAnchorResolveResult as YamlAnchorResolveResult, data_convertSubtitles as convertSubtitles, data_csvToJson as csvToJson, data_csvToSqlInsert as csvToSqlInsert, data_detectDelimiter as detectDelimiter, data_detectSubtitleFormat as detectSubtitleFormat, data_diffEnvExample as diffEnvExample, data_envToExport as envToExport, data_envToJson as envToJson, data_findCsvDuplicateRows as findCsvDuplicateRows, data_formatNdjson as formatNdjson, data_formatSubtitleTimestamp as formatSubtitleTimestamp, data_formatToml as formatToml, data_formatXml as formatXml, data_generateMarkdownToc as generateMarkdownToc, data_getSection as getSection, data_getSectionNames as getSectionNames, data_getTomlStats as getTomlStats, data_getXmlStats as getXmlStats, data_getYamlStats as getYamlStats, data_iniToJson as iniToJson, data_jsonArrayToNdjson as jsonArrayToNdjson, data_jsonToIni as jsonToIni, data_jsonToToml as jsonToToml, data_jsonToXml as jsonToXml, data_minifyNdjson as minifyNdjson, data_minifyToml as minifyToml, data_minifyXml as minifyXml, data_ndjsonToJsonArray as ndjsonToJsonArray, data_parseCsv as parseCsv, data_parseEnv as parseEnv, data_parseFrontMatter as parseFrontMatter, data_parseIni as parseIni, data_parseSubtitleTimestamp as parseSubtitleTimestamp, data_parseSubtitles as parseSubtitles, data_parseXmlToObject as parseXmlToObject, data_resolveYamlAnchors as resolveYamlAnchors, data_serializeSubtitles as serializeSubtitles, data_shiftSubtitles as shiftSubtitles, data_stringifyIni as stringifyIni, data_toCsvString as toCsvString, data_tomlToJson as tomlToJson, data_validateEnvKey as validateEnvKey, data_validateIni as validateIni, data_validateNdjson as validateNdjson, data_validateToml as validateToml, data_validateXml as validateXml, data_validateYaml as validateYaml, data_xmlToJson as xmlToJson };
|
|
453
481
|
}
|
|
454
482
|
|
|
455
|
-
export {
|
|
483
|
+
export { jsonToIni as $, envToExport as A, envToJson as B, type ConvertedSubtitles as C, findCsvDuplicateRows as D, type EnvDiffError as E, type FrontMatterError as F, formatNdjson as G, formatSubtitleTimestamp as H, type IniSection as I, formatToml as J, formatXml as K, generateMarkdownToc as L, type MarkdownTocEntry as M, type NdjsonLineResult as N, getSection as O, type ParseOptions as P, getSectionNames as Q, getTomlStats as R, type SubtitleCue as S, type TomlFormatResult as T, getXmlStats as U, type ValidationResult as V, getYamlStats as W, type XmlFormatResult as X, type YamlAnchorInfo as Y, iniToJson as Z, jsonArrayToNdjson as _, type CsvDuplicateGroup as a, jsonToToml as a0, jsonToXml as a1, minifyNdjson as a2, minifyToml as a3, minifyXml as a4, ndjsonToJsonArray as a5, parseCsv as a6, parseEnv as a7, parseFrontMatter as a8, parseIni as a9, parseSubtitleTimestamp as aa, parseSubtitles as ab, parseXmlToObject as ac, resolveYamlAnchors as ad, serializeSubtitles as ae, shiftSubtitles as af, stringifyIni as ag, toCsvString as ah, tomlToJson as ai, validateEnvKey as aj, validateIni as ak, validateNdjson as al, validateToml as am, validateXml as an, validateYaml as ao, xmlToJson as ap, type CsvDuplicateOptions as b, type CsvDuplicateResult as c, data as d, type CsvParseResult as e, type CsvToSqlOptions as f, type CsvToSqlResult as g, type EnvDiffResult as h, type EnvEntry as i, type EnvParseResult as j, type FrontMatterResult as k, type MarkdownTocOptions as l, type MarkdownTocResult as m, type NdjsonValidateResult as n, type ParsedIni as o, type ParsedSubtitles as p, type SubtitleFormat as q, type XmlToJsonOptions as r, type YamlAnchorResolveError as s, type YamlAnchorResolveResult as t, convertSubtitles as u, csvToJson as v, csvToSqlInsert as w, detectDelimiter as x, detectSubtitleFormat as y, diffEnvExample as z };
|