@utilix-tech/sdk 0.16.0 → 0.18.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 +6 -0
- package/README.md +21 -7
- package/dist/{ai_agent-CcpkV2DR.d.cts → ai_agent-B-c59NXD.d.cts} +23 -2
- package/dist/{ai_agent-CcpkV2DR.d.ts → ai_agent-B-c59NXD.d.ts} +23 -2
- package/dist/{chunk-M35VJETW.js → chunk-265NPGKH.js} +32 -2
- package/dist/{chunk-OB56VNKJ.js → chunk-3QMUUTBH.js} +107 -1
- package/dist/{chunk-Y5X34JAC.js → chunk-L53LAVAD.js} +64 -1
- package/dist/{chunk-M4MMO6C6.js → chunk-U34B5XPK.js} +41 -1
- package/dist/{code-C4skwg3l.d.cts → code-Cn9uOIAh.d.cts} +27 -2
- package/dist/{code-C4skwg3l.d.ts → code-Cn9uOIAh.d.ts} +27 -2
- package/dist/index.cjs +240 -1
- package/dist/index.d.cts +4 -4
- package/dist/index.d.ts +4 -4
- package/dist/index.js +4 -4
- package/dist/{network-DaNoZ5ER.d.cts → network-DZugNyAQ.d.cts} +35 -2
- package/dist/{network-DaNoZ5ER.d.ts → network-DZugNyAQ.d.ts} +35 -2
- package/dist/tools/ai_agent.cjs +30 -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/code.cjs +63 -0
- package/dist/tools/code.d.cts +1 -1
- package/dist/tools/code.d.ts +1 -1
- package/dist/tools/code.js +1 -1
- package/dist/tools/network.cjs +106 -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 +40 -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-CkV4kAIs.d.cts → units-BFTQwpBu.d.cts} +30 -2
- package/dist/{units-CkV4kAIs.d.ts → units-BFTQwpBu.d.ts} +30 -2
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
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.18.0
|
|
6
|
+
- Added Present Value / Future Value Calculator (`calculateTimeValue`) and Vector Similarity Calculator (`vectorSimilarity`).
|
|
7
|
+
|
|
8
|
+
## 0.17.0
|
|
9
|
+
- Added User-Agent Parser (`parseUserAgent`) and GitHub URL Parser (`parseGithubUrl`).
|
|
10
|
+
|
|
5
11
|
## 0.16.0
|
|
6
12
|
- Added Simple Interest Calculator (`calculateSimpleInterest`) and Base58 / Base62 Encoder (`base58Encode`, `base58Decode`, `base62Encode`, `base62Decode`).
|
|
7
13
|
|
package/README.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
# @utilix-tech/sdk
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**553 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)
|
|
@@ -247,7 +247,7 @@ getNextRuns("*/5 * * * *", 5); // next 5 run timestamps
|
|
|
247
247
|
### `/units`: Conversions
|
|
248
248
|
|
|
249
249
|
```ts
|
|
250
|
-
import { convertBytes, pxToAll, convert, formatValue, validateCardNumber, validateIban, calculateLoan, validateBarcode, calculateTax, calculateCompoundInterest, validateIsbn, calculateTipSplit, calculateSimpleInterest } from "@utilix-tech/sdk/units";
|
|
250
|
+
import { convertBytes, pxToAll, convert, formatValue, validateCardNumber, validateIban, calculateLoan, validateBarcode, calculateTax, calculateCompoundInterest, validateIsbn, calculateTipSplit, calculateSimpleInterest, calculateTimeValue } from "@utilix-tech/sdk/units";
|
|
251
251
|
|
|
252
252
|
// File sizes
|
|
253
253
|
convertBytes(1073741824, "GB"); // 1
|
|
@@ -301,6 +301,10 @@ calculateTipSplit(84.5, 18, 2);
|
|
|
301
301
|
// Simple (non-compounding) interest: principal x rate x time
|
|
302
302
|
calculateSimpleInterest(1000, 5, 2);
|
|
303
303
|
// { interest: 100, totalPayoff: 1100, ... }
|
|
304
|
+
|
|
305
|
+
// Present / future value (time value of money), either direction
|
|
306
|
+
calculateTimeValue(1000, 5, 10, "future");
|
|
307
|
+
// { presentValue: 1000, futureValue: 1628.89, growthFactor: 1.628895, ... }
|
|
304
308
|
```
|
|
305
309
|
|
|
306
310
|
---
|
|
@@ -310,7 +314,8 @@ calculateSimpleInterest(1000, 5, 2);
|
|
|
310
314
|
```ts
|
|
311
315
|
import { getStatusCode, isValidIp, isValidIpv4, isValidIpv6,
|
|
312
316
|
searchStatusCodes, buildGeoUrl, countryCodeToFlag,
|
|
313
|
-
parseHar, validateSitemap, validateRobotsTxt
|
|
317
|
+
parseHar, validateSitemap, validateRobotsTxt,
|
|
318
|
+
parseUserAgent } from "@utilix-tech/sdk/network";
|
|
314
319
|
|
|
315
320
|
getStatusCode(404);
|
|
316
321
|
// { code: 404, text: "Not Found", description: "...", category: "Client Error" }
|
|
@@ -323,6 +328,11 @@ isValidIp("256.0.0.1"); // false
|
|
|
323
328
|
|
|
324
329
|
countryCodeToFlag("US"); // "🇺🇸"
|
|
325
330
|
|
|
331
|
+
// User-Agent parsing
|
|
332
|
+
parseUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36");
|
|
333
|
+
// { browser: { name: "Chrome", version: "120.0.0.0" }, engine: { name: "Blink", version: "120.0.0.0" },
|
|
334
|
+
// os: { name: "Windows", version: "10" }, device: { type: "desktop" }, raw: "..." }
|
|
335
|
+
|
|
326
336
|
// Parse a DevTools .har network export into entries + summary stats
|
|
327
337
|
const har = await fs.promises.readFile("network.har", "utf-8");
|
|
328
338
|
parseHar(har);
|
|
@@ -379,7 +389,7 @@ generateCspHeader({ "default-src": ["'self'"], "script-src": ["'self'", "cdn.exa
|
|
|
379
389
|
|
|
380
390
|
```ts
|
|
381
391
|
import { formatSql, minifySql, testRegex, formatHtml, formatGql,
|
|
382
|
-
detectDialect, splitStatements, lookupMime } from "@utilix-tech/sdk/code";
|
|
392
|
+
detectDialect, splitStatements, lookupMime, parseGithubUrl } from "@utilix-tech/sdk/code";
|
|
383
393
|
|
|
384
394
|
// SQL
|
|
385
395
|
formatSql("SELECT id,name FROM users WHERE active=1 ORDER BY name");
|
|
@@ -407,6 +417,10 @@ formatGql("query { user(id: 1) { name email } }");
|
|
|
407
417
|
// MIME type lookup, either direction
|
|
408
418
|
lookupMime("json"); // { kind: "extension", matches: [{ extension: "json", mimeType: "application/json" }] }
|
|
409
419
|
lookupMime("image/jpeg"); // { kind: "mime", matches: [{ extension: "jpg", ... }, { extension: "jpeg", ... }] }
|
|
420
|
+
|
|
421
|
+
// GitHub URL parsing
|
|
422
|
+
parseGithubUrl("https://github.com/facebook/react/pull/1234");
|
|
423
|
+
// { owner: "facebook", repo: "react", type: "pull", number: 1234 }
|
|
410
424
|
```
|
|
411
425
|
|
|
412
426
|
---
|
|
@@ -536,13 +550,13 @@ readIcoInfo(new Uint8Array(icoBytes));
|
|
|
536
550
|
| `@utilix-tech/sdk/generators` | UUID v4/v7, ULID, passwords, strength check, fake data |
|
|
537
551
|
| `@utilix-tech/sdk/time` | Date diff, timezone convert, cron parse, relative time |
|
|
538
552
|
| `@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 |
|
|
539
|
-
| `@utilix-tech/sdk/network` | HTTP status codes, IP validation, country flags, geolocation URLs, HAR file parsing |
|
|
553
|
+
| `@utilix-tech/sdk/network` | HTTP status codes, IP validation, country flags, geolocation URLs, HAR file parsing, User-Agent parsing |
|
|
540
554
|
| `@utilix-tech/sdk/api` | cURL build/parse, JWT decode/sign, JWKS parse, CORS headers, CSP header |
|
|
541
|
-
| `@utilix-tech/sdk/code` | SQL format/minify, HTML format/minify, regex tester, GraphQL format, MIME type lookup |
|
|
555
|
+
| `@utilix-tech/sdk/code` | SQL format/minify, HTML format/minify, regex tester, GraphQL format, MIME type lookup, GitHub URL parsing |
|
|
542
556
|
| `@utilix-tech/sdk/color` | Hex/RGB/HSL/HSV/CMYK convert, palette generation, contrast check |
|
|
543
557
|
| `@utilix-tech/sdk/css` | CSS gradient, box-shadow, border-radius, keyframe animation generators |
|
|
544
558
|
| `@utilix-tech/sdk/misc` | SVG optimize/sanitize, file size format, Unicode inspector |
|
|
545
|
-
| `@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 |
|
|
559
|
+
| `@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 |
|
|
546
560
|
| `@utilix-tech/sdk/media` | Image format & dimension reading from raw bytes (PNG, JPEG, GIF, WebP, BMP); PDF metadata reading; WAV audio info; ID3 tags; ICO favicon inspection |
|
|
547
561
|
|
|
548
562
|
---
|
|
@@ -314,6 +314,25 @@ interface SummaryResult {
|
|
|
314
314
|
sentencesTotal: number;
|
|
315
315
|
}
|
|
316
316
|
declare function summarizeForLlm(text: string, maxTokens?: number, strategy?: 'extractive' | 'first' | 'last'): SummaryResult;
|
|
317
|
+
interface VectorSimilarityResult {
|
|
318
|
+
dimensions: number;
|
|
319
|
+
dotProduct: number;
|
|
320
|
+
cosineSimilarity: number;
|
|
321
|
+
euclideanDistance: number;
|
|
322
|
+
manhattanDistance: number;
|
|
323
|
+
magnitudeA: number;
|
|
324
|
+
magnitudeB: number;
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Compute cosine similarity, dot product, Euclidean distance, and Manhattan
|
|
328
|
+
* distance between two equal-length numeric vectors. Useful for debugging a
|
|
329
|
+
* RAG pipeline that already has embedding vectors from an external model.
|
|
330
|
+
* Cosine similarity is undefined when either vector is all zeros; this
|
|
331
|
+
* returns 0 in that case.
|
|
332
|
+
*/
|
|
333
|
+
declare function vectorSimilarity(a: number[], b: number[]): VectorSimilarityResult | {
|
|
334
|
+
error: string;
|
|
335
|
+
};
|
|
317
336
|
|
|
318
337
|
type ai_agent_ChunkStrategy = ChunkStrategy;
|
|
319
338
|
type ai_agent_CompressHtmlResult = CompressHtmlResult;
|
|
@@ -358,6 +377,7 @@ type ai_agent_TrimStrategy = TrimStrategy;
|
|
|
358
377
|
type ai_agent_UrlMatch = UrlMatch;
|
|
359
378
|
type ai_agent_ValidationError = ValidationError;
|
|
360
379
|
type ai_agent_ValidationResult = ValidationResult;
|
|
380
|
+
type ai_agent_VectorSimilarityResult = VectorSimilarityResult;
|
|
361
381
|
declare const ai_agent_chunkText: typeof chunkText;
|
|
362
382
|
declare const ai_agent_compressHtml: typeof compressHtml;
|
|
363
383
|
declare const ai_agent_compressJson: typeof compressJson;
|
|
@@ -386,8 +406,9 @@ declare const ai_agent_summarizeForLlm: typeof summarizeForLlm;
|
|
|
386
406
|
declare const ai_agent_trimToTokens: typeof trimToTokens;
|
|
387
407
|
declare const ai_agent_unflattenJson: typeof unflattenJson;
|
|
388
408
|
declare const ai_agent_validateJsonSchema: typeof validateJsonSchema;
|
|
409
|
+
declare const ai_agent_vectorSimilarity: typeof vectorSimilarity;
|
|
389
410
|
declare namespace ai_agent {
|
|
390
|
-
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, 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 };
|
|
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 };
|
|
391
412
|
}
|
|
392
413
|
|
|
393
|
-
export {
|
|
414
|
+
export { diffJson as $, type TokenEstimate as A, type TokenEstimateResult as B, type ChunkStrategy as C, type DedupeResult as D, type Entity2 as E, type TrimResult as F, type TrimStrategy as G, type ValidationResult as H, type InjectionDetectResult as I, type JsonBlock as J, type Keyword as K, type VectorSimilarityResult as L, MODEL_PRICING as M, chunkText as N, compressHtml as O, type PiiDetectResult as P, compressJson as Q, type RankedChunk as R, type SanitizeResult as S, type TableResult2 as T, type UrlMatch as U, type ValidationError as V, compressMarkdown as W, deduplicateLines as X, detectPii as Y, detectPromptInjection as Z, detectSecrets as _, ai_agent as a, estimateCost as a0, estimateTokens as a1, expandQuery as a2, extractEntities as a3, extractJson as a4, extractKeywords as a5, extractTables as a6, extractUrls as a7, flattenJson as a8, mergeJson as a9, redactPii as aa, repairJson as ab, rerankChunks as ac, sanitizeHtml as ad, scoreRelevance as ae, summarizeForLlm as af, trimToTokens as ag, unflattenJson as ah, validateJsonSchema as ai, vectorSimilarity as aj, 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 InjectionFinding as n, type JsonRepairResult as o, type MergeResult as p, type MergeStrategy as q, type ModelPricing as r, type PiiFinding as s, type PiiType as t, type RelevanceResult as u, type SecretDetectResult as v, type SecretFinding as w, type SecretType as x, type SummaryResult as y, type TextChunk as z };
|
|
@@ -314,6 +314,25 @@ interface SummaryResult {
|
|
|
314
314
|
sentencesTotal: number;
|
|
315
315
|
}
|
|
316
316
|
declare function summarizeForLlm(text: string, maxTokens?: number, strategy?: 'extractive' | 'first' | 'last'): SummaryResult;
|
|
317
|
+
interface VectorSimilarityResult {
|
|
318
|
+
dimensions: number;
|
|
319
|
+
dotProduct: number;
|
|
320
|
+
cosineSimilarity: number;
|
|
321
|
+
euclideanDistance: number;
|
|
322
|
+
manhattanDistance: number;
|
|
323
|
+
magnitudeA: number;
|
|
324
|
+
magnitudeB: number;
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* Compute cosine similarity, dot product, Euclidean distance, and Manhattan
|
|
328
|
+
* distance between two equal-length numeric vectors. Useful for debugging a
|
|
329
|
+
* RAG pipeline that already has embedding vectors from an external model.
|
|
330
|
+
* Cosine similarity is undefined when either vector is all zeros; this
|
|
331
|
+
* returns 0 in that case.
|
|
332
|
+
*/
|
|
333
|
+
declare function vectorSimilarity(a: number[], b: number[]): VectorSimilarityResult | {
|
|
334
|
+
error: string;
|
|
335
|
+
};
|
|
317
336
|
|
|
318
337
|
type ai_agent_ChunkStrategy = ChunkStrategy;
|
|
319
338
|
type ai_agent_CompressHtmlResult = CompressHtmlResult;
|
|
@@ -358,6 +377,7 @@ type ai_agent_TrimStrategy = TrimStrategy;
|
|
|
358
377
|
type ai_agent_UrlMatch = UrlMatch;
|
|
359
378
|
type ai_agent_ValidationError = ValidationError;
|
|
360
379
|
type ai_agent_ValidationResult = ValidationResult;
|
|
380
|
+
type ai_agent_VectorSimilarityResult = VectorSimilarityResult;
|
|
361
381
|
declare const ai_agent_chunkText: typeof chunkText;
|
|
362
382
|
declare const ai_agent_compressHtml: typeof compressHtml;
|
|
363
383
|
declare const ai_agent_compressJson: typeof compressJson;
|
|
@@ -386,8 +406,9 @@ declare const ai_agent_summarizeForLlm: typeof summarizeForLlm;
|
|
|
386
406
|
declare const ai_agent_trimToTokens: typeof trimToTokens;
|
|
387
407
|
declare const ai_agent_unflattenJson: typeof unflattenJson;
|
|
388
408
|
declare const ai_agent_validateJsonSchema: typeof validateJsonSchema;
|
|
409
|
+
declare const ai_agent_vectorSimilarity: typeof vectorSimilarity;
|
|
389
410
|
declare namespace ai_agent {
|
|
390
|
-
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, 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 };
|
|
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 };
|
|
391
412
|
}
|
|
392
413
|
|
|
393
|
-
export {
|
|
414
|
+
export { diffJson as $, type TokenEstimate as A, type TokenEstimateResult as B, type ChunkStrategy as C, type DedupeResult as D, type Entity2 as E, type TrimResult as F, type TrimStrategy as G, type ValidationResult as H, type InjectionDetectResult as I, type JsonBlock as J, type Keyword as K, type VectorSimilarityResult as L, MODEL_PRICING as M, chunkText as N, compressHtml as O, type PiiDetectResult as P, compressJson as Q, type RankedChunk as R, type SanitizeResult as S, type TableResult2 as T, type UrlMatch as U, type ValidationError as V, compressMarkdown as W, deduplicateLines as X, detectPii as Y, detectPromptInjection as Z, detectSecrets as _, ai_agent as a, estimateCost as a0, estimateTokens as a1, expandQuery as a2, extractEntities as a3, extractJson as a4, extractKeywords as a5, extractTables as a6, extractUrls as a7, flattenJson as a8, mergeJson as a9, redactPii as aa, repairJson as ab, rerankChunks as ac, sanitizeHtml as ad, scoreRelevance as ae, summarizeForLlm as af, trimToTokens as ag, unflattenJson as ah, validateJsonSchema as ai, vectorSimilarity as aj, 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 InjectionFinding as n, type JsonRepairResult as o, type MergeResult as p, type MergeStrategy as q, type ModelPricing as r, type PiiFinding as s, type PiiType as t, type RelevanceResult as u, type SecretDetectResult as v, type SecretFinding as w, type SecretType as x, type SummaryResult as y, type TextChunk as z };
|
|
@@ -31,7 +31,8 @@ __export(ai_agent_exports, {
|
|
|
31
31
|
summarizeForLlm: () => summarizeForLlm,
|
|
32
32
|
trimToTokens: () => trimToTokens,
|
|
33
33
|
unflattenJson: () => unflattenJson,
|
|
34
|
-
validateJsonSchema: () => validateJsonSchema
|
|
34
|
+
validateJsonSchema: () => validateJsonSchema,
|
|
35
|
+
vectorSimilarity: () => vectorSimilarity
|
|
35
36
|
});
|
|
36
37
|
var MODEL_PRICING = [
|
|
37
38
|
{ model: "gpt-4o", label: "GPT-4o", inputPer1M: 5, outputPer1M: 15 },
|
|
@@ -949,5 +950,34 @@ function summarizeForLlm(text, maxTokens = 200, strategy = "extractive") {
|
|
|
949
950
|
const st = tok(summary);
|
|
950
951
|
return { summary, originalTokens: ot, summaryTokens: st, compressionRatio: Math.round(st / Math.max(1, ot) * 100) / 100, sentencesKept: picked.length, sentencesTotal: sents.length };
|
|
951
952
|
}
|
|
953
|
+
function vectorSimilarity(a, b) {
|
|
954
|
+
if (!Array.isArray(a) || !Array.isArray(b)) return { error: "Both inputs must be arrays of numbers" };
|
|
955
|
+
if (a.length === 0 || b.length === 0) return { error: "Vectors must not be empty" };
|
|
956
|
+
if (a.length !== b.length) return { error: `Vectors must have the same length (got ${a.length} and ${b.length})` };
|
|
957
|
+
if (!a.every((n) => typeof n === "number" && Number.isFinite(n)) || !b.every((n) => typeof n === "number" && Number.isFinite(n))) {
|
|
958
|
+
return { error: "Vectors must contain only finite numbers" };
|
|
959
|
+
}
|
|
960
|
+
const round6 = (n) => Math.round(n * 1e6) / 1e6;
|
|
961
|
+
let dot = 0, sa = 0, sb = 0, sqDist = 0, absDist = 0;
|
|
962
|
+
for (let i = 0; i < a.length; i++) {
|
|
963
|
+
dot += a[i] * b[i];
|
|
964
|
+
sa += a[i] * a[i];
|
|
965
|
+
sb += b[i] * b[i];
|
|
966
|
+
const d = a[i] - b[i];
|
|
967
|
+
sqDist += d * d;
|
|
968
|
+
absDist += Math.abs(d);
|
|
969
|
+
}
|
|
970
|
+
const magA = Math.sqrt(sa), magB = Math.sqrt(sb);
|
|
971
|
+
const cosine = magA === 0 || magB === 0 ? 0 : dot / (magA * magB);
|
|
972
|
+
return {
|
|
973
|
+
dimensions: a.length,
|
|
974
|
+
dotProduct: round6(dot),
|
|
975
|
+
cosineSimilarity: round6(cosine),
|
|
976
|
+
euclideanDistance: round6(Math.sqrt(sqDist)),
|
|
977
|
+
manhattanDistance: round6(absDist),
|
|
978
|
+
magnitudeA: round6(magA),
|
|
979
|
+
magnitudeB: round6(magB)
|
|
980
|
+
};
|
|
981
|
+
}
|
|
952
982
|
|
|
953
|
-
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 };
|
|
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 };
|
|
@@ -26,6 +26,7 @@ __export(network_exports, {
|
|
|
26
26
|
parseDnsResponse: () => parseDnsResponse,
|
|
27
27
|
parseGeoResponse: () => parseGeoResponse,
|
|
28
28
|
parseHar: () => parseHar,
|
|
29
|
+
parseUserAgent: () => parseUserAgent,
|
|
29
30
|
searchHeaders: () => searchHeaders,
|
|
30
31
|
searchStatusCodes: () => searchStatusCodes,
|
|
31
32
|
statusCodeToText: () => statusCodeToText,
|
|
@@ -1615,5 +1616,110 @@ function validateRobotsTxt(text) {
|
|
|
1615
1616
|
const valid = !issues.some((i) => i.severity === "error");
|
|
1616
1617
|
return { groups, sitemaps, issues, valid };
|
|
1617
1618
|
}
|
|
1619
|
+
var UA_BOT_PATTERNS = [
|
|
1620
|
+
[/googlebot/i, "Googlebot"],
|
|
1621
|
+
[/bingbot/i, "Bingbot"],
|
|
1622
|
+
[/slurp/i, "Slurp"],
|
|
1623
|
+
[/duckduckbot/i, "DuckDuckBot"],
|
|
1624
|
+
[/baiduspider/i, "Baiduspider"],
|
|
1625
|
+
[/yandexbot/i, "YandexBot"],
|
|
1626
|
+
[/facebookexternalhit/i, "Facebot"],
|
|
1627
|
+
[/twitterbot/i, "Twitterbot"],
|
|
1628
|
+
[/applebot/i, "Applebot"],
|
|
1629
|
+
[/discordbot/i, "Discordbot"],
|
|
1630
|
+
[/slackbot/i, "Slackbot"],
|
|
1631
|
+
[/telegrambot/i, "TelegramBot"],
|
|
1632
|
+
[/whatsapp/i, "WhatsApp"],
|
|
1633
|
+
[/ahrefsbot/i, "AhrefsBot"],
|
|
1634
|
+
[/semrushbot/i, "SemrushBot"],
|
|
1635
|
+
[/crawler|spider|\bbot\b/i, "Bot"]
|
|
1636
|
+
];
|
|
1637
|
+
function _detectUaBrowser(s) {
|
|
1638
|
+
let m;
|
|
1639
|
+
if (m = s.match(/Edg(?:A|iOS)?\/([\d.]+)/)) return { name: "Edge", version: m[1] };
|
|
1640
|
+
if (m = s.match(/Edge\/([\d.]+)/)) return { name: "Edge (Legacy)", version: m[1] };
|
|
1641
|
+
if (m = s.match(/OPR\/([\d.]+)/)) return { name: "Opera", version: m[1] };
|
|
1642
|
+
if (m = s.match(/Opera\/([\d.]+)/)) return { name: "Opera", version: m[1] };
|
|
1643
|
+
if (m = s.match(/SamsungBrowser\/([\d.]+)/)) return { name: "Samsung Internet", version: m[1] };
|
|
1644
|
+
if (m = s.match(/FxiOS\/([\d.]+)/)) return { name: "Firefox", version: m[1] };
|
|
1645
|
+
if (m = s.match(/Firefox\/([\d.]+)/)) return { name: "Firefox", version: m[1] };
|
|
1646
|
+
if (m = s.match(/CriOS\/([\d.]+)/)) return { name: "Chrome", version: m[1] };
|
|
1647
|
+
if (m = s.match(/Chrome\/([\d.]+)/)) return { name: "Chrome", version: m[1] };
|
|
1648
|
+
if (m = s.match(/Version\/([\d.]+).*Safari\//)) return { name: "Safari", version: m[1] };
|
|
1649
|
+
if (/Safari\//.test(s)) return { name: "Safari", version: "" };
|
|
1650
|
+
if (m = s.match(/MSIE ([\d.]+)/)) return { name: "Internet Explorer", version: m[1] };
|
|
1651
|
+
if (m = s.match(/Trident\/.*rv:([\d.]+)/)) return { name: "Internet Explorer", version: m[1] };
|
|
1652
|
+
return { name: "Unknown", version: "" };
|
|
1653
|
+
}
|
|
1654
|
+
function _detectUaEngine(s, browserName) {
|
|
1655
|
+
let m;
|
|
1656
|
+
if (/Chrome\/|CriOS\/|Edg\/|OPR\/|SamsungBrowser\//.test(s)) {
|
|
1657
|
+
m = s.match(/Chrome\/([\d.]+)/) || s.match(/CriOS\/([\d.]+)/);
|
|
1658
|
+
return { name: "Blink", version: m ? m[1] : "" };
|
|
1659
|
+
}
|
|
1660
|
+
if (/Firefox\/|FxiOS\//.test(s)) {
|
|
1661
|
+
m = s.match(/rv:([\d.]+)/);
|
|
1662
|
+
return { name: "Gecko", version: m ? m[1] : "" };
|
|
1663
|
+
}
|
|
1664
|
+
if (m = s.match(/AppleWebKit\/([\d.]+)/)) return { name: "WebKit", version: m[1] };
|
|
1665
|
+
if (m = s.match(/Trident\/([\d.]+)/)) return { name: "Trident", version: m[1] };
|
|
1666
|
+
if (browserName === "Edge (Legacy)") return { name: "EdgeHTML", version: "" };
|
|
1667
|
+
return { name: "Unknown", version: "" };
|
|
1668
|
+
}
|
|
1669
|
+
var UA_WINDOWS_VERSIONS = {
|
|
1670
|
+
"10.0": "10",
|
|
1671
|
+
"6.3": "8.1",
|
|
1672
|
+
"6.2": "8",
|
|
1673
|
+
"6.1": "7",
|
|
1674
|
+
"6.0": "Vista",
|
|
1675
|
+
"5.1": "XP"
|
|
1676
|
+
};
|
|
1677
|
+
function _detectUaOs(s) {
|
|
1678
|
+
if (/Windows NT/.test(s)) return "Windows";
|
|
1679
|
+
if (/CrOS/.test(s)) return "ChromeOS";
|
|
1680
|
+
if (/Android/.test(s)) return "Android";
|
|
1681
|
+
if (/iPhone|iPad|iPod/.test(s)) return "iOS";
|
|
1682
|
+
if (/Mac OS X/.test(s)) return "macOS";
|
|
1683
|
+
if (/Linux/.test(s)) return "Linux";
|
|
1684
|
+
return "Unknown";
|
|
1685
|
+
}
|
|
1686
|
+
function _detectUaOsVersion(s) {
|
|
1687
|
+
let m;
|
|
1688
|
+
if (m = s.match(/Windows NT ([\d.]+)/)) return UA_WINDOWS_VERSIONS[m[1]] ?? m[1];
|
|
1689
|
+
if (/CrOS/.test(s) && (m = s.match(/CrOS \S+ ([\d.]+)/))) return m[1];
|
|
1690
|
+
if (m = s.match(/Android ([\d.]+)/)) return m[1];
|
|
1691
|
+
if (m = s.match(/(?:iPhone|CPU) OS ([\d_]+)/)) return m[1].replace(/_/g, ".");
|
|
1692
|
+
if (m = s.match(/Mac OS X ([\d_]+)/)) return m[1].replace(/_/g, ".");
|
|
1693
|
+
return "";
|
|
1694
|
+
}
|
|
1695
|
+
function _detectUaDeviceType(s) {
|
|
1696
|
+
if (/iPad/.test(s)) return "tablet";
|
|
1697
|
+
if (/Android/.test(s) && !/Mobile/.test(s)) return "tablet";
|
|
1698
|
+
if (/Mobile|iPhone|iPod|Android/.test(s)) return "mobile";
|
|
1699
|
+
return "desktop";
|
|
1700
|
+
}
|
|
1701
|
+
function parseUserAgent(ua) {
|
|
1702
|
+
if (!ua || typeof ua !== "string" || ua.trim() === "") {
|
|
1703
|
+
return { error: "Empty user-agent string" };
|
|
1704
|
+
}
|
|
1705
|
+
const s = ua.trim();
|
|
1706
|
+
for (const [re, name] of UA_BOT_PATTERNS) {
|
|
1707
|
+
if (re.test(s)) {
|
|
1708
|
+
const versionMatch = s.match(new RegExp(`${name.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")}\\/([\\d.]+)`, "i"));
|
|
1709
|
+
return {
|
|
1710
|
+
browser: { name, version: versionMatch ? versionMatch[1] : "" },
|
|
1711
|
+
engine: { name: "Unknown", version: "" },
|
|
1712
|
+
os: { name: _detectUaOs(s), version: _detectUaOsVersion(s) },
|
|
1713
|
+
device: { type: "bot" },
|
|
1714
|
+
raw: s
|
|
1715
|
+
};
|
|
1716
|
+
}
|
|
1717
|
+
}
|
|
1718
|
+
const browser = _detectUaBrowser(s);
|
|
1719
|
+
const engine = _detectUaEngine(s, browser.name);
|
|
1720
|
+
const os = { name: _detectUaOs(s), version: _detectUaOsVersion(s) };
|
|
1721
|
+
const device = { type: _detectUaDeviceType(s) };
|
|
1722
|
+
return { browser, engine, os, device, raw: s };
|
|
1723
|
+
}
|
|
1618
1724
|
|
|
1619
|
-
export { DNS_RECORD_TYPES, HTTP_HEADERS, STATUS_CODES, buildDnsQueryUrl, buildGeoUrl, buildMapUrl, countryCodeToFlag, formatCoordinates, formatTtl, getByCategory, getHeader, getHeadersByCategory, getStatusByCategory, getStatusCode, isClientError, isServerError, isSuccess, isValidIp, isValidIpv4, isValidIpv6, network_exports, parseDnsResponse, parseGeoResponse, parseHar, searchHeaders, searchStatusCodes, statusCodeToText, typeNumberToLabel, validateDomain, validateHeaderName, validateHeaderValue, validateRobotsTxt, validateSitemap };
|
|
1725
|
+
export { DNS_RECORD_TYPES, HTTP_HEADERS, STATUS_CODES, buildDnsQueryUrl, buildGeoUrl, buildMapUrl, countryCodeToFlag, formatCoordinates, formatTtl, getByCategory, getHeader, getHeadersByCategory, getStatusByCategory, getStatusCode, isClientError, isServerError, isSuccess, isValidIp, isValidIpv4, isValidIpv6, network_exports, parseDnsResponse, parseGeoResponse, parseHar, parseUserAgent, searchHeaders, searchStatusCodes, statusCodeToText, typeNumberToLabel, validateDomain, validateHeaderName, validateHeaderValue, validateRobotsTxt, validateSitemap };
|
|
@@ -39,6 +39,7 @@ __export(code_exports, {
|
|
|
39
39
|
parseDockerImage: () => parseDockerImage,
|
|
40
40
|
parseEnv: () => parseEnv,
|
|
41
41
|
parseGitCommand: () => parseGitCommand,
|
|
42
|
+
parseGithubUrl: () => parseGithubUrl,
|
|
42
43
|
parseSpec: () => parseSpec,
|
|
43
44
|
removeConsoleCalls: () => removeConsoleCalls,
|
|
44
45
|
removeEmptyAttributes: () => removeEmptyAttributes,
|
|
@@ -2412,5 +2413,67 @@ function lookupMime(query) {
|
|
|
2412
2413
|
if (matches.length === 0) return { error: `No known MIME type for extension ".${ext}"` };
|
|
2413
2414
|
return { query: trimmed, kind: "extension", matches };
|
|
2414
2415
|
}
|
|
2416
|
+
function _parseGithubLineRange(hash) {
|
|
2417
|
+
const m = hash.match(/^#?L(\d+)(?:-L?(\d+))?$/i);
|
|
2418
|
+
if (!m) return {};
|
|
2419
|
+
const startLine = parseInt(m[1], 10);
|
|
2420
|
+
const endLine = m[2] ? parseInt(m[2], 10) : void 0;
|
|
2421
|
+
return endLine !== void 0 ? { startLine, endLine } : { startLine };
|
|
2422
|
+
}
|
|
2423
|
+
function parseGithubUrl(input) {
|
|
2424
|
+
if (!input || typeof input !== "string" || input.trim() === "") {
|
|
2425
|
+
return { error: "Empty URL" };
|
|
2426
|
+
}
|
|
2427
|
+
const trimmed = input.trim();
|
|
2428
|
+
const normalized = /^https?:\/\//i.test(trimmed) ? trimmed : `https://${trimmed}`;
|
|
2429
|
+
let url;
|
|
2430
|
+
try {
|
|
2431
|
+
url = new URL(normalized);
|
|
2432
|
+
} catch {
|
|
2433
|
+
return { error: "Invalid URL" };
|
|
2434
|
+
}
|
|
2435
|
+
if (!/^(www\.)?github\.com$/i.test(url.hostname)) {
|
|
2436
|
+
return { error: `Not a github.com URL (got host "${url.hostname}")` };
|
|
2437
|
+
}
|
|
2438
|
+
const segments = url.pathname.split("/").filter(Boolean);
|
|
2439
|
+
if (segments.length < 2) {
|
|
2440
|
+
return { error: "URL must include an owner and a repository" };
|
|
2441
|
+
}
|
|
2442
|
+
const [owner, repo, ...rest] = segments;
|
|
2443
|
+
if (rest.length === 0) {
|
|
2444
|
+
return { owner, repo, type: "repo" };
|
|
2445
|
+
}
|
|
2446
|
+
const kind = rest[0];
|
|
2447
|
+
if (kind === "pull" || kind === "issues") {
|
|
2448
|
+
const number = parseInt(rest[1], 10);
|
|
2449
|
+
if (!rest[1] || Number.isNaN(number)) {
|
|
2450
|
+
return { error: `Missing ${kind === "pull" ? "pull request" : "issue"} number` };
|
|
2451
|
+
}
|
|
2452
|
+
return { owner, repo, type: kind === "pull" ? "pull" : "issue", number };
|
|
2453
|
+
}
|
|
2454
|
+
if (kind === "commit") {
|
|
2455
|
+
if (!rest[1]) return { error: "Missing commit SHA" };
|
|
2456
|
+
return { owner, repo, type: "commit", ref: rest[1] };
|
|
2457
|
+
}
|
|
2458
|
+
if (kind === "blob") {
|
|
2459
|
+
const ref = rest[1];
|
|
2460
|
+
const path = rest.slice(2).join("/");
|
|
2461
|
+
if (!ref || !path) return { error: "File URL must include a ref and a file path (/blob/<ref>/<path>)" };
|
|
2462
|
+
return { owner, repo, type: "file", ref, path, ..._parseGithubLineRange(url.hash) };
|
|
2463
|
+
}
|
|
2464
|
+
if (kind === "tree") {
|
|
2465
|
+
const ref = rest[1];
|
|
2466
|
+
if (!ref) return { error: "Missing branch or tag ref (/tree/<ref>)" };
|
|
2467
|
+
const path = rest.slice(2).join("/");
|
|
2468
|
+
return { owner, repo, type: "tree", ref, ...path ? { path } : {} };
|
|
2469
|
+
}
|
|
2470
|
+
if (kind === "releases") {
|
|
2471
|
+
if (rest[1] !== "tag" || !rest[2]) {
|
|
2472
|
+
return { error: "Unsupported releases URL (expected /releases/tag/<name>)" };
|
|
2473
|
+
}
|
|
2474
|
+
return { owner, repo, type: "release", ref: rest[2] };
|
|
2475
|
+
}
|
|
2476
|
+
return { error: `Unsupported GitHub URL path: /${rest.join("/")}` };
|
|
2477
|
+
}
|
|
2415
2478
|
|
|
2416
|
-
export { ALL_FLAGS, CHEATSHEET, MIME_TABLE, OPERATIONS, SQL_DEFAULT_OPTIONS, buildDockerPull, buildDockerRun, buildGitCommand, code_exports, collapseHtmlWhitespace, collapseJsWhitespace, countProperties, countRules, detectDialect, detectOperationType, envToExport, envToJson, formatCss, formatGql, formatHtml, formatSql, getEndpointsByTag, getHtmlStats, getJsStats, getMethodColor, isValidTag, lookupMime, minifyCss, minifyGql, minifyHtml, minifyJs, minifySql, normalizeRef, parseDockerImage, parseEnv, parseGitCommand, parseSpec, removeConsoleCalls, removeEmptyAttributes, removeHtmlComments, removeJsComments, removeRedundantAttributes, searchCheatsheet, searchEndpoints, splitStatements, testPattern, testRegex, validateEnvKey };
|
|
2479
|
+
export { ALL_FLAGS, CHEATSHEET, MIME_TABLE, OPERATIONS, SQL_DEFAULT_OPTIONS, buildDockerPull, buildDockerRun, buildGitCommand, code_exports, collapseHtmlWhitespace, collapseJsWhitespace, countProperties, countRules, detectDialect, detectOperationType, envToExport, envToJson, formatCss, formatGql, formatHtml, formatSql, getEndpointsByTag, getHtmlStats, getJsStats, getMethodColor, isValidTag, lookupMime, minifyCss, minifyGql, minifyHtml, minifyJs, minifySql, normalizeRef, parseDockerImage, parseEnv, parseGitCommand, parseGithubUrl, parseSpec, removeConsoleCalls, removeEmptyAttributes, removeHtmlComments, removeJsComments, removeRedundantAttributes, searchCheatsheet, searchEndpoints, splitStatements, testPattern, testRegex, validateEnvKey };
|
|
@@ -22,6 +22,7 @@ __export(units_exports, {
|
|
|
22
22
|
calculateLoan: () => calculateLoan,
|
|
23
23
|
calculateSimpleInterest: () => calculateSimpleInterest,
|
|
24
24
|
calculateTax: () => calculateTax,
|
|
25
|
+
calculateTimeValue: () => calculateTimeValue,
|
|
25
26
|
calculateTipSplit: () => calculateTipSplit,
|
|
26
27
|
compareSemver: () => compareSemver,
|
|
27
28
|
convert: () => convert,
|
|
@@ -1297,5 +1298,44 @@ function calculateSimpleInterest(principal, annualRatePercent, years) {
|
|
|
1297
1298
|
totalPayoff: round22(principal + interest)
|
|
1298
1299
|
};
|
|
1299
1300
|
}
|
|
1301
|
+
function calculateTimeValue(amount, annualRatePercent, years, direction, compoundsPerYear = 1) {
|
|
1302
|
+
if (!Number.isFinite(amount) || amount < 0) return { error: "Amount must be zero or a positive number" };
|
|
1303
|
+
if (!Number.isFinite(annualRatePercent) || annualRatePercent < 0) {
|
|
1304
|
+
return { error: "Annual interest rate must be zero or a positive number" };
|
|
1305
|
+
}
|
|
1306
|
+
if (!Number.isFinite(years) || years <= 0) return { error: "Years must be a positive number" };
|
|
1307
|
+
if (!Number.isInteger(compoundsPerYear) || compoundsPerYear <= 0) {
|
|
1308
|
+
return { error: "Compounding frequency must be a positive whole number of periods per year" };
|
|
1309
|
+
}
|
|
1310
|
+
if (direction !== "future" && direction !== "present") {
|
|
1311
|
+
return { error: 'Direction must be "future" or "present"' };
|
|
1312
|
+
}
|
|
1313
|
+
const round22 = (n) => Math.round(n * 100) / 100;
|
|
1314
|
+
const round6 = (n) => Math.round(n * 1e6) / 1e6;
|
|
1315
|
+
const ratePerPeriod = annualRatePercent / 100 / compoundsPerYear;
|
|
1316
|
+
const totalPeriods = years * compoundsPerYear;
|
|
1317
|
+
const growthFactor = Math.pow(1 + ratePerPeriod, totalPeriods);
|
|
1318
|
+
let presentValue;
|
|
1319
|
+
let futureValue;
|
|
1320
|
+
if (direction === "future") {
|
|
1321
|
+
presentValue = amount;
|
|
1322
|
+
futureValue = amount * growthFactor;
|
|
1323
|
+
} else {
|
|
1324
|
+
futureValue = amount;
|
|
1325
|
+
presentValue = amount / growthFactor;
|
|
1326
|
+
}
|
|
1327
|
+
return {
|
|
1328
|
+
direction,
|
|
1329
|
+
annualRatePercent,
|
|
1330
|
+
years,
|
|
1331
|
+
compoundsPerYear,
|
|
1332
|
+
totalPeriods,
|
|
1333
|
+
ratePerPeriodPercent: round6(ratePerPeriod * 100),
|
|
1334
|
+
growthFactor: round6(growthFactor),
|
|
1335
|
+
presentValue: round22(presentValue),
|
|
1336
|
+
futureValue: round22(futureValue),
|
|
1337
|
+
interest: round22(futureValue - presentValue)
|
|
1338
|
+
};
|
|
1339
|
+
}
|
|
1300
1340
|
|
|
1301
|
-
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, autoFormat, bumpVersion, calcAspectRatio, calcSubnet, calculateCompoundInterest, calculateLoan, calculateSimpleInterest, calculateTax, calculateTipSplit, compareSemver, convert, convertBytes, convertIp, coverBox, decimalToIp, decimalToIpCidr, describePermissions, fitIntoBox, formatNumber, formatValue, formatVwValue, formatWithSeparator, gcd, ipFromBinary, ipFromDecimal, ipFromHex, ipToBinary, ipToDecimal, ipToDecimalCidr, ipToHex, ipToOctal, isValid, isValidCidr, isValidIp, isValidIpv4, octalToPermissions, parseFileSize, parseInput, parseNumberString, parseSemver, permissionsToChmod, permissionsToOctal, permissionsToSymbolic, ptToPx, pxToAll, pxToViewport, remToPx, satisfiesRange, scaleByHeight, scaleByWidth, sortVersions, splitSubnet, symbolicToPermissions, units_exports, validateBarcode, validateCardNumber, validateIban, validateIsbn, viewportToPx };
|
|
1341
|
+
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, autoFormat, bumpVersion, calcAspectRatio, calcSubnet, calculateCompoundInterest, calculateLoan, calculateSimpleInterest, calculateTax, calculateTimeValue, calculateTipSplit, compareSemver, convert, convertBytes, convertIp, coverBox, decimalToIp, decimalToIpCidr, describePermissions, fitIntoBox, formatNumber, formatValue, formatVwValue, formatWithSeparator, gcd, ipFromBinary, ipFromDecimal, ipFromHex, ipToBinary, ipToDecimal, ipToDecimalCidr, ipToHex, ipToOctal, isValid, isValidCidr, isValidIp, isValidIpv4, octalToPermissions, parseFileSize, parseInput, parseNumberString, parseSemver, permissionsToChmod, permissionsToOctal, permissionsToSymbolic, ptToPx, pxToAll, pxToViewport, remToPx, satisfiesRange, scaleByHeight, scaleByWidth, sortVersions, splitSubnet, symbolicToPermissions, units_exports, validateBarcode, validateCardNumber, validateIban, validateIsbn, viewportToPx };
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
* - env-parser (parseEnv, envToJson, envToExport, validateEnvKey)
|
|
19
19
|
* - css-minifier (minifyCss, formatCss, countRules, countProperties)
|
|
20
20
|
* - mime-lookup (lookupMime, MIME_TABLE)
|
|
21
|
+
* - github-url-parser (parseGithubUrl)
|
|
21
22
|
*/
|
|
22
23
|
type RegexFlag = 'g' | 'i' | 'm' | 's' | 'u';
|
|
23
24
|
declare const ALL_FLAGS: RegexFlag[];
|
|
@@ -285,6 +286,27 @@ declare const MIME_TABLE: MimeEntry[];
|
|
|
285
286
|
declare function lookupMime(query: string): MimeLookupResult | {
|
|
286
287
|
error: string;
|
|
287
288
|
};
|
|
289
|
+
type GithubUrlType = 'repo' | 'pull' | 'issue' | 'commit' | 'file' | 'tree' | 'release';
|
|
290
|
+
interface GithubUrlInfo {
|
|
291
|
+
owner: string;
|
|
292
|
+
repo: string;
|
|
293
|
+
type: GithubUrlType;
|
|
294
|
+
number?: number;
|
|
295
|
+
ref?: string;
|
|
296
|
+
path?: string;
|
|
297
|
+
startLine?: number;
|
|
298
|
+
endLine?: number;
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Parses a github.com URL (repo, pull request, issue, commit, or a
|
|
302
|
+
* file/tree with an optional line range) into structured components via
|
|
303
|
+
* the path segments GitHub's own routing uses. Only covers github.com URLs
|
|
304
|
+
* over HTTP(S): SSH remotes (git@github.com:owner/repo.git) and other Git
|
|
305
|
+
* hosts are out of scope.
|
|
306
|
+
*/
|
|
307
|
+
declare function parseGithubUrl(input: string): GithubUrlInfo | {
|
|
308
|
+
error: string;
|
|
309
|
+
};
|
|
288
310
|
|
|
289
311
|
declare const code_ALL_FLAGS: typeof ALL_FLAGS;
|
|
290
312
|
type code_ApiEndpoint = ApiEndpoint;
|
|
@@ -298,6 +320,8 @@ type code_EnvParseResult = EnvParseResult;
|
|
|
298
320
|
type code_GitCommandConfig = GitCommandConfig;
|
|
299
321
|
type code_GitCommandResult = GitCommandResult;
|
|
300
322
|
type code_GitOperation = GitOperation;
|
|
323
|
+
type code_GithubUrlInfo = GithubUrlInfo;
|
|
324
|
+
type code_GithubUrlType = GithubUrlType;
|
|
301
325
|
type code_GqlFormatResult = GqlFormatResult;
|
|
302
326
|
type code_HtmlFormatResult = HtmlFormatResult;
|
|
303
327
|
type code_HtmlMinifyOptions = HtmlMinifyOptions;
|
|
@@ -351,6 +375,7 @@ declare const code_normalizeRef: typeof normalizeRef;
|
|
|
351
375
|
declare const code_parseDockerImage: typeof parseDockerImage;
|
|
352
376
|
declare const code_parseEnv: typeof parseEnv;
|
|
353
377
|
declare const code_parseGitCommand: typeof parseGitCommand;
|
|
378
|
+
declare const code_parseGithubUrl: typeof parseGithubUrl;
|
|
354
379
|
declare const code_parseSpec: typeof parseSpec;
|
|
355
380
|
declare const code_removeConsoleCalls: typeof removeConsoleCalls;
|
|
356
381
|
declare const code_removeEmptyAttributes: typeof removeEmptyAttributes;
|
|
@@ -364,7 +389,7 @@ declare const code_testPattern: typeof testPattern;
|
|
|
364
389
|
declare const code_testRegex: typeof testRegex;
|
|
365
390
|
declare const code_validateEnvKey: typeof validateEnvKey;
|
|
366
391
|
declare namespace code {
|
|
367
|
-
export { code_ALL_FLAGS as ALL_FLAGS, type code_ApiEndpoint as ApiEndpoint, type code_ApiInfo as ApiInfo, code_CHEATSHEET as CHEATSHEET, type code_CheatsheetEntry as CheatsheetEntry, type code_CssResult as CssResult, type code_DockerImageRef as DockerImageRef, type code_EnvEntry as EnvEntry, type code_EnvParseResult as EnvParseResult, type code_GitCommandConfig as GitCommandConfig, type code_GitCommandResult as GitCommandResult, type code_GitOperation as GitOperation, type code_GqlFormatResult as GqlFormatResult, type code_HtmlFormatResult as HtmlFormatResult, type code_HtmlMinifyOptions as HtmlMinifyOptions, type code_HtmlMinifyResult as HtmlMinifyResult, type code_JsMinifyOptions as JsMinifyOptions, type code_JsMinifyResult as JsMinifyResult, code_MIME_TABLE as MIME_TABLE, type code_MatchResult as MatchResult, type code_MimeEntry as MimeEntry, type code_MimeLookupResult as MimeLookupResult, code_OPERATIONS as OPERATIONS, type code_ParsedSpec as ParsedSpec, type code_RegexError as RegexError, type code_RegexFlag as RegexFlag, type code_RegexMatch as RegexMatch, type code_RegexResult as RegexResult, type code_RegexSuccess as RegexSuccess, code_SQL_DEFAULT_OPTIONS as SQL_DEFAULT_OPTIONS, type code_Segment as Segment, type code_SpecVersion as SpecVersion, type code_SqlDialect as SqlDialect, type code_SqlFormatOptions as SqlFormatOptions, type code_TestPatternResult as TestPatternResult, code_buildDockerPull as buildDockerPull, code_buildDockerRun as buildDockerRun, code_buildGitCommand as buildGitCommand, code_collapseHtmlWhitespace as collapseHtmlWhitespace, code_collapseJsWhitespace as collapseJsWhitespace, code_countProperties as countProperties, code_countRules as countRules, code_detectDialect as detectDialect, code_detectOperationType as detectOperationType, code_envToExport as envToExport, code_envToJson as envToJson, code_formatCss as formatCss, code_formatGql as formatGql, code_formatHtml as formatHtml, code_formatSql as formatSql, code_getEndpointsByTag as getEndpointsByTag, code_getHtmlStats as getHtmlStats, code_getJsStats as getJsStats, code_getMethodColor as getMethodColor, code_isValidTag as isValidTag, code_lookupMime as lookupMime, code_minifyCss as minifyCss, code_minifyGql as minifyGql, code_minifyHtml as minifyHtml, code_minifyJs as minifyJs, code_minifySql as minifySql, code_normalizeRef as normalizeRef, code_parseDockerImage as parseDockerImage, code_parseEnv as parseEnv, code_parseGitCommand as parseGitCommand, code_parseSpec as parseSpec, code_removeConsoleCalls as removeConsoleCalls, code_removeEmptyAttributes as removeEmptyAttributes, code_removeHtmlComments as removeHtmlComments, code_removeJsComments as removeJsComments, code_removeRedundantAttributes as removeRedundantAttributes, code_searchCheatsheet as searchCheatsheet, code_searchEndpoints as searchEndpoints, code_splitStatements as splitStatements, code_testPattern as testPattern, code_testRegex as testRegex, code_validateEnvKey as validateEnvKey };
|
|
392
|
+
export { code_ALL_FLAGS as ALL_FLAGS, type code_ApiEndpoint as ApiEndpoint, type code_ApiInfo as ApiInfo, code_CHEATSHEET as CHEATSHEET, type code_CheatsheetEntry as CheatsheetEntry, type code_CssResult as CssResult, type code_DockerImageRef as DockerImageRef, type code_EnvEntry as EnvEntry, type code_EnvParseResult as EnvParseResult, type code_GitCommandConfig as GitCommandConfig, type code_GitCommandResult as GitCommandResult, type code_GitOperation as GitOperation, type code_GithubUrlInfo as GithubUrlInfo, type code_GithubUrlType as GithubUrlType, type code_GqlFormatResult as GqlFormatResult, type code_HtmlFormatResult as HtmlFormatResult, type code_HtmlMinifyOptions as HtmlMinifyOptions, type code_HtmlMinifyResult as HtmlMinifyResult, type code_JsMinifyOptions as JsMinifyOptions, type code_JsMinifyResult as JsMinifyResult, code_MIME_TABLE as MIME_TABLE, type code_MatchResult as MatchResult, type code_MimeEntry as MimeEntry, type code_MimeLookupResult as MimeLookupResult, code_OPERATIONS as OPERATIONS, type code_ParsedSpec as ParsedSpec, type code_RegexError as RegexError, type code_RegexFlag as RegexFlag, type code_RegexMatch as RegexMatch, type code_RegexResult as RegexResult, type code_RegexSuccess as RegexSuccess, code_SQL_DEFAULT_OPTIONS as SQL_DEFAULT_OPTIONS, type code_Segment as Segment, type code_SpecVersion as SpecVersion, type code_SqlDialect as SqlDialect, type code_SqlFormatOptions as SqlFormatOptions, type code_TestPatternResult as TestPatternResult, code_buildDockerPull as buildDockerPull, code_buildDockerRun as buildDockerRun, code_buildGitCommand as buildGitCommand, code_collapseHtmlWhitespace as collapseHtmlWhitespace, code_collapseJsWhitespace as collapseJsWhitespace, code_countProperties as countProperties, code_countRules as countRules, code_detectDialect as detectDialect, code_detectOperationType as detectOperationType, code_envToExport as envToExport, code_envToJson as envToJson, code_formatCss as formatCss, code_formatGql as formatGql, code_formatHtml as formatHtml, code_formatSql as formatSql, code_getEndpointsByTag as getEndpointsByTag, code_getHtmlStats as getHtmlStats, code_getJsStats as getJsStats, code_getMethodColor as getMethodColor, code_isValidTag as isValidTag, code_lookupMime as lookupMime, code_minifyCss as minifyCss, code_minifyGql as minifyGql, code_minifyHtml as minifyHtml, code_minifyJs as minifyJs, code_minifySql as minifySql, code_normalizeRef as normalizeRef, code_parseDockerImage as parseDockerImage, code_parseEnv as parseEnv, code_parseGitCommand as parseGitCommand, code_parseGithubUrl as parseGithubUrl, code_parseSpec as parseSpec, code_removeConsoleCalls as removeConsoleCalls, code_removeEmptyAttributes as removeEmptyAttributes, code_removeHtmlComments as removeHtmlComments, code_removeJsComments as removeJsComments, code_removeRedundantAttributes as removeRedundantAttributes, code_searchCheatsheet as searchCheatsheet, code_searchEndpoints as searchEndpoints, code_splitStatements as splitStatements, code_testPattern as testPattern, code_testRegex as testRegex, code_validateEnvKey as validateEnvKey };
|
|
368
393
|
}
|
|
369
394
|
|
|
370
|
-
export {
|
|
395
|
+
export { getEndpointsByTag as $, ALL_FLAGS as A, buildDockerRun as B, CHEATSHEET as C, type DockerImageRef as D, type EnvEntry as E, buildGitCommand as F, type GitCommandConfig as G, type HtmlFormatResult as H, collapseHtmlWhitespace as I, type JsMinifyOptions as J, collapseJsWhitespace as K, countProperties as L, MIME_TABLE as M, countRules as N, OPERATIONS as O, type ParsedSpec as P, detectDialect as Q, type RegexError as R, SQL_DEFAULT_OPTIONS as S, type TestPatternResult as T, detectOperationType as U, envToExport as V, envToJson as W, formatCss as X, formatGql as Y, formatHtml as Z, formatSql as _, type ApiEndpoint as a, getHtmlStats as a0, getJsStats as a1, getMethodColor as a2, isValidTag as a3, lookupMime as a4, minifyCss as a5, minifyGql as a6, minifyHtml as a7, minifyJs as a8, minifySql as a9, normalizeRef as aa, parseDockerImage as ab, parseEnv as ac, parseGitCommand as ad, parseGithubUrl as ae, parseSpec as af, removeConsoleCalls as ag, removeEmptyAttributes as ah, removeHtmlComments as ai, removeJsComments as aj, removeRedundantAttributes as ak, searchCheatsheet as al, searchEndpoints as am, splitStatements as an, testPattern as ao, testRegex as ap, validateEnvKey as aq, type ApiInfo as b, code as c, type CheatsheetEntry as d, type CssResult as e, type EnvParseResult as f, type GitCommandResult as g, type GitOperation as h, type GithubUrlInfo as i, type GithubUrlType as j, type GqlFormatResult as k, type HtmlMinifyOptions as l, type HtmlMinifyResult as m, type JsMinifyResult as n, type MatchResult as o, type MimeEntry as p, type MimeLookupResult as q, type RegexFlag as r, type RegexMatch as s, type RegexResult as t, type RegexSuccess as u, type Segment as v, type SpecVersion as w, type SqlDialect as x, type SqlFormatOptions as y, buildDockerPull as z };
|