@utilix-tech/sdk 0.30.0 → 0.32.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 +8 -0
- package/README.md +21 -9
- package/dist/{ai_agent-B-c59NXD.d.cts → ai_agent-C1zudGgT.d.cts} +24 -2
- package/dist/{ai_agent-B-c59NXD.d.ts → ai_agent-C1zudGgT.d.ts} +24 -2
- package/dist/{chunk-66QHV5KW.js → chunk-6FIB72KX.js} +66 -1
- package/dist/{chunk-I63BCOAG.js → chunk-GDIZWDBY.js} +57 -1
- package/dist/{chunk-AFEZ6N4A.js → chunk-H2USEUHD.js} +67 -1
- package/dist/{chunk-265NPGKH.js → chunk-W3J7GZVQ.js} +25 -1
- package/dist/{data-XRb0D7Zn.d.cts → data-C4lCByXw.d.cts} +24 -2
- package/dist/{data-XRb0D7Zn.d.ts → data-C4lCByXw.d.ts} +24 -2
- package/dist/index.cjs +211 -0
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -4
- package/dist/{text-D1fySkCB.d.cts → text-CA-zuD0C.d.cts} +34 -2
- package/dist/{text-D1fySkCB.d.ts → text-CA-zuD0C.d.ts} +34 -2
- package/dist/tools/ai_agent.cjs +24 -0
- package/dist/tools/ai_agent.d.cts +1 -1
- package/dist/tools/ai_agent.d.ts +1 -1
- package/dist/tools/ai_agent.js +1 -1
- package/dist/tools/data.cjs +65 -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/text.cjs +66 -0
- package/dist/tools/text.d.cts +1 -1
- package/dist/tools/text.d.ts +1 -1
- package/dist/tools/text.js +1 -1
- package/dist/tools/units.cjs +56 -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-COt5uI20.d.ts → units-DQYLZd1n.d.cts} +33 -2
- package/dist/{units-COt5uI20.d.cts → units-DQYLZd1n.d.ts} +33 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
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.32.0
|
|
6
|
+
- Add `analyzeSentenceLengths` (sentence-length-distribution): histogram of sentence lengths in words, plus mean, median, standard deviation, and a coefficient-of-variation consistency label, distinct from readability grade scores.
|
|
7
|
+
- Add `formatFewShotExamples` (few-shot-formatter): format input/output example pairs into a numbered, XML-tagged, or delimiter-separated few-shot prompt template.
|
|
8
|
+
|
|
9
|
+
## 0.31.0
|
|
10
|
+
- Add `calculateEmi` (emi-calculator): equated monthly installment, total interest, and a year-by-year principal/interest breakdown from principal, annual rate, and tenure in years or months.
|
|
11
|
+
- Add `parseFrontMatter` (markdown-front-matter-parser): split a Markdown document into its YAML front matter fields and body content, parsing scalars, inline arrays, and block lists.
|
|
12
|
+
|
|
5
13
|
## 0.30.0
|
|
6
14
|
- Add `jsonSchemaToTypescript` (json-schema-to-typescript): convert a JSON Schema document into TypeScript interfaces/types, reading `required`/`enum`/`oneOf`/`anyOf`/`allOf`/`$ref` directly instead of inferring from an example payload.
|
|
7
15
|
- Add `estimatePasswordEntropy` (password-entropy-estimator): bits of entropy from a password's character pool, a strength label, and crack-time estimates across four guess-rate scenarios.
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @utilix-tech/sdk
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**585 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)
|
|
@@ -140,7 +140,7 @@ generateHtpasswdFile([{ username: "alice", password: "secret" }]);
|
|
|
140
140
|
```ts
|
|
141
141
|
import { convertCase, slugify, countWords, generateWords, generateParagraphs,
|
|
142
142
|
escapeString, htmlToMarkdown, applyOps, detectPassiveVoice, scoreReadability,
|
|
143
|
-
detectFillerWords, calculateStringDistance } from "@utilix-tech/sdk/text";
|
|
143
|
+
detectFillerWords, calculateStringDistance, analyzeSentenceLengths } from "@utilix-tech/sdk/text";
|
|
144
144
|
|
|
145
145
|
convertCase("hello world", "camelCase"); // "helloWorld"
|
|
146
146
|
convertCase("hello world", "PascalCase"); // "HelloWorld"
|
|
@@ -173,17 +173,21 @@ detectFillerWords("At the end of the day, I just really think we should circle b
|
|
|
173
173
|
// Levenshtein edit distance + similarity ratio; pass mode: "damerau" to count a transposition as 1 edit
|
|
174
174
|
calculateStringDistance("kitten", "sitting");
|
|
175
175
|
// { distance: 3, similarity: 0.5714, maxLength: 7, mode: "levenshtein" }
|
|
176
|
+
|
|
177
|
+
// Histogram + mean/median/stddev of sentence lengths, distinct from readability grade scores
|
|
178
|
+
analyzeSentenceLengths("The cat sat on the mat. It was a sunny day, and the dog ran across the yard to play.");
|
|
179
|
+
// { sentenceCount: 2, meanLength: 10, stdDev: 4, consistency: "Moderate variation in sentence length", buckets: [...] }
|
|
176
180
|
```
|
|
177
181
|
|
|
178
182
|
---
|
|
179
183
|
|
|
180
|
-
### `/data`: CSV / YAML / TOML / XML / INI / NDJSON / .env diff / subtitles
|
|
184
|
+
### `/data`: CSV / YAML / TOML / XML / INI / NDJSON / .env diff / subtitles / Markdown front matter
|
|
181
185
|
|
|
182
186
|
```ts
|
|
183
187
|
import { parseCsv, csvToJson, validateYaml, tomlToJson, jsonToToml,
|
|
184
188
|
formatXml, xmlToJson, jsonToXml, parseIni,
|
|
185
189
|
validateNdjson, formatNdjson, ndjsonToJsonArray, diffEnvExample,
|
|
186
|
-
parseSubtitles, convertSubtitles, shiftSubtitles } from "@utilix-tech/sdk/data";
|
|
190
|
+
parseSubtitles, convertSubtitles, shiftSubtitles, parseFrontMatter } from "@utilix-tech/sdk/data";
|
|
187
191
|
|
|
188
192
|
// CSV
|
|
189
193
|
const rows = parseCsv("name,age\nalice,30\nbob,25");
|
|
@@ -217,6 +221,10 @@ convertSubtitles("1\n00:00:01,000 --> 00:00:04,000\nHello there.\n", "vtt");
|
|
|
217
221
|
// { format: "vtt", sourceFormat: "srt", output: "WEBVTT\n\n00:00:01.000 --> ...", cueCount: 1, ... }
|
|
218
222
|
shiftSubtitles("1\n00:00:01,000 --> 00:00:04,000\nHi\n", -2.5);
|
|
219
223
|
// shifts every cue 2.5s earlier, clamping anything below zero to 00:00:00
|
|
224
|
+
|
|
225
|
+
// Markdown front matter: split a document into its YAML front matter and body
|
|
226
|
+
parseFrontMatter("---\ntitle: Hello World\ntags: [foo, bar]\n---\n# Body");
|
|
227
|
+
// { frontMatter: { title: "Hello World", tags: ["foo", "bar"] }, body: "# Body", hasFrontMatter: true, ... }
|
|
220
228
|
```
|
|
221
229
|
|
|
222
230
|
---
|
|
@@ -278,7 +286,7 @@ formatIso8601Duration(90061); // { iso: "P1DT1H1M1S", ... }
|
|
|
278
286
|
### `/units`: Conversions
|
|
279
287
|
|
|
280
288
|
```ts
|
|
281
|
-
import { convertBytes, pxToAll, convert, formatValue, validateCardNumber, validateIban, calculateLoan, validateBarcode, calculateTax, calculateCompoundInterest, validateIsbn, calculateTipSplit, calculateSimpleInterest, calculateTimeValue, calculatePercentageChange, convertAprApy, calculateMarginMarkup, calculateDiscount, applySuccessiveDiscounts, calculateBreakEven, calculateVideoBitrate, calculateRuleOf72 } from "@utilix-tech/sdk/units";
|
|
289
|
+
import { convertBytes, pxToAll, convert, formatValue, validateCardNumber, validateIban, calculateLoan, validateBarcode, calculateTax, calculateCompoundInterest, validateIsbn, calculateTipSplit, calculateSimpleInterest, calculateTimeValue, calculatePercentageChange, convertAprApy, calculateMarginMarkup, calculateDiscount, applySuccessiveDiscounts, calculateBreakEven, calculateVideoBitrate, calculateRuleOf72, calculateEmi } from "@utilix-tech/sdk/units";
|
|
282
290
|
|
|
283
291
|
// File sizes
|
|
284
292
|
convertBytes(1073741824, "GB"); // 1
|
|
@@ -368,6 +376,10 @@ calculateVideoBitrate({ mode: "size-from-bitrate", durationSeconds: 600, videoBi
|
|
|
368
376
|
// Rule of 72: years to double from a rate, or the rate needed to double in N years
|
|
369
377
|
calculateRuleOf72(8, "rate-to-years");
|
|
370
378
|
// { ruleOf72Estimate: 9, exactValue: 9.0065, errorPercent: -0.0718, ... }
|
|
379
|
+
|
|
380
|
+
// EMI: equated monthly installment with a year-by-year principal/interest breakdown
|
|
381
|
+
calculateEmi(500000, 8.5, 5, "years");
|
|
382
|
+
// { emi: 10258.27, totalInterest: 115495.89, tenureMonths: 60, yearlyBreakdown: [...] }
|
|
371
383
|
```
|
|
372
384
|
|
|
373
385
|
---
|
|
@@ -646,18 +658,18 @@ readVideoInfo(new Uint8Array(videoBytes));
|
|
|
646
658
|
| `@utilix-tech/sdk/json` | Format, minify, diff, validate, JSONPath, CSV↔JSON, YAML↔JSON, TS types from data or from a JSON Schema |
|
|
647
659
|
| `@utilix-tech/sdk/encoding` | Base64, URL, HTML entities, Base32/Base58/Base62 encode/decode |
|
|
648
660
|
| `@utilix-tech/sdk/hashing` | MD5, SHA-1/256/512, bcrypt, HMAC, .htpasswd |
|
|
649
|
-
| `@utilix-tech/sdk/text` | Case convert, slugify, word count, lorem ipsum, line ops, HTML→Markdown, Levenshtein/Damerau string distance |
|
|
650
|
-
| `@utilix-tech/sdk/data` | CSV, YAML, TOML, XML, INI, NDJSON parse and convert, SRT/WebVTT subtitles |
|
|
661
|
+
| `@utilix-tech/sdk/text` | Case convert, slugify, word count, lorem ipsum, line ops, HTML→Markdown, Levenshtein/Damerau string distance, readability scoring, sentence length distribution |
|
|
662
|
+
| `@utilix-tech/sdk/data` | CSV, YAML, TOML, XML, INI, NDJSON parse and convert, SRT/WebVTT subtitles, Markdown front matter parser |
|
|
651
663
|
| `@utilix-tech/sdk/generators` | UUID v4/v7, ULID, passwords, strength check, entropy estimator, fake data |
|
|
652
664
|
| `@utilix-tech/sdk/time` | Date diff, timezone convert, cron parse, relative time |
|
|
653
|
-
| `@utilix-tech/sdk/units` | Bytes, CSS px/rem, number bases, currency format, credit card/IBAN/barcode/ISBN validation, loan calculator, compound/simple interest calculators, VAT/sales tax calculator, tip/bill split calculator, break-even point calculator, Rule of 72 calculator |
|
|
665
|
+
| `@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 |
|
|
654
666
|
| `@utilix-tech/sdk/network` | HTTP status codes, IP validation, country flags, geolocation URLs, HAR file parsing, User-Agent parsing, IPv6 address compress/expand |
|
|
655
667
|
| `@utilix-tech/sdk/api` | cURL build/parse, JWT decode/sign, JWKS parse, CORS headers, CSP header |
|
|
656
668
|
| `@utilix-tech/sdk/code` | SQL format/minify, HTML format/minify, regex tester, GraphQL format, MIME type lookup, GitHub URL parsing |
|
|
657
669
|
| `@utilix-tech/sdk/color` | Hex/RGB/HSL/HSV/CMYK convert, palette generation, contrast check |
|
|
658
670
|
| `@utilix-tech/sdk/css` | CSS gradient, box-shadow, border-radius, keyframe animation generators |
|
|
659
671
|
| `@utilix-tech/sdk/misc` | SVG optimize/sanitize, file size format, Unicode inspector |
|
|
660
|
-
| `@utilix-tech/sdk/ai_agent` | Token estimate/trim, chunk text, extract URLs/JSON/keywords, sanitize HTML, flatten/merge JSON, dedupe lines, validate schema, PII/secret/injection detect, vector similarity |
|
|
672
|
+
| `@utilix-tech/sdk/ai_agent` | Token estimate/trim, chunk text, extract URLs/JSON/keywords, sanitize HTML, flatten/merge JSON, dedupe lines, validate schema, PII/secret/injection detect, vector similarity, few-shot prompt formatter |
|
|
661
673
|
| `@utilix-tech/sdk/media` | Image format & dimension reading from raw bytes (PNG, JPEG, GIF, WebP, BMP); PDF metadata reading; PDF page dimension/orientation listing; WAV audio info; ID3 tags; ICO favicon inspection; FLAC metadata reading; MP4/WebM video info |
|
|
662
674
|
|
|
663
675
|
---
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* - secret-detector : detectSecrets
|
|
9
9
|
* - prompt-injection : detectPromptInjection
|
|
10
10
|
* - json-repair : repairJson
|
|
11
|
+
* - few-shot-formatter : formatFewShotExamples
|
|
11
12
|
*/
|
|
12
13
|
interface ModelPricing {
|
|
13
14
|
model: string;
|
|
@@ -333,6 +334,23 @@ interface VectorSimilarityResult {
|
|
|
333
334
|
declare function vectorSimilarity(a: number[], b: number[]): VectorSimilarityResult | {
|
|
334
335
|
error: string;
|
|
335
336
|
};
|
|
337
|
+
type FewShotFormat = 'numbered' | 'xml' | 'delimiter';
|
|
338
|
+
interface FewShotExample {
|
|
339
|
+
input: string;
|
|
340
|
+
output: string;
|
|
341
|
+
}
|
|
342
|
+
interface FewShotFormatResult {
|
|
343
|
+
formatted: string;
|
|
344
|
+
exampleCount: number;
|
|
345
|
+
format: FewShotFormat;
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Format a list of input/output example pairs into a standard few-shot
|
|
349
|
+
* prompt template, ready to paste into a system or user prompt. Examples
|
|
350
|
+
* with an empty input or output are dropped. `delimiter` only applies to
|
|
351
|
+
* the 'delimiter' format and defaults to '---'.
|
|
352
|
+
*/
|
|
353
|
+
declare function formatFewShotExamples(examples: FewShotExample[], format?: FewShotFormat, delimiter?: string): FewShotFormatResult;
|
|
336
354
|
|
|
337
355
|
type ai_agent_ChunkStrategy = ChunkStrategy;
|
|
338
356
|
type ai_agent_CompressHtmlResult = CompressHtmlResult;
|
|
@@ -349,6 +367,9 @@ type ai_agent_EntityType2 = EntityType2;
|
|
|
349
367
|
type ai_agent_ExtractJsonResult = ExtractJsonResult;
|
|
350
368
|
type ai_agent_ExtractKeywordsResult = ExtractKeywordsResult;
|
|
351
369
|
type ai_agent_ExtractUrlsResult = ExtractUrlsResult;
|
|
370
|
+
type ai_agent_FewShotExample = FewShotExample;
|
|
371
|
+
type ai_agent_FewShotFormat = FewShotFormat;
|
|
372
|
+
type ai_agent_FewShotFormatResult = FewShotFormatResult;
|
|
352
373
|
type ai_agent_InjectionDetectResult = InjectionDetectResult;
|
|
353
374
|
type ai_agent_InjectionFinding = InjectionFinding;
|
|
354
375
|
type ai_agent_JsonBlock = JsonBlock;
|
|
@@ -396,6 +417,7 @@ declare const ai_agent_extractKeywords: typeof extractKeywords;
|
|
|
396
417
|
declare const ai_agent_extractTables: typeof extractTables;
|
|
397
418
|
declare const ai_agent_extractUrls: typeof extractUrls;
|
|
398
419
|
declare const ai_agent_flattenJson: typeof flattenJson;
|
|
420
|
+
declare const ai_agent_formatFewShotExamples: typeof formatFewShotExamples;
|
|
399
421
|
declare const ai_agent_mergeJson: typeof mergeJson;
|
|
400
422
|
declare const ai_agent_redactPii: typeof redactPii;
|
|
401
423
|
declare const ai_agent_repairJson: typeof repairJson;
|
|
@@ -408,7 +430,7 @@ declare const ai_agent_unflattenJson: typeof unflattenJson;
|
|
|
408
430
|
declare const ai_agent_validateJsonSchema: typeof validateJsonSchema;
|
|
409
431
|
declare const ai_agent_vectorSimilarity: typeof vectorSimilarity;
|
|
410
432
|
declare namespace ai_agent {
|
|
411
|
-
export { type ai_agent_ChunkStrategy as ChunkStrategy, type ai_agent_CompressHtmlResult as CompressHtmlResult, type ai_agent_CompressJsonResult as CompressJsonResult, type ai_agent_CompressMarkdownResult as CompressMarkdownResult, type ai_agent_CostEstimate as CostEstimate, type ai_agent_DedupeResult as DedupeResult, type ai_agent_DedupeStrategy as DedupeStrategy, type ai_agent_DiffEntry2 as DiffEntry2, type ai_agent_DiffOp2 as DiffOp2, type ai_agent_DiffResult2 as DiffResult2, type ai_agent_Entity2 as Entity2, type ai_agent_EntityType2 as EntityType2, type ai_agent_ExtractJsonResult as ExtractJsonResult, type ai_agent_ExtractKeywordsResult as ExtractKeywordsResult, type ai_agent_ExtractUrlsResult as ExtractUrlsResult, type ai_agent_InjectionDetectResult as InjectionDetectResult, type ai_agent_InjectionFinding as InjectionFinding, type ai_agent_JsonBlock as JsonBlock, type ai_agent_JsonRepairResult as JsonRepairResult, type ai_agent_Keyword as Keyword, ai_agent_MODEL_PRICING as MODEL_PRICING, type ai_agent_MergeResult as MergeResult, type ai_agent_MergeStrategy as MergeStrategy, type ai_agent_ModelPricing as ModelPricing, type ai_agent_PiiDetectResult as PiiDetectResult, type ai_agent_PiiFinding as PiiFinding, type ai_agent_PiiType as PiiType, type ai_agent_RankedChunk as RankedChunk, type ai_agent_RelevanceResult as RelevanceResult, type ai_agent_SanitizeResult as SanitizeResult, type ai_agent_SecretDetectResult as SecretDetectResult, type ai_agent_SecretFinding as SecretFinding, type ai_agent_SecretType as SecretType, type ai_agent_SummaryResult as SummaryResult, type ai_agent_TableResult2 as TableResult2, type ai_agent_TextChunk as TextChunk, type ai_agent_TokenEstimate as TokenEstimate, type ai_agent_TokenEstimateResult as TokenEstimateResult, type ai_agent_TrimResult as TrimResult, type ai_agent_TrimStrategy as TrimStrategy, type ai_agent_UrlMatch as UrlMatch, type ai_agent_ValidationError as ValidationError, type ai_agent_ValidationResult as ValidationResult, type ai_agent_VectorSimilarityResult as VectorSimilarityResult, ai_agent_chunkText as chunkText, ai_agent_compressHtml as compressHtml, ai_agent_compressJson as compressJson, ai_agent_compressMarkdown as compressMarkdown, ai_agent_deduplicateLines as deduplicateLines, ai_agent_detectPii as detectPii, ai_agent_detectPromptInjection as detectPromptInjection, ai_agent_detectSecrets as detectSecrets, ai_agent_diffJson as diffJson, ai_agent_estimateCost as estimateCost, ai_agent_estimateTokens as estimateTokens, ai_agent_expandQuery as expandQuery, ai_agent_extractEntities as extractEntities, ai_agent_extractJson as extractJson, ai_agent_extractKeywords as extractKeywords, ai_agent_extractTables as extractTables, ai_agent_extractUrls as extractUrls, ai_agent_flattenJson as flattenJson, ai_agent_mergeJson as mergeJson, ai_agent_redactPii as redactPii, ai_agent_repairJson as repairJson, ai_agent_rerankChunks as rerankChunks, ai_agent_sanitizeHtml as sanitizeHtml, ai_agent_scoreRelevance as scoreRelevance, ai_agent_summarizeForLlm as summarizeForLlm, ai_agent_trimToTokens as trimToTokens, ai_agent_unflattenJson as unflattenJson, ai_agent_validateJsonSchema as validateJsonSchema, ai_agent_vectorSimilarity as vectorSimilarity };
|
|
433
|
+
export { type ai_agent_ChunkStrategy as ChunkStrategy, type ai_agent_CompressHtmlResult as CompressHtmlResult, type ai_agent_CompressJsonResult as CompressJsonResult, type ai_agent_CompressMarkdownResult as CompressMarkdownResult, type ai_agent_CostEstimate as CostEstimate, type ai_agent_DedupeResult as DedupeResult, type ai_agent_DedupeStrategy as DedupeStrategy, type ai_agent_DiffEntry2 as DiffEntry2, type ai_agent_DiffOp2 as DiffOp2, type ai_agent_DiffResult2 as DiffResult2, type ai_agent_Entity2 as Entity2, type ai_agent_EntityType2 as EntityType2, type ai_agent_ExtractJsonResult as ExtractJsonResult, type ai_agent_ExtractKeywordsResult as ExtractKeywordsResult, type ai_agent_ExtractUrlsResult as ExtractUrlsResult, type ai_agent_FewShotExample as FewShotExample, type ai_agent_FewShotFormat as FewShotFormat, type ai_agent_FewShotFormatResult as FewShotFormatResult, type ai_agent_InjectionDetectResult as InjectionDetectResult, type ai_agent_InjectionFinding as InjectionFinding, type ai_agent_JsonBlock as JsonBlock, type ai_agent_JsonRepairResult as JsonRepairResult, type ai_agent_Keyword as Keyword, ai_agent_MODEL_PRICING as MODEL_PRICING, type ai_agent_MergeResult as MergeResult, type ai_agent_MergeStrategy as MergeStrategy, type ai_agent_ModelPricing as ModelPricing, type ai_agent_PiiDetectResult as PiiDetectResult, type ai_agent_PiiFinding as PiiFinding, type ai_agent_PiiType as PiiType, type ai_agent_RankedChunk as RankedChunk, type ai_agent_RelevanceResult as RelevanceResult, type ai_agent_SanitizeResult as SanitizeResult, type ai_agent_SecretDetectResult as SecretDetectResult, type ai_agent_SecretFinding as SecretFinding, type ai_agent_SecretType as SecretType, type ai_agent_SummaryResult as SummaryResult, type ai_agent_TableResult2 as TableResult2, type ai_agent_TextChunk as TextChunk, type ai_agent_TokenEstimate as TokenEstimate, type ai_agent_TokenEstimateResult as TokenEstimateResult, type ai_agent_TrimResult as TrimResult, type ai_agent_TrimStrategy as TrimStrategy, type ai_agent_UrlMatch as UrlMatch, type ai_agent_ValidationError as ValidationError, type ai_agent_ValidationResult as ValidationResult, type ai_agent_VectorSimilarityResult as VectorSimilarityResult, ai_agent_chunkText as chunkText, ai_agent_compressHtml as compressHtml, ai_agent_compressJson as compressJson, ai_agent_compressMarkdown as compressMarkdown, ai_agent_deduplicateLines as deduplicateLines, ai_agent_detectPii as detectPii, ai_agent_detectPromptInjection as detectPromptInjection, ai_agent_detectSecrets as detectSecrets, ai_agent_diffJson as diffJson, ai_agent_estimateCost as estimateCost, ai_agent_estimateTokens as estimateTokens, ai_agent_expandQuery as expandQuery, ai_agent_extractEntities as extractEntities, ai_agent_extractJson as extractJson, ai_agent_extractKeywords as extractKeywords, ai_agent_extractTables as extractTables, ai_agent_extractUrls as extractUrls, ai_agent_flattenJson as flattenJson, ai_agent_formatFewShotExamples as formatFewShotExamples, ai_agent_mergeJson as mergeJson, ai_agent_redactPii as redactPii, ai_agent_repairJson as repairJson, ai_agent_rerankChunks as rerankChunks, ai_agent_sanitizeHtml as sanitizeHtml, ai_agent_scoreRelevance as scoreRelevance, ai_agent_summarizeForLlm as summarizeForLlm, ai_agent_trimToTokens as trimToTokens, ai_agent_unflattenJson as unflattenJson, ai_agent_validateJsonSchema as validateJsonSchema, ai_agent_vectorSimilarity as vectorSimilarity };
|
|
412
434
|
}
|
|
413
435
|
|
|
414
|
-
export {
|
|
436
|
+
export { detectPii as $, type SummaryResult as A, type TextChunk as B, type ChunkStrategy as C, type DedupeResult as D, type Entity2 as E, type FewShotExample as F, type TokenEstimate as G, type TokenEstimateResult as H, type InjectionDetectResult as I, type JsonBlock as J, type Keyword as K, type TrimResult as L, MODEL_PRICING as M, type TrimStrategy as N, type ValidationResult as O, type PiiDetectResult as P, type VectorSimilarityResult as Q, type RankedChunk as R, type SanitizeResult as S, type TableResult2 as T, type UrlMatch as U, type ValidationError as V, chunkText as W, compressHtml as X, compressJson as Y, compressMarkdown as Z, deduplicateLines as _, ai_agent as a, detectPromptInjection as a0, detectSecrets as a1, diffJson as a2, estimateCost as a3, estimateTokens as a4, expandQuery as a5, extractEntities as a6, extractJson as a7, extractKeywords as a8, extractTables as a9, extractUrls as aa, flattenJson as ab, formatFewShotExamples as ac, mergeJson as ad, redactPii as ae, repairJson as af, rerankChunks as ag, sanitizeHtml as ah, scoreRelevance as ai, summarizeForLlm as aj, trimToTokens as ak, unflattenJson as al, validateJsonSchema as am, vectorSimilarity as an, type CompressHtmlResult as b, type CompressJsonResult as c, type CompressMarkdownResult as d, type CostEstimate as e, type DedupeStrategy as f, type DiffEntry2 as g, type DiffOp2 as h, type DiffResult2 as i, type EntityType2 as j, type ExtractJsonResult as k, type ExtractKeywordsResult as l, type ExtractUrlsResult as m, type FewShotFormat as n, type FewShotFormatResult as o, type InjectionFinding as p, type JsonRepairResult as q, type MergeResult as r, type MergeStrategy as s, type ModelPricing as t, type PiiFinding as u, type PiiType as v, type RelevanceResult as w, type SecretDetectResult as x, type SecretFinding as y, type SecretType as z };
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
* - secret-detector : detectSecrets
|
|
9
9
|
* - prompt-injection : detectPromptInjection
|
|
10
10
|
* - json-repair : repairJson
|
|
11
|
+
* - few-shot-formatter : formatFewShotExamples
|
|
11
12
|
*/
|
|
12
13
|
interface ModelPricing {
|
|
13
14
|
model: string;
|
|
@@ -333,6 +334,23 @@ interface VectorSimilarityResult {
|
|
|
333
334
|
declare function vectorSimilarity(a: number[], b: number[]): VectorSimilarityResult | {
|
|
334
335
|
error: string;
|
|
335
336
|
};
|
|
337
|
+
type FewShotFormat = 'numbered' | 'xml' | 'delimiter';
|
|
338
|
+
interface FewShotExample {
|
|
339
|
+
input: string;
|
|
340
|
+
output: string;
|
|
341
|
+
}
|
|
342
|
+
interface FewShotFormatResult {
|
|
343
|
+
formatted: string;
|
|
344
|
+
exampleCount: number;
|
|
345
|
+
format: FewShotFormat;
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Format a list of input/output example pairs into a standard few-shot
|
|
349
|
+
* prompt template, ready to paste into a system or user prompt. Examples
|
|
350
|
+
* with an empty input or output are dropped. `delimiter` only applies to
|
|
351
|
+
* the 'delimiter' format and defaults to '---'.
|
|
352
|
+
*/
|
|
353
|
+
declare function formatFewShotExamples(examples: FewShotExample[], format?: FewShotFormat, delimiter?: string): FewShotFormatResult;
|
|
336
354
|
|
|
337
355
|
type ai_agent_ChunkStrategy = ChunkStrategy;
|
|
338
356
|
type ai_agent_CompressHtmlResult = CompressHtmlResult;
|
|
@@ -349,6 +367,9 @@ type ai_agent_EntityType2 = EntityType2;
|
|
|
349
367
|
type ai_agent_ExtractJsonResult = ExtractJsonResult;
|
|
350
368
|
type ai_agent_ExtractKeywordsResult = ExtractKeywordsResult;
|
|
351
369
|
type ai_agent_ExtractUrlsResult = ExtractUrlsResult;
|
|
370
|
+
type ai_agent_FewShotExample = FewShotExample;
|
|
371
|
+
type ai_agent_FewShotFormat = FewShotFormat;
|
|
372
|
+
type ai_agent_FewShotFormatResult = FewShotFormatResult;
|
|
352
373
|
type ai_agent_InjectionDetectResult = InjectionDetectResult;
|
|
353
374
|
type ai_agent_InjectionFinding = InjectionFinding;
|
|
354
375
|
type ai_agent_JsonBlock = JsonBlock;
|
|
@@ -396,6 +417,7 @@ declare const ai_agent_extractKeywords: typeof extractKeywords;
|
|
|
396
417
|
declare const ai_agent_extractTables: typeof extractTables;
|
|
397
418
|
declare const ai_agent_extractUrls: typeof extractUrls;
|
|
398
419
|
declare const ai_agent_flattenJson: typeof flattenJson;
|
|
420
|
+
declare const ai_agent_formatFewShotExamples: typeof formatFewShotExamples;
|
|
399
421
|
declare const ai_agent_mergeJson: typeof mergeJson;
|
|
400
422
|
declare const ai_agent_redactPii: typeof redactPii;
|
|
401
423
|
declare const ai_agent_repairJson: typeof repairJson;
|
|
@@ -408,7 +430,7 @@ declare const ai_agent_unflattenJson: typeof unflattenJson;
|
|
|
408
430
|
declare const ai_agent_validateJsonSchema: typeof validateJsonSchema;
|
|
409
431
|
declare const ai_agent_vectorSimilarity: typeof vectorSimilarity;
|
|
410
432
|
declare namespace ai_agent {
|
|
411
|
-
export { type ai_agent_ChunkStrategy as ChunkStrategy, type ai_agent_CompressHtmlResult as CompressHtmlResult, type ai_agent_CompressJsonResult as CompressJsonResult, type ai_agent_CompressMarkdownResult as CompressMarkdownResult, type ai_agent_CostEstimate as CostEstimate, type ai_agent_DedupeResult as DedupeResult, type ai_agent_DedupeStrategy as DedupeStrategy, type ai_agent_DiffEntry2 as DiffEntry2, type ai_agent_DiffOp2 as DiffOp2, type ai_agent_DiffResult2 as DiffResult2, type ai_agent_Entity2 as Entity2, type ai_agent_EntityType2 as EntityType2, type ai_agent_ExtractJsonResult as ExtractJsonResult, type ai_agent_ExtractKeywordsResult as ExtractKeywordsResult, type ai_agent_ExtractUrlsResult as ExtractUrlsResult, type ai_agent_InjectionDetectResult as InjectionDetectResult, type ai_agent_InjectionFinding as InjectionFinding, type ai_agent_JsonBlock as JsonBlock, type ai_agent_JsonRepairResult as JsonRepairResult, type ai_agent_Keyword as Keyword, ai_agent_MODEL_PRICING as MODEL_PRICING, type ai_agent_MergeResult as MergeResult, type ai_agent_MergeStrategy as MergeStrategy, type ai_agent_ModelPricing as ModelPricing, type ai_agent_PiiDetectResult as PiiDetectResult, type ai_agent_PiiFinding as PiiFinding, type ai_agent_PiiType as PiiType, type ai_agent_RankedChunk as RankedChunk, type ai_agent_RelevanceResult as RelevanceResult, type ai_agent_SanitizeResult as SanitizeResult, type ai_agent_SecretDetectResult as SecretDetectResult, type ai_agent_SecretFinding as SecretFinding, type ai_agent_SecretType as SecretType, type ai_agent_SummaryResult as SummaryResult, type ai_agent_TableResult2 as TableResult2, type ai_agent_TextChunk as TextChunk, type ai_agent_TokenEstimate as TokenEstimate, type ai_agent_TokenEstimateResult as TokenEstimateResult, type ai_agent_TrimResult as TrimResult, type ai_agent_TrimStrategy as TrimStrategy, type ai_agent_UrlMatch as UrlMatch, type ai_agent_ValidationError as ValidationError, type ai_agent_ValidationResult as ValidationResult, type ai_agent_VectorSimilarityResult as VectorSimilarityResult, ai_agent_chunkText as chunkText, ai_agent_compressHtml as compressHtml, ai_agent_compressJson as compressJson, ai_agent_compressMarkdown as compressMarkdown, ai_agent_deduplicateLines as deduplicateLines, ai_agent_detectPii as detectPii, ai_agent_detectPromptInjection as detectPromptInjection, ai_agent_detectSecrets as detectSecrets, ai_agent_diffJson as diffJson, ai_agent_estimateCost as estimateCost, ai_agent_estimateTokens as estimateTokens, ai_agent_expandQuery as expandQuery, ai_agent_extractEntities as extractEntities, ai_agent_extractJson as extractJson, ai_agent_extractKeywords as extractKeywords, ai_agent_extractTables as extractTables, ai_agent_extractUrls as extractUrls, ai_agent_flattenJson as flattenJson, ai_agent_mergeJson as mergeJson, ai_agent_redactPii as redactPii, ai_agent_repairJson as repairJson, ai_agent_rerankChunks as rerankChunks, ai_agent_sanitizeHtml as sanitizeHtml, ai_agent_scoreRelevance as scoreRelevance, ai_agent_summarizeForLlm as summarizeForLlm, ai_agent_trimToTokens as trimToTokens, ai_agent_unflattenJson as unflattenJson, ai_agent_validateJsonSchema as validateJsonSchema, ai_agent_vectorSimilarity as vectorSimilarity };
|
|
433
|
+
export { type ai_agent_ChunkStrategy as ChunkStrategy, type ai_agent_CompressHtmlResult as CompressHtmlResult, type ai_agent_CompressJsonResult as CompressJsonResult, type ai_agent_CompressMarkdownResult as CompressMarkdownResult, type ai_agent_CostEstimate as CostEstimate, type ai_agent_DedupeResult as DedupeResult, type ai_agent_DedupeStrategy as DedupeStrategy, type ai_agent_DiffEntry2 as DiffEntry2, type ai_agent_DiffOp2 as DiffOp2, type ai_agent_DiffResult2 as DiffResult2, type ai_agent_Entity2 as Entity2, type ai_agent_EntityType2 as EntityType2, type ai_agent_ExtractJsonResult as ExtractJsonResult, type ai_agent_ExtractKeywordsResult as ExtractKeywordsResult, type ai_agent_ExtractUrlsResult as ExtractUrlsResult, type ai_agent_FewShotExample as FewShotExample, type ai_agent_FewShotFormat as FewShotFormat, type ai_agent_FewShotFormatResult as FewShotFormatResult, type ai_agent_InjectionDetectResult as InjectionDetectResult, type ai_agent_InjectionFinding as InjectionFinding, type ai_agent_JsonBlock as JsonBlock, type ai_agent_JsonRepairResult as JsonRepairResult, type ai_agent_Keyword as Keyword, ai_agent_MODEL_PRICING as MODEL_PRICING, type ai_agent_MergeResult as MergeResult, type ai_agent_MergeStrategy as MergeStrategy, type ai_agent_ModelPricing as ModelPricing, type ai_agent_PiiDetectResult as PiiDetectResult, type ai_agent_PiiFinding as PiiFinding, type ai_agent_PiiType as PiiType, type ai_agent_RankedChunk as RankedChunk, type ai_agent_RelevanceResult as RelevanceResult, type ai_agent_SanitizeResult as SanitizeResult, type ai_agent_SecretDetectResult as SecretDetectResult, type ai_agent_SecretFinding as SecretFinding, type ai_agent_SecretType as SecretType, type ai_agent_SummaryResult as SummaryResult, type ai_agent_TableResult2 as TableResult2, type ai_agent_TextChunk as TextChunk, type ai_agent_TokenEstimate as TokenEstimate, type ai_agent_TokenEstimateResult as TokenEstimateResult, type ai_agent_TrimResult as TrimResult, type ai_agent_TrimStrategy as TrimStrategy, type ai_agent_UrlMatch as UrlMatch, type ai_agent_ValidationError as ValidationError, type ai_agent_ValidationResult as ValidationResult, type ai_agent_VectorSimilarityResult as VectorSimilarityResult, ai_agent_chunkText as chunkText, ai_agent_compressHtml as compressHtml, ai_agent_compressJson as compressJson, ai_agent_compressMarkdown as compressMarkdown, ai_agent_deduplicateLines as deduplicateLines, ai_agent_detectPii as detectPii, ai_agent_detectPromptInjection as detectPromptInjection, ai_agent_detectSecrets as detectSecrets, ai_agent_diffJson as diffJson, ai_agent_estimateCost as estimateCost, ai_agent_estimateTokens as estimateTokens, ai_agent_expandQuery as expandQuery, ai_agent_extractEntities as extractEntities, ai_agent_extractJson as extractJson, ai_agent_extractKeywords as extractKeywords, ai_agent_extractTables as extractTables, ai_agent_extractUrls as extractUrls, ai_agent_flattenJson as flattenJson, ai_agent_formatFewShotExamples as formatFewShotExamples, ai_agent_mergeJson as mergeJson, ai_agent_redactPii as redactPii, ai_agent_repairJson as repairJson, ai_agent_rerankChunks as rerankChunks, ai_agent_sanitizeHtml as sanitizeHtml, ai_agent_scoreRelevance as scoreRelevance, ai_agent_summarizeForLlm as summarizeForLlm, ai_agent_trimToTokens as trimToTokens, ai_agent_unflattenJson as unflattenJson, ai_agent_validateJsonSchema as validateJsonSchema, ai_agent_vectorSimilarity as vectorSimilarity };
|
|
412
434
|
}
|
|
413
435
|
|
|
414
|
-
export {
|
|
436
|
+
export { detectPii as $, type SummaryResult as A, type TextChunk as B, type ChunkStrategy as C, type DedupeResult as D, type Entity2 as E, type FewShotExample as F, type TokenEstimate as G, type TokenEstimateResult as H, type InjectionDetectResult as I, type JsonBlock as J, type Keyword as K, type TrimResult as L, MODEL_PRICING as M, type TrimStrategy as N, type ValidationResult as O, type PiiDetectResult as P, type VectorSimilarityResult as Q, type RankedChunk as R, type SanitizeResult as S, type TableResult2 as T, type UrlMatch as U, type ValidationError as V, chunkText as W, compressHtml as X, compressJson as Y, compressMarkdown as Z, deduplicateLines as _, ai_agent as a, detectPromptInjection as a0, detectSecrets as a1, diffJson as a2, estimateCost as a3, estimateTokens as a4, expandQuery as a5, extractEntities as a6, extractJson as a7, extractKeywords as a8, extractTables as a9, extractUrls as aa, flattenJson as ab, formatFewShotExamples as ac, mergeJson as ad, redactPii as ae, repairJson as af, rerankChunks as ag, sanitizeHtml as ah, scoreRelevance as ai, summarizeForLlm as aj, trimToTokens as ak, unflattenJson as al, validateJsonSchema as am, vectorSimilarity as an, type CompressHtmlResult as b, type CompressJsonResult as c, type CompressMarkdownResult as d, type CostEstimate as e, type DedupeStrategy as f, type DiffEntry2 as g, type DiffOp2 as h, type DiffResult2 as i, type EntityType2 as j, type ExtractJsonResult as k, type ExtractKeywordsResult as l, type ExtractUrlsResult as m, type FewShotFormat as n, type FewShotFormatResult as o, type InjectionFinding as p, type JsonRepairResult as q, type MergeResult as r, type MergeStrategy as s, type ModelPricing as t, type PiiFinding as u, type PiiType as v, type RelevanceResult as w, type SecretDetectResult as x, type SecretFinding as y, type SecretType as z };
|
|
@@ -32,6 +32,7 @@ __export(data_exports, {
|
|
|
32
32
|
ndjsonToJsonArray: () => ndjsonToJsonArray,
|
|
33
33
|
parseCsv: () => parseCsv,
|
|
34
34
|
parseEnv: () => parseEnv,
|
|
35
|
+
parseFrontMatter: () => parseFrontMatter,
|
|
35
36
|
parseIni: () => parseIni,
|
|
36
37
|
parseSubtitleTimestamp: () => parseSubtitleTimestamp,
|
|
37
38
|
parseSubtitles: () => parseSubtitles,
|
|
@@ -1334,5 +1335,69 @@ function shiftSubtitles(input, offsetSeconds, target) {
|
|
|
1334
1335
|
warnings
|
|
1335
1336
|
};
|
|
1336
1337
|
}
|
|
1338
|
+
function parseFrontMatterScalar(value) {
|
|
1339
|
+
if (value.startsWith('"') && value.endsWith('"') || value.startsWith("'") && value.endsWith("'")) {
|
|
1340
|
+
return value.slice(1, -1);
|
|
1341
|
+
}
|
|
1342
|
+
if (value === "true") return true;
|
|
1343
|
+
if (value === "false") return false;
|
|
1344
|
+
if (value === "null" || value === "~") return null;
|
|
1345
|
+
if (value !== "" && !Number.isNaN(Number(value))) return Number(value);
|
|
1346
|
+
return value;
|
|
1347
|
+
}
|
|
1348
|
+
function parseFrontMatter(input) {
|
|
1349
|
+
if (typeof input !== "string" || input.length === 0) return { error: "input is required" };
|
|
1350
|
+
const normalized = input.replace(/\r\n/g, "\n");
|
|
1351
|
+
if (!normalized.startsWith("---\n") && normalized !== "---") {
|
|
1352
|
+
return { frontMatter: {}, body: input, hasFrontMatter: false, raw: "" };
|
|
1353
|
+
}
|
|
1354
|
+
const closingIdx = normalized.indexOf("\n---", 4);
|
|
1355
|
+
if (closingIdx === -1) {
|
|
1356
|
+
return { error: 'Front matter opening delimiter found but no closing "---" delimiter' };
|
|
1357
|
+
}
|
|
1358
|
+
const raw = normalized.slice(4, closingIdx);
|
|
1359
|
+
let afterClose = normalized.slice(closingIdx + 4);
|
|
1360
|
+
if (afterClose.startsWith("\n")) afterClose = afterClose.slice(1);
|
|
1361
|
+
const frontMatter = {};
|
|
1362
|
+
const rawLines = raw.split("\n");
|
|
1363
|
+
let i = 0;
|
|
1364
|
+
while (i < rawLines.length) {
|
|
1365
|
+
const line = rawLines[i];
|
|
1366
|
+
if (line.trim() === "" || line.trim().startsWith("#")) {
|
|
1367
|
+
i++;
|
|
1368
|
+
continue;
|
|
1369
|
+
}
|
|
1370
|
+
const colonIdx = line.indexOf(":");
|
|
1371
|
+
if (colonIdx === -1) return { error: `Invalid front matter line ${i + 1}: expected "key: value"` };
|
|
1372
|
+
const key = line.slice(0, colonIdx).trim();
|
|
1373
|
+
if (!key) return { error: `Invalid front matter line ${i + 1}: empty key` };
|
|
1374
|
+
const rest = line.slice(colonIdx + 1).trim();
|
|
1375
|
+
if (rest === "") {
|
|
1376
|
+
const listItems = [];
|
|
1377
|
+
let j = i + 1;
|
|
1378
|
+
while (j < rawLines.length && /^\s*-\s+/.test(rawLines[j])) {
|
|
1379
|
+
listItems.push(rawLines[j].replace(/^\s*-\s+/, "").trim());
|
|
1380
|
+
j++;
|
|
1381
|
+
}
|
|
1382
|
+
if (listItems.length > 0) {
|
|
1383
|
+
frontMatter[key] = listItems.map(parseFrontMatterScalar);
|
|
1384
|
+
i = j;
|
|
1385
|
+
continue;
|
|
1386
|
+
}
|
|
1387
|
+
frontMatter[key] = null;
|
|
1388
|
+
i++;
|
|
1389
|
+
continue;
|
|
1390
|
+
}
|
|
1391
|
+
if (rest.startsWith("[") && rest.endsWith("]")) {
|
|
1392
|
+
const inner = rest.slice(1, -1).trim();
|
|
1393
|
+
frontMatter[key] = inner === "" ? [] : inner.split(",").map((s) => parseFrontMatterScalar(s.trim()));
|
|
1394
|
+
i++;
|
|
1395
|
+
continue;
|
|
1396
|
+
}
|
|
1397
|
+
frontMatter[key] = parseFrontMatterScalar(rest);
|
|
1398
|
+
i++;
|
|
1399
|
+
}
|
|
1400
|
+
return { frontMatter, body: afterClose, hasFrontMatter: true, raw };
|
|
1401
|
+
}
|
|
1337
1402
|
|
|
1338
|
-
export { convertSubtitles, csvToJson, data_exports, detectDelimiter, detectSubtitleFormat, diffEnvExample, envToExport, envToJson, formatNdjson, formatSubtitleTimestamp, formatToml, formatXml, getSection, getSectionNames, getTomlStats, getXmlStats, getYamlStats, iniToJson, jsonArrayToNdjson, jsonToIni, jsonToToml, jsonToXml, minifyNdjson, minifyToml, minifyXml, ndjsonToJsonArray, parseCsv, parseEnv, parseIni, parseSubtitleTimestamp, parseSubtitles, parseXmlToObject, serializeSubtitles, shiftSubtitles, stringifyIni, toCsvString, tomlToJson, validateEnvKey, validateIni, validateNdjson, validateToml, validateXml, validateYaml, xmlToJson };
|
|
1403
|
+
export { convertSubtitles, csvToJson, data_exports, detectDelimiter, detectSubtitleFormat, diffEnvExample, envToExport, envToJson, formatNdjson, formatSubtitleTimestamp, formatToml, formatXml, 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 };
|
|
@@ -22,6 +22,7 @@ __export(units_exports, {
|
|
|
22
22
|
calculateBreakEven: () => calculateBreakEven,
|
|
23
23
|
calculateCompoundInterest: () => calculateCompoundInterest,
|
|
24
24
|
calculateDiscount: () => calculateDiscount,
|
|
25
|
+
calculateEmi: () => calculateEmi,
|
|
25
26
|
calculateLoan: () => calculateLoan,
|
|
26
27
|
calculateMarginMarkup: () => calculateMarginMarkup,
|
|
27
28
|
calculatePercentageChange: () => calculatePercentageChange,
|
|
@@ -1676,5 +1677,60 @@ function calculateRuleOf72(value, direction) {
|
|
|
1676
1677
|
errorPercent: round4(errorPercent)
|
|
1677
1678
|
};
|
|
1678
1679
|
}
|
|
1680
|
+
function calculateEmi(principal, annualRatePercent, tenure, tenureUnit = "years") {
|
|
1681
|
+
if (!Number.isFinite(principal) || principal <= 0) return { error: "Principal must be a positive number" };
|
|
1682
|
+
if (!Number.isFinite(annualRatePercent) || annualRatePercent < 0) {
|
|
1683
|
+
return { error: "Annual interest rate must be zero or a positive number" };
|
|
1684
|
+
}
|
|
1685
|
+
if (tenureUnit !== "years" && tenureUnit !== "months") {
|
|
1686
|
+
return { error: 'tenureUnit must be "years" or "months"' };
|
|
1687
|
+
}
|
|
1688
|
+
if (!Number.isFinite(tenure) || tenure <= 0) return { error: "Tenure must be a positive number" };
|
|
1689
|
+
const tenureMonths = Math.round(tenureUnit === "years" ? tenure * 12 : tenure);
|
|
1690
|
+
if (tenureMonths <= 0) return { error: "Tenure must resolve to at least 1 month" };
|
|
1691
|
+
const monthlyRate = annualRatePercent / 100 / 12;
|
|
1692
|
+
let emi;
|
|
1693
|
+
if (monthlyRate === 0) {
|
|
1694
|
+
emi = principal / tenureMonths;
|
|
1695
|
+
} else {
|
|
1696
|
+
const factor = Math.pow(1 + monthlyRate, tenureMonths);
|
|
1697
|
+
emi = principal * monthlyRate * factor / (factor - 1);
|
|
1698
|
+
}
|
|
1699
|
+
const yearlyBreakdown = [];
|
|
1700
|
+
let balance = round2(principal);
|
|
1701
|
+
let totalPayment = 0;
|
|
1702
|
+
let yearPrincipal = 0;
|
|
1703
|
+
let yearInterest = 0;
|
|
1704
|
+
let year = 1;
|
|
1705
|
+
for (let month = 1; month <= tenureMonths; month++) {
|
|
1706
|
+
const interest = monthlyRate === 0 ? 0 : round2(balance * monthlyRate);
|
|
1707
|
+
let principalPortion = round2(emi) - interest;
|
|
1708
|
+
if (month === tenureMonths || principalPortion > balance) principalPortion = balance;
|
|
1709
|
+
const payment = round2(principalPortion + interest);
|
|
1710
|
+
balance = Math.max(round2(balance - principalPortion), 0);
|
|
1711
|
+
totalPayment += payment;
|
|
1712
|
+
yearPrincipal += principalPortion;
|
|
1713
|
+
yearInterest += interest;
|
|
1714
|
+
const isYearEnd = month % 12 === 0 || month === tenureMonths;
|
|
1715
|
+
if (isYearEnd) {
|
|
1716
|
+
yearlyBreakdown.push({
|
|
1717
|
+
year,
|
|
1718
|
+
principalPaid: round2(yearPrincipal),
|
|
1719
|
+
interestPaid: round2(yearInterest),
|
|
1720
|
+
balance
|
|
1721
|
+
});
|
|
1722
|
+
year += 1;
|
|
1723
|
+
yearPrincipal = 0;
|
|
1724
|
+
yearInterest = 0;
|
|
1725
|
+
}
|
|
1726
|
+
}
|
|
1727
|
+
return {
|
|
1728
|
+
emi: round2(emi),
|
|
1729
|
+
totalInterest: round2(totalPayment - principal),
|
|
1730
|
+
totalPayment: round2(totalPayment),
|
|
1731
|
+
tenureMonths,
|
|
1732
|
+
yearlyBreakdown
|
|
1733
|
+
};
|
|
1734
|
+
}
|
|
1679
1735
|
|
|
1680
|
-
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, applySuccessiveDiscounts, autoFormat, bumpVersion, calcAspectRatio, calcSubnet, calculateBreakEven, calculateCompoundInterest, calculateDiscount, calculateLoan, calculateMarginMarkup, calculatePercentageChange, calculateRuleOf72, calculateSimpleInterest, calculateTax, calculateTimeValue, calculateTipSplit, calculateVideoBitrate, compareSemver, 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 };
|
|
1736
|
+
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, applySuccessiveDiscounts, autoFormat, bumpVersion, calcAspectRatio, calcSubnet, calculateBreakEven, calculateCompoundInterest, calculateDiscount, calculateEmi, calculateLoan, calculateMarginMarkup, calculatePercentageChange, calculateRuleOf72, calculateSimpleInterest, calculateTax, calculateTimeValue, calculateTipSplit, calculateVideoBitrate, compareSemver, 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 };
|
|
@@ -10,6 +10,7 @@ __export(text_exports, {
|
|
|
10
10
|
LINE_OPS: () => LINE_OPS,
|
|
11
11
|
MORSE_CODE: () => MORSE_CODE,
|
|
12
12
|
addBorder: () => addBorder,
|
|
13
|
+
analyzeSentenceLengths: () => analyzeSentenceLengths,
|
|
13
14
|
analyzeText: () => analyzeText,
|
|
14
15
|
applyOp: () => applyOp,
|
|
15
16
|
applyOps: () => applyOps,
|
|
@@ -2598,5 +2599,70 @@ function calculateStringDistance(a, b, options) {
|
|
|
2598
2599
|
const similarity = maxLength === 0 ? 1 : Math.round((1 - distance / maxLength) * 1e4) / 1e4;
|
|
2599
2600
|
return { a, b, distance, similarity, maxLength, mode };
|
|
2600
2601
|
}
|
|
2602
|
+
function splitIntoSentencesForLengthDist(text) {
|
|
2603
|
+
const matches = text.match(/[^.!?]+[.!?]*/g);
|
|
2604
|
+
if (!matches) return [];
|
|
2605
|
+
return matches.map((s) => s.trim()).filter((s) => s.length > 0);
|
|
2606
|
+
}
|
|
2607
|
+
function countWordsInSentence(sentence) {
|
|
2608
|
+
return (sentence.match(/[a-zA-Z']+/g) ?? []).length;
|
|
2609
|
+
}
|
|
2610
|
+
function analyzeSentenceLengths(text) {
|
|
2611
|
+
const sentences = splitIntoSentencesForLengthDist(text);
|
|
2612
|
+
const lengths = sentences.map(countWordsInSentence).filter((n) => n > 0);
|
|
2613
|
+
if (lengths.length === 0) {
|
|
2614
|
+
return {
|
|
2615
|
+
sentenceCount: 0,
|
|
2616
|
+
lengths: [],
|
|
2617
|
+
minLength: 0,
|
|
2618
|
+
maxLength: 0,
|
|
2619
|
+
meanLength: 0,
|
|
2620
|
+
medianLength: 0,
|
|
2621
|
+
stdDev: 0,
|
|
2622
|
+
coefficientOfVariation: 0,
|
|
2623
|
+
consistency: "No sentences to analyze",
|
|
2624
|
+
buckets: []
|
|
2625
|
+
};
|
|
2626
|
+
}
|
|
2627
|
+
const sentenceCount2 = lengths.length;
|
|
2628
|
+
const minLength = Math.min(...lengths);
|
|
2629
|
+
const maxLength = Math.max(...lengths);
|
|
2630
|
+
const meanLength = lengths.reduce((a, b) => a + b, 0) / sentenceCount2;
|
|
2631
|
+
const sorted = [...lengths].sort((a, b) => a - b);
|
|
2632
|
+
const mid = Math.floor(sorted.length / 2);
|
|
2633
|
+
const medianLength = sorted.length % 2 === 0 ? (sorted[mid - 1] + sorted[mid]) / 2 : sorted[mid];
|
|
2634
|
+
const variance = lengths.reduce((sum, n) => sum + (n - meanLength) ** 2, 0) / sentenceCount2;
|
|
2635
|
+
const stdDev = Math.sqrt(variance);
|
|
2636
|
+
const coefficientOfVariation = meanLength > 0 ? stdDev / meanLength : 0;
|
|
2637
|
+
let consistency;
|
|
2638
|
+
if (coefficientOfVariation < 0.3) consistency = "Consistent \u2014 sentence lengths vary little";
|
|
2639
|
+
else if (coefficientOfVariation < 0.6) consistency = "Moderate variation in sentence length";
|
|
2640
|
+
else consistency = "Highly variable sentence length";
|
|
2641
|
+
const bucketWidth = 5;
|
|
2642
|
+
const bucketCount = Math.max(1, Math.ceil(maxLength / bucketWidth));
|
|
2643
|
+
const buckets = [];
|
|
2644
|
+
for (let i = 0; i < bucketCount; i++) {
|
|
2645
|
+
const min = i * bucketWidth + 1;
|
|
2646
|
+
const max = (i + 1) * bucketWidth;
|
|
2647
|
+
buckets.push({ label: `${min}-${max}`, min, max, count: 0 });
|
|
2648
|
+
}
|
|
2649
|
+
for (const len of lengths) {
|
|
2650
|
+
const idx = Math.min(Math.floor((len - 1) / bucketWidth), bucketCount - 1);
|
|
2651
|
+
buckets[idx].count++;
|
|
2652
|
+
}
|
|
2653
|
+
const round2 = (n) => Math.round(n * 100) / 100;
|
|
2654
|
+
return {
|
|
2655
|
+
sentenceCount: sentenceCount2,
|
|
2656
|
+
lengths,
|
|
2657
|
+
minLength,
|
|
2658
|
+
maxLength,
|
|
2659
|
+
meanLength: round2(meanLength),
|
|
2660
|
+
medianLength: round2(medianLength),
|
|
2661
|
+
stdDev: round2(stdDev),
|
|
2662
|
+
coefficientOfVariation: round2(coefficientOfVariation),
|
|
2663
|
+
consistency,
|
|
2664
|
+
buckets
|
|
2665
|
+
};
|
|
2666
|
+
}
|
|
2601
2667
|
|
|
2602
|
-
export { CASE_FORMATS, DEFAULT_CONVERT_OPTIONS, ESCAPE_MODES, LINE_OPS, MORSE_CODE, addBorder, analyzeText, applyOp, applyOps, calculateStringDistance, centerText, convertAll, convertCase, countWords, csvToHtml, csvToMarkdown, detectDelimiter, detectFillerWords, detectPassiveVoice, diffLines, diffLinesSimple, diffStats, escapeAll, escapeString, extractHeadings, formatReadingTime, generate, generateDiff, generateHtmlTable, generateMarkdownTable, generateParagraphs, generateSentences, generateWords, getAvailableFonts, getMorseForChar, getMorseTiming, htmlToMarkdown, isValidMorse, markdownToHtml, morseToText, numberToOrdinal, numberToRoman, numberToWords, ordinalWords, parseDiff, parseTableData, readabilityScore, renderMarkdown, romanToNumber, scoreReadability, sentenceCount, slugify, slugifyAll, syllableCount, textToAscii, textToMorse, text_exports, unescapeString, wordFrequency };
|
|
2668
|
+
export { CASE_FORMATS, DEFAULT_CONVERT_OPTIONS, ESCAPE_MODES, LINE_OPS, MORSE_CODE, addBorder, analyzeSentenceLengths, analyzeText, applyOp, applyOps, calculateStringDistance, centerText, convertAll, convertCase, countWords, csvToHtml, csvToMarkdown, detectDelimiter, detectFillerWords, detectPassiveVoice, diffLines, diffLinesSimple, diffStats, escapeAll, escapeString, extractHeadings, formatReadingTime, generate, generateDiff, generateHtmlTable, generateMarkdownTable, generateParagraphs, generateSentences, generateWords, getAvailableFonts, getMorseForChar, getMorseTiming, htmlToMarkdown, isValidMorse, markdownToHtml, morseToText, numberToOrdinal, numberToRoman, numberToWords, ordinalWords, parseDiff, parseTableData, readabilityScore, renderMarkdown, romanToNumber, scoreReadability, sentenceCount, slugify, slugifyAll, syllableCount, textToAscii, textToMorse, text_exports, unescapeString, wordFrequency };
|
|
@@ -22,6 +22,7 @@ __export(ai_agent_exports, {
|
|
|
22
22
|
extractTables: () => extractTables,
|
|
23
23
|
extractUrls: () => extractUrls,
|
|
24
24
|
flattenJson: () => flattenJson,
|
|
25
|
+
formatFewShotExamples: () => formatFewShotExamples,
|
|
25
26
|
mergeJson: () => mergeJson,
|
|
26
27
|
redactPii: () => redactPii,
|
|
27
28
|
repairJson: () => repairJson,
|
|
@@ -979,5 +980,28 @@ function vectorSimilarity(a, b) {
|
|
|
979
980
|
magnitudeB: round6(magB)
|
|
980
981
|
};
|
|
981
982
|
}
|
|
983
|
+
function formatFewShotExamples(examples, format = "numbered", delimiter = "---") {
|
|
984
|
+
const valid = (examples ?? []).filter((e) => e?.input?.trim() && e?.output?.trim());
|
|
985
|
+
if (valid.length === 0) {
|
|
986
|
+
return { formatted: "", exampleCount: 0, format };
|
|
987
|
+
}
|
|
988
|
+
let formatted;
|
|
989
|
+
if (format === "xml") {
|
|
990
|
+
formatted = valid.map((e) => `<example>
|
|
991
|
+
<input>${e.input.trim()}</input>
|
|
992
|
+
<output>${e.output.trim()}</output>
|
|
993
|
+
</example>`).join("\n\n");
|
|
994
|
+
} else if (format === "delimiter") {
|
|
995
|
+
formatted = valid.map((e) => `Input: ${e.input.trim()}
|
|
996
|
+
Output: ${e.output.trim()}`).join(`
|
|
997
|
+
${delimiter}
|
|
998
|
+
`);
|
|
999
|
+
} else {
|
|
1000
|
+
formatted = valid.map((e, i) => `Example ${i + 1}:
|
|
1001
|
+
Input: ${e.input.trim()}
|
|
1002
|
+
Output: ${e.output.trim()}`).join("\n\n");
|
|
1003
|
+
}
|
|
1004
|
+
return { formatted, exampleCount: valid.length, format };
|
|
1005
|
+
}
|
|
982
1006
|
|
|
983
|
-
export { MODEL_PRICING, ai_agent_exports, chunkText, compressHtml, compressJson, compressMarkdown, deduplicateLines, detectPii, detectPromptInjection, detectSecrets, diffJson, estimateCost, estimateTokens, expandQuery, extractEntities, extractJson, extractKeywords, extractTables, extractUrls, flattenJson, mergeJson, redactPii, repairJson, rerankChunks, sanitizeHtml, scoreRelevance, summarizeForLlm, trimToTokens, unflattenJson, validateJsonSchema, vectorSimilarity };
|
|
1007
|
+
export { MODEL_PRICING, ai_agent_exports, chunkText, compressHtml, compressJson, compressMarkdown, deduplicateLines, detectPii, detectPromptInjection, detectSecrets, diffJson, estimateCost, estimateTokens, expandQuery, extractEntities, extractJson, extractKeywords, extractTables, extractUrls, flattenJson, formatFewShotExamples, mergeJson, redactPii, repairJson, rerankChunks, sanitizeHtml, scoreRelevance, summarizeForLlm, trimToTokens, unflattenJson, validateJsonSchema, vectorSimilarity };
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
* - env-diff-checker: diffEnvExample
|
|
14
14
|
* - ndjson-formatter: validateNdjson, minifyNdjson, formatNdjson, ndjsonToJsonArray, jsonArrayToNdjson
|
|
15
15
|
* - subtitle-converter: parseSubtitleTimestamp, formatSubtitleTimestamp, detectSubtitleFormat, parseSubtitles, serializeSubtitles, convertSubtitles, shiftSubtitles
|
|
16
|
+
* - markdown-front-matter-parser: parseFrontMatter
|
|
16
17
|
*/
|
|
17
18
|
interface ValidationResult {
|
|
18
19
|
valid: boolean;
|
|
@@ -272,6 +273,24 @@ declare function convertSubtitles(input: string, target: SubtitleFormat, sourceF
|
|
|
272
273
|
declare function shiftSubtitles(input: string, offsetSeconds: number, target?: SubtitleFormat): ConvertedSubtitles | {
|
|
273
274
|
error: string;
|
|
274
275
|
};
|
|
276
|
+
interface FrontMatterResult {
|
|
277
|
+
frontMatter: Record<string, unknown>;
|
|
278
|
+
body: string;
|
|
279
|
+
hasFrontMatter: boolean;
|
|
280
|
+
raw: string;
|
|
281
|
+
}
|
|
282
|
+
interface FrontMatterError {
|
|
283
|
+
error: string;
|
|
284
|
+
}
|
|
285
|
+
/**
|
|
286
|
+
* Split a Markdown document into its YAML front matter (delimited by --- lines
|
|
287
|
+
* at the top) and body content. Parses simple scalar values (strings, quoted
|
|
288
|
+
* strings, booleans, numbers, null), inline arrays (`tags: [a, b]`), and YAML
|
|
289
|
+
* block lists (`tags:\n - a\n - b`). Not a full YAML parser: nested mappings
|
|
290
|
+
* and multi-line block scalars are not supported. A document with no opening
|
|
291
|
+
* "---" delimiter is returned as-is with `hasFrontMatter: false`.
|
|
292
|
+
*/
|
|
293
|
+
declare function parseFrontMatter(input: string): FrontMatterResult | FrontMatterError;
|
|
275
294
|
|
|
276
295
|
type data_ConvertedSubtitles = ConvertedSubtitles;
|
|
277
296
|
type data_CsvParseResult = CsvParseResult;
|
|
@@ -279,6 +298,8 @@ type data_EnvDiffError = EnvDiffError;
|
|
|
279
298
|
type data_EnvDiffResult = EnvDiffResult;
|
|
280
299
|
type data_EnvEntry = EnvEntry;
|
|
281
300
|
type data_EnvParseResult = EnvParseResult;
|
|
301
|
+
type data_FrontMatterError = FrontMatterError;
|
|
302
|
+
type data_FrontMatterResult = FrontMatterResult;
|
|
282
303
|
type data_IniSection = IniSection;
|
|
283
304
|
type data_NdjsonLineResult = NdjsonLineResult;
|
|
284
305
|
type data_NdjsonValidateResult = NdjsonValidateResult;
|
|
@@ -318,6 +339,7 @@ declare const data_minifyXml: typeof minifyXml;
|
|
|
318
339
|
declare const data_ndjsonToJsonArray: typeof ndjsonToJsonArray;
|
|
319
340
|
declare const data_parseCsv: typeof parseCsv;
|
|
320
341
|
declare const data_parseEnv: typeof parseEnv;
|
|
342
|
+
declare const data_parseFrontMatter: typeof parseFrontMatter;
|
|
321
343
|
declare const data_parseIni: typeof parseIni;
|
|
322
344
|
declare const data_parseSubtitleTimestamp: typeof parseSubtitleTimestamp;
|
|
323
345
|
declare const data_parseSubtitles: typeof parseSubtitles;
|
|
@@ -335,7 +357,7 @@ declare const data_validateXml: typeof validateXml;
|
|
|
335
357
|
declare const data_validateYaml: typeof validateYaml;
|
|
336
358
|
declare const data_xmlToJson: typeof xmlToJson;
|
|
337
359
|
declare namespace data {
|
|
338
|
-
export { type data_ConvertedSubtitles as ConvertedSubtitles, type data_CsvParseResult as CsvParseResult, type data_EnvDiffError as EnvDiffError, type data_EnvDiffResult as EnvDiffResult, type data_EnvEntry as EnvEntry, type data_EnvParseResult as EnvParseResult, type data_IniSection as IniSection, 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_detectDelimiter as detectDelimiter, data_detectSubtitleFormat as detectSubtitleFormat, data_diffEnvExample as diffEnvExample, data_envToExport as envToExport, data_envToJson as envToJson, data_formatNdjson as formatNdjson, data_formatSubtitleTimestamp as formatSubtitleTimestamp, data_formatToml as formatToml, data_formatXml as formatXml, 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_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 };
|
|
360
|
+
export { type data_ConvertedSubtitles as ConvertedSubtitles, type data_CsvParseResult as CsvParseResult, 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_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_detectDelimiter as detectDelimiter, data_detectSubtitleFormat as detectSubtitleFormat, data_diffEnvExample as diffEnvExample, data_envToExport as envToExport, data_envToJson as envToJson, data_formatNdjson as formatNdjson, data_formatSubtitleTimestamp as formatSubtitleTimestamp, data_formatToml as formatToml, data_formatXml as formatXml, 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 };
|
|
339
361
|
}
|
|
340
362
|
|
|
341
|
-
export {
|
|
363
|
+
export { serializeSubtitles as $, getYamlStats as A, iniToJson as B, type ConvertedSubtitles as C, jsonArrayToNdjson as D, type EnvDiffError as E, type FrontMatterError as F, jsonToIni as G, jsonToToml as H, type IniSection as I, jsonToXml as J, minifyNdjson as K, minifyToml as L, minifyXml as M, type NdjsonLineResult as N, ndjsonToJsonArray as O, type ParseOptions as P, parseCsv as Q, parseEnv as R, type SubtitleCue as S, type TomlFormatResult as T, parseFrontMatter as U, type ValidationResult as V, parseIni as W, type XmlFormatResult as X, parseSubtitleTimestamp as Y, parseSubtitles as Z, parseXmlToObject as _, type CsvParseResult as a, shiftSubtitles as a0, stringifyIni as a1, toCsvString as a2, tomlToJson as a3, validateEnvKey as a4, validateIni as a5, validateNdjson as a6, validateToml as a7, validateXml as a8, validateYaml as a9, xmlToJson as aa, type EnvDiffResult as b, type EnvEntry as c, data as d, type EnvParseResult as e, type FrontMatterResult as f, type NdjsonValidateResult as g, type ParsedIni as h, type ParsedSubtitles as i, type SubtitleFormat as j, type XmlToJsonOptions as k, convertSubtitles as l, csvToJson as m, detectDelimiter as n, detectSubtitleFormat as o, diffEnvExample as p, envToExport as q, envToJson as r, formatNdjson as s, formatSubtitleTimestamp as t, formatToml as u, formatXml as v, getSection as w, getSectionNames as x, getTomlStats as y, getXmlStats as z };
|