@utilix-tech/sdk 0.94.0 → 0.96.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 +23 -3
- package/dist/{chunk-XAPHAUPI.js → chunk-4EFSPTRH.js} +106 -1
- package/dist/{chunk-PEMPPDMM.js → chunk-NTHUTIZH.js} +86 -1
- package/dist/{chunk-ZWFZRDQ4.js → chunk-YSS4VVZU.js} +112 -1
- package/dist/{data-3qMdFIF5.d.ts → data-Dg5dEwWl.d.cts} +37 -2
- package/dist/{data-3qMdFIF5.d.cts → data-Dg5dEwWl.d.ts} +37 -2
- package/dist/index.cjs +301 -0
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/{media-DF8BS-iA.d.cts → media-C8Y67lUI.d.cts} +62 -2
- package/dist/{media-DF8BS-iA.d.ts → media-C8Y67lUI.d.ts} +62 -2
- package/dist/tools/data.cjs +85 -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/media.cjs +111 -0
- package/dist/tools/media.d.cts +1 -1
- package/dist/tools/media.d.ts +1 -1
- package/dist/tools/media.js +1 -1
- package/dist/tools/units.cjs +105 -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-DnWrOTSV.d.ts → units-CG7wn_qJ.d.cts} +82 -2
- package/dist/{units-DnWrOTSV.d.cts → units-CG7wn_qJ.d.ts} +82 -2
- package/package.json +2 -2
|
@@ -289,6 +289,59 @@ interface MidiInfoError {
|
|
|
289
289
|
* frames-per-second/ticks-per-frame rate instead.
|
|
290
290
|
*/
|
|
291
291
|
declare function readMidiInfo(bytes: Uint8Array): MidiInfo | MidiInfoError;
|
|
292
|
+
interface PngChunkEntry {
|
|
293
|
+
type: string;
|
|
294
|
+
offset: number;
|
|
295
|
+
dataLength: number;
|
|
296
|
+
crcValid: boolean;
|
|
297
|
+
/** A chunk type is "critical" (decoders must understand it) when its
|
|
298
|
+
* first letter is uppercase, e.g. IHDR vs. an ancillary tEXt. */
|
|
299
|
+
critical: boolean;
|
|
300
|
+
}
|
|
301
|
+
interface PngHeaderInfo {
|
|
302
|
+
width: number;
|
|
303
|
+
height: number;
|
|
304
|
+
bitDepth: number;
|
|
305
|
+
colorType: string;
|
|
306
|
+
hasAlpha: boolean;
|
|
307
|
+
interlace: boolean;
|
|
308
|
+
}
|
|
309
|
+
interface PngTextChunk {
|
|
310
|
+
keyword: string;
|
|
311
|
+
text: string | null;
|
|
312
|
+
/** True for zTXt/iTXt, whose text this function does not decode. */
|
|
313
|
+
compressed: boolean;
|
|
314
|
+
}
|
|
315
|
+
interface PngPhysicalDimensions {
|
|
316
|
+
pixelsPerUnitX: number;
|
|
317
|
+
pixelsPerUnitY: number;
|
|
318
|
+
unit: 'meter' | 'unknown';
|
|
319
|
+
}
|
|
320
|
+
interface PngChunkInfo {
|
|
321
|
+
valid: true;
|
|
322
|
+
fileSize: number;
|
|
323
|
+
chunkCount: number;
|
|
324
|
+
chunks: PngChunkEntry[];
|
|
325
|
+
header: PngHeaderInfo | null;
|
|
326
|
+
textChunks: PngTextChunk[];
|
|
327
|
+
physicalDimensions: PngPhysicalDimensions | null;
|
|
328
|
+
gamma: number | null;
|
|
329
|
+
lastModified: string | null;
|
|
330
|
+
isAnimated: boolean;
|
|
331
|
+
}
|
|
332
|
+
interface PngChunkInfoError {
|
|
333
|
+
error: string;
|
|
334
|
+
}
|
|
335
|
+
/**
|
|
336
|
+
* Walk a PNG file's full chunk stream directly from its bytes: every
|
|
337
|
+
* chunk's type, byte offset, data length, and whether its stored CRC-32
|
|
338
|
+
* matches the type+data it covers, plus the decoded IHDR header and a
|
|
339
|
+
* handful of common ancillary chunks (tEXt, pHYs, gAMA, tIME, and acTL for
|
|
340
|
+
* APNG animation). No image library or pixel decoding is involved, and
|
|
341
|
+
* zTXt/iTXt text is listed but not zlib-inflated, so the result is
|
|
342
|
+
* identical in a browser tool and on a server.
|
|
343
|
+
*/
|
|
344
|
+
declare function readPngChunks(bytes: Uint8Array): PngChunkInfo | PngChunkInfoError;
|
|
292
345
|
|
|
293
346
|
type media_ExifData = ExifData;
|
|
294
347
|
type media_ExifError = ExifError;
|
|
@@ -318,6 +371,12 @@ type media_PdfOutlineResult = PdfOutlineResult;
|
|
|
318
371
|
type media_PdfPageDimension = PdfPageDimension;
|
|
319
372
|
type media_PdfPageDimensionsResult = PdfPageDimensionsResult;
|
|
320
373
|
type media_PdfPageOrientation = PdfPageOrientation;
|
|
374
|
+
type media_PngChunkEntry = PngChunkEntry;
|
|
375
|
+
type media_PngChunkInfo = PngChunkInfo;
|
|
376
|
+
type media_PngChunkInfoError = PngChunkInfoError;
|
|
377
|
+
type media_PngHeaderInfo = PngHeaderInfo;
|
|
378
|
+
type media_PngPhysicalDimensions = PngPhysicalDimensions;
|
|
379
|
+
type media_PngTextChunk = PngTextChunk;
|
|
321
380
|
type media_VideoInfo = VideoInfo;
|
|
322
381
|
type media_VideoInfoError = VideoInfoError;
|
|
323
382
|
type media_WavInfo = WavInfo;
|
|
@@ -332,10 +391,11 @@ declare const media_readMidiInfo: typeof readMidiInfo;
|
|
|
332
391
|
declare const media_readPdfMetadata: typeof readPdfMetadata;
|
|
333
392
|
declare const media_readPdfOutline: typeof readPdfOutline;
|
|
334
393
|
declare const media_readPdfPageDimensions: typeof readPdfPageDimensions;
|
|
394
|
+
declare const media_readPngChunks: typeof readPngChunks;
|
|
335
395
|
declare const media_readVideoInfo: typeof readVideoInfo;
|
|
336
396
|
declare const media_readWavInfo: typeof readWavInfo;
|
|
337
397
|
declare namespace media {
|
|
338
|
-
export { type media_ExifData as ExifData, type media_ExifError as ExifError, type media_FlacInfo as FlacInfo, type media_FlacInfoError as FlacInfoError, type media_GifInfo as GifInfo, type media_GifInfoError as GifInfoError, type media_IcoImageEntry as IcoImageEntry, type media_IcoInfo as IcoInfo, type media_IcoInfoError as IcoInfoError, type media_Id3Tags as Id3Tags, type media_Id3TagsError as Id3TagsError, type media_ImageFormat as ImageFormat, type media_ImageInfo as ImageInfo, type media_ImageInfoError as ImageInfoError, type media_MidiDivision as MidiDivision, type media_MidiInfo as MidiInfo, type media_MidiInfoError as MidiInfoError, type media_MidiTimeSignature as MidiTimeSignature, type media_MidiTrackInfo as MidiTrackInfo, type media_PdfMetadata as PdfMetadata, type media_PdfMetadataError as PdfMetadataError, type media_PdfOutlineDestType as PdfOutlineDestType, type media_PdfOutlineError as PdfOutlineError, type media_PdfOutlineItem as PdfOutlineItem, type media_PdfOutlineResult as PdfOutlineResult, type media_PdfPageDimension as PdfPageDimension, type media_PdfPageDimensionsResult as PdfPageDimensionsResult, type media_PdfPageOrientation as PdfPageOrientation, type media_VideoInfo as VideoInfo, type media_VideoInfoError as VideoInfoError, type media_WavInfo as WavInfo, type media_WavInfoError as WavInfoError, media_inspectGifFrames as inspectGifFrames, media_readExifData as readExifData, media_readFlacInfo as readFlacInfo, media_readIcoInfo as readIcoInfo, media_readId3Tags as readId3Tags, media_readImageInfo as readImageInfo, media_readMidiInfo as readMidiInfo, media_readPdfMetadata as readPdfMetadata, media_readPdfOutline as readPdfOutline, media_readPdfPageDimensions as readPdfPageDimensions, media_readVideoInfo as readVideoInfo, media_readWavInfo as readWavInfo };
|
|
398
|
+
export { type media_ExifData as ExifData, type media_ExifError as ExifError, type media_FlacInfo as FlacInfo, type media_FlacInfoError as FlacInfoError, type media_GifInfo as GifInfo, type media_GifInfoError as GifInfoError, type media_IcoImageEntry as IcoImageEntry, type media_IcoInfo as IcoInfo, type media_IcoInfoError as IcoInfoError, type media_Id3Tags as Id3Tags, type media_Id3TagsError as Id3TagsError, type media_ImageFormat as ImageFormat, type media_ImageInfo as ImageInfo, type media_ImageInfoError as ImageInfoError, type media_MidiDivision as MidiDivision, type media_MidiInfo as MidiInfo, type media_MidiInfoError as MidiInfoError, type media_MidiTimeSignature as MidiTimeSignature, type media_MidiTrackInfo as MidiTrackInfo, type media_PdfMetadata as PdfMetadata, type media_PdfMetadataError as PdfMetadataError, type media_PdfOutlineDestType as PdfOutlineDestType, type media_PdfOutlineError as PdfOutlineError, type media_PdfOutlineItem as PdfOutlineItem, type media_PdfOutlineResult as PdfOutlineResult, type media_PdfPageDimension as PdfPageDimension, type media_PdfPageDimensionsResult as PdfPageDimensionsResult, type media_PdfPageOrientation as PdfPageOrientation, type media_PngChunkEntry as PngChunkEntry, type media_PngChunkInfo as PngChunkInfo, type media_PngChunkInfoError as PngChunkInfoError, type media_PngHeaderInfo as PngHeaderInfo, type media_PngPhysicalDimensions as PngPhysicalDimensions, type media_PngTextChunk as PngTextChunk, type media_VideoInfo as VideoInfo, type media_VideoInfoError as VideoInfoError, type media_WavInfo as WavInfo, type media_WavInfoError as WavInfoError, media_inspectGifFrames as inspectGifFrames, media_readExifData as readExifData, media_readFlacInfo as readFlacInfo, media_readIcoInfo as readIcoInfo, media_readId3Tags as readId3Tags, media_readImageInfo as readImageInfo, media_readMidiInfo as readMidiInfo, media_readPdfMetadata as readPdfMetadata, media_readPdfOutline as readPdfOutline, media_readPdfPageDimensions as readPdfPageDimensions, media_readPngChunks as readPngChunks, media_readVideoInfo as readVideoInfo, media_readWavInfo as readWavInfo };
|
|
339
399
|
}
|
|
340
400
|
|
|
341
|
-
export {
|
|
401
|
+
export { type PngHeaderInfo as A, type PngPhysicalDimensions as B, type PngTextChunk as C, type VideoInfoError as D, type ExifData as E, type FlacInfo as F, type GifInfo as G, type WavInfoError as H, type IcoImageEntry as I, inspectGifFrames as J, readExifData as K, readFlacInfo as L, type MidiDivision as M, readIcoInfo as N, readId3Tags as O, type PdfMetadata as P, readImageInfo as Q, readMidiInfo as R, readPdfMetadata as S, readPdfOutline as T, readPdfPageDimensions as U, type VideoInfo as V, type WavInfo as W, readPngChunks as X, readVideoInfo as Y, readWavInfo as Z, type ExifError as a, type FlacInfoError as b, type GifInfoError as c, type IcoInfo as d, type IcoInfoError as e, type Id3Tags as f, type Id3TagsError as g, type ImageFormat as h, type ImageInfo as i, type ImageInfoError as j, type MidiInfo as k, type MidiInfoError as l, media as m, type MidiTimeSignature as n, type MidiTrackInfo as o, type PdfMetadataError as p, type PdfOutlineDestType as q, type PdfOutlineError as r, type PdfOutlineItem as s, type PdfOutlineResult as t, type PdfPageDimension as u, type PdfPageDimensionsResult as v, type PdfPageOrientation as w, type PngChunkEntry as x, type PngChunkInfo as y, type PngChunkInfoError as z };
|
package/dist/tools/data.cjs
CHANGED
|
@@ -2183,9 +2183,94 @@ function summarizeCsvColumnStats(input, options) {
|
|
|
2183
2183
|
});
|
|
2184
2184
|
return { columns, rowCount: parsed.rows.length };
|
|
2185
2185
|
}
|
|
2186
|
+
var MARKDOWN_IMAGE_RE = /!\[([^\]]*)\]\(([^)\s]+)(?:\s+"[^"]*")?\)/g;
|
|
2187
|
+
var MARKDOWN_IMAGE_GENERIC_ALT_WORDS = /* @__PURE__ */ new Set([
|
|
2188
|
+
"image",
|
|
2189
|
+
"picture",
|
|
2190
|
+
"photo",
|
|
2191
|
+
"photograph",
|
|
2192
|
+
"pic",
|
|
2193
|
+
"img",
|
|
2194
|
+
"graphic",
|
|
2195
|
+
"screenshot",
|
|
2196
|
+
"icon",
|
|
2197
|
+
"logo"
|
|
2198
|
+
]);
|
|
2199
|
+
var MARKDOWN_IMAGE_REDUNDANT_PREFIX_RE = /^(image|picture|photo|photograph)\s+of\s+/i;
|
|
2200
|
+
var MARKDOWN_IMAGE_FILENAME_EXT_RE = /\.(png|jpe?g|gif|svg|webp|bmp|avif|tiff?)$/i;
|
|
2201
|
+
function markdownImageBasenameWithoutExt(src) {
|
|
2202
|
+
const withoutQuery = src.split(/[?#]/)[0];
|
|
2203
|
+
const file = withoutQuery.split("/").pop() ?? withoutQuery;
|
|
2204
|
+
return file.replace(MARKDOWN_IMAGE_FILENAME_EXT_RE, "");
|
|
2205
|
+
}
|
|
2206
|
+
function auditMarkdownImageAltText(markdown) {
|
|
2207
|
+
if (typeof markdown !== "string") return { error: "markdown must be a string" };
|
|
2208
|
+
const lines = markdown.replace(/\r\n/g, "\n").split("\n");
|
|
2209
|
+
const images = [];
|
|
2210
|
+
const issues = [];
|
|
2211
|
+
let inFence = false;
|
|
2212
|
+
let fenceMarker = "";
|
|
2213
|
+
lines.forEach((line, idx) => {
|
|
2214
|
+
const fenceMatch = line.match(/^\s*(```+|~~~+)/);
|
|
2215
|
+
if (fenceMatch) {
|
|
2216
|
+
if (!inFence) {
|
|
2217
|
+
inFence = true;
|
|
2218
|
+
fenceMarker = fenceMatch[1][0];
|
|
2219
|
+
} else if (fenceMatch[1][0] === fenceMarker) {
|
|
2220
|
+
inFence = false;
|
|
2221
|
+
}
|
|
2222
|
+
return;
|
|
2223
|
+
}
|
|
2224
|
+
if (inFence) return;
|
|
2225
|
+
const lineNo = idx + 1;
|
|
2226
|
+
MARKDOWN_IMAGE_RE.lastIndex = 0;
|
|
2227
|
+
let match;
|
|
2228
|
+
while ((match = MARKDOWN_IMAGE_RE.exec(line)) !== null) {
|
|
2229
|
+
const alt = match[1].trim();
|
|
2230
|
+
const src = match[2];
|
|
2231
|
+
images.push({ line: lineNo, alt, src });
|
|
2232
|
+
if (alt === "") {
|
|
2233
|
+
issues.push({
|
|
2234
|
+
line: lineNo,
|
|
2235
|
+
type: "empty-alt",
|
|
2236
|
+
src,
|
|
2237
|
+
message: `Image at line ${lineNo} has no alt text (src: ${src}). If this image is purely decorative, an intentionally empty alt is fine; otherwise it needs a description.`
|
|
2238
|
+
});
|
|
2239
|
+
continue;
|
|
2240
|
+
}
|
|
2241
|
+
if (MARKDOWN_IMAGE_GENERIC_ALT_WORDS.has(alt.toLowerCase())) {
|
|
2242
|
+
issues.push({
|
|
2243
|
+
line: lineNo,
|
|
2244
|
+
type: "generic-alt",
|
|
2245
|
+
src,
|
|
2246
|
+
message: `Alt text "${alt}" at line ${lineNo} is a generic placeholder and doesn't describe the image's content.`
|
|
2247
|
+
});
|
|
2248
|
+
}
|
|
2249
|
+
if (MARKDOWN_IMAGE_REDUNDANT_PREFIX_RE.test(alt)) {
|
|
2250
|
+
issues.push({
|
|
2251
|
+
line: lineNo,
|
|
2252
|
+
type: "redundant-prefix",
|
|
2253
|
+
src,
|
|
2254
|
+
message: `Alt text "${alt}" at line ${lineNo} starts with a redundant prefix; screen readers already announce images, so "${alt.replace(MARKDOWN_IMAGE_REDUNDANT_PREFIX_RE, "")}" reads better.`
|
|
2255
|
+
});
|
|
2256
|
+
}
|
|
2257
|
+
const baseName = markdownImageBasenameWithoutExt(src);
|
|
2258
|
+
if (MARKDOWN_IMAGE_FILENAME_EXT_RE.test(alt) || baseName !== "" && alt.toLowerCase() === baseName.toLowerCase()) {
|
|
2259
|
+
issues.push({
|
|
2260
|
+
line: lineNo,
|
|
2261
|
+
type: "filename-as-alt",
|
|
2262
|
+
src,
|
|
2263
|
+
message: `Alt text "${alt}" at line ${lineNo} looks like the image's own filename rather than a description.`
|
|
2264
|
+
});
|
|
2265
|
+
}
|
|
2266
|
+
}
|
|
2267
|
+
});
|
|
2268
|
+
return { images, issues, imageCount: images.length };
|
|
2269
|
+
}
|
|
2186
2270
|
|
|
2187
2271
|
exports.alignMarkdownTables = alignMarkdownTables;
|
|
2188
2272
|
exports.analyzeCaptionSpeed = analyzeCaptionSpeed;
|
|
2273
|
+
exports.auditMarkdownImageAltText = auditMarkdownImageAltText;
|
|
2189
2274
|
exports.calculateMarkdownTaskListProgress = calculateMarkdownTaskListProgress;
|
|
2190
2275
|
exports.checkMarkdownInternalLinks = checkMarkdownInternalLinks;
|
|
2191
2276
|
exports.convertSubtitles = convertSubtitles;
|
package/dist/tools/data.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { C as CaptionSpeedCue, a as CaptionSpeedResult, b as ConvertedSubtitles, c as CsvColumnMostCommon, e as CsvColumnStats, f as CsvColumnStatsOptions, g as CsvColumnStatsResult, h as CsvColumnType, i as CsvColumnTypeInfo, j as CsvColumnTypeOptions, k as CsvColumnTypeResult, l as CsvDuplicateGroup, m as CsvDuplicateOptions, n as CsvDuplicateResult, o as CsvParseResult, p as CsvToSqlOptions, q as CsvToSqlResult, E as EnvDiffError, r as EnvDiffResult, s as EnvEntry, t as EnvParseResult, F as FrontMatterError, u as FrontMatterResult, H as HeadingEntry, v as HeadingHierarchyResult, w as HeadingIssue, x as HeadingIssueType, I as IniSection, M as MarkdownAnchorHeading, y as MarkdownAnchorLink, z as
|
|
1
|
+
export { C as CaptionSpeedCue, a as CaptionSpeedResult, b as ConvertedSubtitles, c as CsvColumnMostCommon, e as CsvColumnStats, f as CsvColumnStatsOptions, g as CsvColumnStatsResult, h as CsvColumnType, i as CsvColumnTypeInfo, j as CsvColumnTypeOptions, k as CsvColumnTypeResult, l as CsvDuplicateGroup, m as CsvDuplicateOptions, n as CsvDuplicateResult, o as CsvParseResult, p as CsvToSqlOptions, q as CsvToSqlResult, E as EnvDiffError, r as EnvDiffResult, s as EnvEntry, t as EnvParseResult, F as FrontMatterError, u as FrontMatterResult, H as HeadingEntry, v as HeadingHierarchyResult, w as HeadingIssue, x as HeadingIssueType, I as IniSection, M as MarkdownAnchorHeading, y as MarkdownAnchorLink, z as MarkdownImageAltIssue, A as MarkdownImageAltIssueType, B as MarkdownImageAltTextAuditResult, D as MarkdownImageEntry, G as MarkdownInternalLinkCheckResult, J as MarkdownTableAlignResult, K as MarkdownTableColumnAlignment, L as MarkdownTableInfo, N as MarkdownTaskListItem, O as MarkdownTaskListProgressResult, P as MarkdownTaskListSectionSummary, Q as MarkdownTocEntry, R as MarkdownTocOptions, S as MarkdownTocResult, T as NdjsonDedupeResult, U as NdjsonLineResult, V as NdjsonValidateResult, W as ParseOptions, X as ParsedIni, Y as ParsedSubtitles, Z as SubtitleCue, _ as SubtitleFormat, $ as TomlFormatResult, a0 as ValidationResult, a1 as XmlFormatResult, a2 as XmlToJsonOptions, a3 as YamlAnchorInfo, a4 as YamlAnchorResolveError, a5 as YamlAnchorResolveResult, a6 as YamlDuplicateKeyEntry, a7 as YamlDuplicateKeyError, a8 as YamlDuplicateKeyResult, a9 as alignMarkdownTables, aa as analyzeCaptionSpeed, ab as auditMarkdownImageAltText, ac as calculateMarkdownTaskListProgress, ad as checkMarkdownInternalLinks, ae as convertSubtitles, af as csvToJson, ag as csvToSqlInsert, ah as dedupeNdjson, ai as detectDelimiter, aj as detectSubtitleFormat, ak as diffEnvExample, al as envToExport, am as envToJson, an as findCsvDuplicateRows, ao as findYamlDuplicateKeys, ap as formatNdjson, aq as formatSubtitleTimestamp, ar as formatToml, as as formatXml, at as generateMarkdownToc, au as getSection, av as getSectionNames, aw as getTomlStats, ax as getXmlStats, ay as getYamlStats, az as inferCsvColumnTypes, aA as iniToJson, aB as jsonArrayToNdjson, aC as jsonToIni, aD as jsonToToml, aE as jsonToXml, aF as minifyNdjson, aG as minifyToml, aH as minifyXml, aI as ndjsonToCsv, aJ as ndjsonToJsonArray, aK as parseCsv, aL as parseEnv, aM as parseFrontMatter, aN as parseIni, aO as parseSubtitleTimestamp, aP as parseSubtitles, aQ as parseXmlToObject, aR as resolveYamlAnchors, aS as serializeSubtitles, aT as shiftSubtitles, aU as stringifyIni, aV as summarizeCsvColumnStats, aW as toCsvString, aX as tomlToJson, aY as validateEnvKey, aZ as validateIni, a_ as validateMarkdownHeadingHierarchy, a$ as validateNdjson, b0 as validateToml, b1 as validateXml, b2 as validateYaml, b3 as xmlToJson } from '../data-Dg5dEwWl.cjs';
|
package/dist/tools/data.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { C as CaptionSpeedCue, a as CaptionSpeedResult, b as ConvertedSubtitles, c as CsvColumnMostCommon, e as CsvColumnStats, f as CsvColumnStatsOptions, g as CsvColumnStatsResult, h as CsvColumnType, i as CsvColumnTypeInfo, j as CsvColumnTypeOptions, k as CsvColumnTypeResult, l as CsvDuplicateGroup, m as CsvDuplicateOptions, n as CsvDuplicateResult, o as CsvParseResult, p as CsvToSqlOptions, q as CsvToSqlResult, E as EnvDiffError, r as EnvDiffResult, s as EnvEntry, t as EnvParseResult, F as FrontMatterError, u as FrontMatterResult, H as HeadingEntry, v as HeadingHierarchyResult, w as HeadingIssue, x as HeadingIssueType, I as IniSection, M as MarkdownAnchorHeading, y as MarkdownAnchorLink, z as
|
|
1
|
+
export { C as CaptionSpeedCue, a as CaptionSpeedResult, b as ConvertedSubtitles, c as CsvColumnMostCommon, e as CsvColumnStats, f as CsvColumnStatsOptions, g as CsvColumnStatsResult, h as CsvColumnType, i as CsvColumnTypeInfo, j as CsvColumnTypeOptions, k as CsvColumnTypeResult, l as CsvDuplicateGroup, m as CsvDuplicateOptions, n as CsvDuplicateResult, o as CsvParseResult, p as CsvToSqlOptions, q as CsvToSqlResult, E as EnvDiffError, r as EnvDiffResult, s as EnvEntry, t as EnvParseResult, F as FrontMatterError, u as FrontMatterResult, H as HeadingEntry, v as HeadingHierarchyResult, w as HeadingIssue, x as HeadingIssueType, I as IniSection, M as MarkdownAnchorHeading, y as MarkdownAnchorLink, z as MarkdownImageAltIssue, A as MarkdownImageAltIssueType, B as MarkdownImageAltTextAuditResult, D as MarkdownImageEntry, G as MarkdownInternalLinkCheckResult, J as MarkdownTableAlignResult, K as MarkdownTableColumnAlignment, L as MarkdownTableInfo, N as MarkdownTaskListItem, O as MarkdownTaskListProgressResult, P as MarkdownTaskListSectionSummary, Q as MarkdownTocEntry, R as MarkdownTocOptions, S as MarkdownTocResult, T as NdjsonDedupeResult, U as NdjsonLineResult, V as NdjsonValidateResult, W as ParseOptions, X as ParsedIni, Y as ParsedSubtitles, Z as SubtitleCue, _ as SubtitleFormat, $ as TomlFormatResult, a0 as ValidationResult, a1 as XmlFormatResult, a2 as XmlToJsonOptions, a3 as YamlAnchorInfo, a4 as YamlAnchorResolveError, a5 as YamlAnchorResolveResult, a6 as YamlDuplicateKeyEntry, a7 as YamlDuplicateKeyError, a8 as YamlDuplicateKeyResult, a9 as alignMarkdownTables, aa as analyzeCaptionSpeed, ab as auditMarkdownImageAltText, ac as calculateMarkdownTaskListProgress, ad as checkMarkdownInternalLinks, ae as convertSubtitles, af as csvToJson, ag as csvToSqlInsert, ah as dedupeNdjson, ai as detectDelimiter, aj as detectSubtitleFormat, ak as diffEnvExample, al as envToExport, am as envToJson, an as findCsvDuplicateRows, ao as findYamlDuplicateKeys, ap as formatNdjson, aq as formatSubtitleTimestamp, ar as formatToml, as as formatXml, at as generateMarkdownToc, au as getSection, av as getSectionNames, aw as getTomlStats, ax as getXmlStats, ay as getYamlStats, az as inferCsvColumnTypes, aA as iniToJson, aB as jsonArrayToNdjson, aC as jsonToIni, aD as jsonToToml, aE as jsonToXml, aF as minifyNdjson, aG as minifyToml, aH as minifyXml, aI as ndjsonToCsv, aJ as ndjsonToJsonArray, aK as parseCsv, aL as parseEnv, aM as parseFrontMatter, aN as parseIni, aO as parseSubtitleTimestamp, aP as parseSubtitles, aQ as parseXmlToObject, aR as resolveYamlAnchors, aS as serializeSubtitles, aT as shiftSubtitles, aU as stringifyIni, aV as summarizeCsvColumnStats, aW as toCsvString, aX as tomlToJson, aY as validateEnvKey, aZ as validateIni, a_ as validateMarkdownHeadingHierarchy, a$ as validateNdjson, b0 as validateToml, b1 as validateXml, b2 as validateYaml, b3 as xmlToJson } from '../data-Dg5dEwWl.js';
|
package/dist/tools/data.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { alignMarkdownTables, analyzeCaptionSpeed, calculateMarkdownTaskListProgress, checkMarkdownInternalLinks, convertSubtitles, csvToJson, csvToSqlInsert, dedupeNdjson, detectDelimiter, detectSubtitleFormat, diffEnvExample, envToExport, envToJson, findCsvDuplicateRows, findYamlDuplicateKeys, formatNdjson, formatSubtitleTimestamp, formatToml, formatXml, generateMarkdownToc, getSection, getSectionNames, getTomlStats, getXmlStats, getYamlStats, inferCsvColumnTypes, iniToJson, jsonArrayToNdjson, jsonToIni, jsonToToml, jsonToXml, minifyNdjson, minifyToml, minifyXml, ndjsonToCsv, ndjsonToJsonArray, parseCsv, parseEnv, parseFrontMatter, parseIni, parseSubtitleTimestamp, parseSubtitles, parseXmlToObject, resolveYamlAnchors, serializeSubtitles, shiftSubtitles, stringifyIni, summarizeCsvColumnStats, toCsvString, tomlToJson, validateEnvKey, validateIni, validateMarkdownHeadingHierarchy, validateNdjson, validateToml, validateXml, validateYaml, xmlToJson } from '../chunk-
|
|
1
|
+
export { alignMarkdownTables, analyzeCaptionSpeed, auditMarkdownImageAltText, calculateMarkdownTaskListProgress, checkMarkdownInternalLinks, convertSubtitles, csvToJson, csvToSqlInsert, dedupeNdjson, detectDelimiter, detectSubtitleFormat, diffEnvExample, envToExport, envToJson, findCsvDuplicateRows, findYamlDuplicateKeys, formatNdjson, formatSubtitleTimestamp, formatToml, formatXml, generateMarkdownToc, getSection, getSectionNames, getTomlStats, getXmlStats, getYamlStats, inferCsvColumnTypes, iniToJson, jsonArrayToNdjson, jsonToIni, jsonToToml, jsonToXml, minifyNdjson, minifyToml, minifyXml, ndjsonToCsv, ndjsonToJsonArray, parseCsv, parseEnv, parseFrontMatter, parseIni, parseSubtitleTimestamp, parseSubtitles, parseXmlToObject, resolveYamlAnchors, serializeSubtitles, shiftSubtitles, stringifyIni, summarizeCsvColumnStats, toCsvString, tomlToJson, validateEnvKey, validateIni, validateMarkdownHeadingHierarchy, validateNdjson, validateToml, validateXml, validateYaml, xmlToJson } from '../chunk-NTHUTIZH.js';
|
|
2
2
|
import '../chunk-MLKGABMK.js';
|
package/dist/tools/media.cjs
CHANGED
|
@@ -1491,6 +1491,116 @@ function readMidiInfo(bytes) {
|
|
|
1491
1491
|
tracks
|
|
1492
1492
|
};
|
|
1493
1493
|
}
|
|
1494
|
+
var PNG_SIGNATURE = [137, 80, 78, 71, 13, 10, 26, 10];
|
|
1495
|
+
var PNG_CRC_TABLE = null;
|
|
1496
|
+
function getPngCrcTable() {
|
|
1497
|
+
if (PNG_CRC_TABLE) return PNG_CRC_TABLE;
|
|
1498
|
+
const table = new Uint32Array(256);
|
|
1499
|
+
for (let n = 0; n < 256; n++) {
|
|
1500
|
+
let c = n;
|
|
1501
|
+
for (let k = 0; k < 8; k++) {
|
|
1502
|
+
c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1;
|
|
1503
|
+
}
|
|
1504
|
+
table[n] = c;
|
|
1505
|
+
}
|
|
1506
|
+
PNG_CRC_TABLE = table;
|
|
1507
|
+
return table;
|
|
1508
|
+
}
|
|
1509
|
+
function pngCrc32(bytes) {
|
|
1510
|
+
const table = getPngCrcTable();
|
|
1511
|
+
let crc = 4294967295;
|
|
1512
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
1513
|
+
crc = table[(crc ^ bytes[i]) & 255] ^ crc >>> 8;
|
|
1514
|
+
}
|
|
1515
|
+
return (crc ^ 4294967295) >>> 0;
|
|
1516
|
+
}
|
|
1517
|
+
function pad2(n) {
|
|
1518
|
+
return n < 10 ? `0${n}` : `${n}`;
|
|
1519
|
+
}
|
|
1520
|
+
function readPngChunks(bytes) {
|
|
1521
|
+
if (bytes.length < 8) return { error: "File too small to be a valid PNG file" };
|
|
1522
|
+
for (let i = 0; i < 8; i++) {
|
|
1523
|
+
if (bytes[i] !== PNG_SIGNATURE[i]) return { error: "Not a valid PNG file (bad 8-byte signature)" };
|
|
1524
|
+
}
|
|
1525
|
+
const chunks = [];
|
|
1526
|
+
const textChunks = [];
|
|
1527
|
+
let header = null;
|
|
1528
|
+
let physicalDimensions = null;
|
|
1529
|
+
let gamma = null;
|
|
1530
|
+
let lastModified = null;
|
|
1531
|
+
let isAnimated = false;
|
|
1532
|
+
let offset = 8;
|
|
1533
|
+
while (offset + 8 <= bytes.length) {
|
|
1534
|
+
const dataLength = readU32BE(bytes, offset);
|
|
1535
|
+
const type = String.fromCharCode(bytes[offset + 4], bytes[offset + 5], bytes[offset + 6], bytes[offset + 7]);
|
|
1536
|
+
const dataStart = offset + 8;
|
|
1537
|
+
const dataEnd = dataStart + dataLength;
|
|
1538
|
+
const crcOffset = dataEnd;
|
|
1539
|
+
if (crcOffset + 4 > bytes.length) {
|
|
1540
|
+
return { error: `Truncated chunk "${type}" at offset ${offset}` };
|
|
1541
|
+
}
|
|
1542
|
+
const data = bytes.subarray(dataStart, dataEnd);
|
|
1543
|
+
const expectedCrc = readU32BE(bytes, crcOffset);
|
|
1544
|
+
const actualCrc = pngCrc32(bytes.subarray(offset + 4, dataEnd));
|
|
1545
|
+
const firstChar = type.charCodeAt(0);
|
|
1546
|
+
const critical = firstChar >= 65 && firstChar <= 90;
|
|
1547
|
+
chunks.push({ type, offset, dataLength, crcValid: actualCrc === expectedCrc, critical });
|
|
1548
|
+
if (type === "IHDR" && data.length >= 13) {
|
|
1549
|
+
const colorTypeNum = data[9];
|
|
1550
|
+
header = {
|
|
1551
|
+
width: readU32BE(data, 0),
|
|
1552
|
+
height: readU32BE(data, 4),
|
|
1553
|
+
bitDepth: data[8],
|
|
1554
|
+
colorType: PNG_COLOR_TYPES[colorTypeNum] ?? "unknown",
|
|
1555
|
+
hasAlpha: colorTypeNum === 4 || colorTypeNum === 6,
|
|
1556
|
+
interlace: data[12] === 1
|
|
1557
|
+
};
|
|
1558
|
+
} else if (type === "tEXt") {
|
|
1559
|
+
const nullIdx = data.indexOf(0);
|
|
1560
|
+
if (nullIdx !== -1) {
|
|
1561
|
+
textChunks.push({
|
|
1562
|
+
keyword: Buffer.from(data.subarray(0, nullIdx)).toString("latin1"),
|
|
1563
|
+
text: Buffer.from(data.subarray(nullIdx + 1)).toString("latin1"),
|
|
1564
|
+
compressed: false
|
|
1565
|
+
});
|
|
1566
|
+
}
|
|
1567
|
+
} else if (type === "zTXt" || type === "iTXt") {
|
|
1568
|
+
const nullIdx = data.indexOf(0);
|
|
1569
|
+
if (nullIdx !== -1) {
|
|
1570
|
+
textChunks.push({ keyword: Buffer.from(data.subarray(0, nullIdx)).toString("latin1"), text: null, compressed: true });
|
|
1571
|
+
}
|
|
1572
|
+
} else if (type === "pHYs" && data.length >= 9) {
|
|
1573
|
+
physicalDimensions = {
|
|
1574
|
+
pixelsPerUnitX: readU32BE(data, 0),
|
|
1575
|
+
pixelsPerUnitY: readU32BE(data, 4),
|
|
1576
|
+
unit: data[8] === 1 ? "meter" : "unknown"
|
|
1577
|
+
};
|
|
1578
|
+
} else if (type === "gAMA" && data.length >= 4) {
|
|
1579
|
+
gamma = readU32BE(data, 0) / 1e5;
|
|
1580
|
+
} else if (type === "tIME" && data.length >= 7) {
|
|
1581
|
+
const year = data[0] << 8 | data[1];
|
|
1582
|
+
lastModified = `${year}-${pad2(data[2])}-${pad2(data[3])}T${pad2(data[4])}:${pad2(data[5])}:${pad2(data[6])}Z`;
|
|
1583
|
+
} else if (type === "acTL") {
|
|
1584
|
+
isAnimated = true;
|
|
1585
|
+
}
|
|
1586
|
+
offset = crcOffset + 4;
|
|
1587
|
+
if (type === "IEND") break;
|
|
1588
|
+
}
|
|
1589
|
+
if (chunks.length === 0) return { error: "No chunks found after the PNG signature" };
|
|
1590
|
+
if (!header) return { error: "Missing required IHDR chunk" };
|
|
1591
|
+
return {
|
|
1592
|
+
valid: true,
|
|
1593
|
+
fileSize: bytes.length,
|
|
1594
|
+
chunkCount: chunks.length,
|
|
1595
|
+
chunks,
|
|
1596
|
+
header,
|
|
1597
|
+
textChunks,
|
|
1598
|
+
physicalDimensions,
|
|
1599
|
+
gamma,
|
|
1600
|
+
lastModified,
|
|
1601
|
+
isAnimated
|
|
1602
|
+
};
|
|
1603
|
+
}
|
|
1494
1604
|
|
|
1495
1605
|
exports.inspectGifFrames = inspectGifFrames;
|
|
1496
1606
|
exports.readExifData = readExifData;
|
|
@@ -1502,5 +1612,6 @@ exports.readMidiInfo = readMidiInfo;
|
|
|
1502
1612
|
exports.readPdfMetadata = readPdfMetadata;
|
|
1503
1613
|
exports.readPdfOutline = readPdfOutline;
|
|
1504
1614
|
exports.readPdfPageDimensions = readPdfPageDimensions;
|
|
1615
|
+
exports.readPngChunks = readPngChunks;
|
|
1505
1616
|
exports.readVideoInfo = readVideoInfo;
|
|
1506
1617
|
exports.readWavInfo = readWavInfo;
|
package/dist/tools/media.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { E as ExifData, a as ExifError, F as FlacInfo, b as FlacInfoError, G as GifInfo, c as GifInfoError, I as IcoImageEntry, d as IcoInfo, e as IcoInfoError, f as Id3Tags, g as Id3TagsError, h as ImageFormat, i as ImageInfo, j as ImageInfoError, M as MidiDivision, k as MidiInfo, l as MidiInfoError, n as MidiTimeSignature, o as MidiTrackInfo, P as PdfMetadata, p as PdfMetadataError, q as PdfOutlineDestType, r as PdfOutlineError, s as PdfOutlineItem, t as PdfOutlineResult, u as PdfPageDimension, v as PdfPageDimensionsResult, w as PdfPageOrientation, V as VideoInfo,
|
|
1
|
+
export { E as ExifData, a as ExifError, F as FlacInfo, b as FlacInfoError, G as GifInfo, c as GifInfoError, I as IcoImageEntry, d as IcoInfo, e as IcoInfoError, f as Id3Tags, g as Id3TagsError, h as ImageFormat, i as ImageInfo, j as ImageInfoError, M as MidiDivision, k as MidiInfo, l as MidiInfoError, n as MidiTimeSignature, o as MidiTrackInfo, P as PdfMetadata, p as PdfMetadataError, q as PdfOutlineDestType, r as PdfOutlineError, s as PdfOutlineItem, t as PdfOutlineResult, u as PdfPageDimension, v as PdfPageDimensionsResult, w as PdfPageOrientation, x as PngChunkEntry, y as PngChunkInfo, z as PngChunkInfoError, A as PngHeaderInfo, B as PngPhysicalDimensions, C as PngTextChunk, V as VideoInfo, D as VideoInfoError, W as WavInfo, H as WavInfoError, J as inspectGifFrames, K as readExifData, L as readFlacInfo, N as readIcoInfo, O as readId3Tags, Q as readImageInfo, R as readMidiInfo, S as readPdfMetadata, T as readPdfOutline, U as readPdfPageDimensions, X as readPngChunks, Y as readVideoInfo, Z as readWavInfo } from '../media-C8Y67lUI.cjs';
|
package/dist/tools/media.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { E as ExifData, a as ExifError, F as FlacInfo, b as FlacInfoError, G as GifInfo, c as GifInfoError, I as IcoImageEntry, d as IcoInfo, e as IcoInfoError, f as Id3Tags, g as Id3TagsError, h as ImageFormat, i as ImageInfo, j as ImageInfoError, M as MidiDivision, k as MidiInfo, l as MidiInfoError, n as MidiTimeSignature, o as MidiTrackInfo, P as PdfMetadata, p as PdfMetadataError, q as PdfOutlineDestType, r as PdfOutlineError, s as PdfOutlineItem, t as PdfOutlineResult, u as PdfPageDimension, v as PdfPageDimensionsResult, w as PdfPageOrientation, V as VideoInfo,
|
|
1
|
+
export { E as ExifData, a as ExifError, F as FlacInfo, b as FlacInfoError, G as GifInfo, c as GifInfoError, I as IcoImageEntry, d as IcoInfo, e as IcoInfoError, f as Id3Tags, g as Id3TagsError, h as ImageFormat, i as ImageInfo, j as ImageInfoError, M as MidiDivision, k as MidiInfo, l as MidiInfoError, n as MidiTimeSignature, o as MidiTrackInfo, P as PdfMetadata, p as PdfMetadataError, q as PdfOutlineDestType, r as PdfOutlineError, s as PdfOutlineItem, t as PdfOutlineResult, u as PdfPageDimension, v as PdfPageDimensionsResult, w as PdfPageOrientation, x as PngChunkEntry, y as PngChunkInfo, z as PngChunkInfoError, A as PngHeaderInfo, B as PngPhysicalDimensions, C as PngTextChunk, V as VideoInfo, D as VideoInfoError, W as WavInfo, H as WavInfoError, J as inspectGifFrames, K as readExifData, L as readFlacInfo, N as readIcoInfo, O as readId3Tags, Q as readImageInfo, R as readMidiInfo, S as readPdfMetadata, T as readPdfOutline, U as readPdfPageDimensions, X as readPngChunks, Y as readVideoInfo, Z as readWavInfo } from '../media-C8Y67lUI.js';
|
package/dist/tools/media.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { inspectGifFrames, readExifData, readFlacInfo, readIcoInfo, readId3Tags, readImageInfo, readMidiInfo, readPdfMetadata, readPdfOutline, readPdfPageDimensions, readVideoInfo, readWavInfo } from '../chunk-
|
|
1
|
+
export { inspectGifFrames, readExifData, readFlacInfo, readIcoInfo, readId3Tags, readImageInfo, readMidiInfo, readPdfMetadata, readPdfOutline, readPdfPageDimensions, readPngChunks, readVideoInfo, readWavInfo } from '../chunk-YSS4VVZU.js';
|
|
2
2
|
import '../chunk-MLKGABMK.js';
|
package/dist/tools/units.cjs
CHANGED
|
@@ -3049,6 +3049,109 @@ function detectNegativeAmortization(input) {
|
|
|
3049
3049
|
capCrossedMonth
|
|
3050
3050
|
};
|
|
3051
3051
|
}
|
|
3052
|
+
var AUDIO_FILE_SIZE_WAV_HEADER_BYTES = 44;
|
|
3053
|
+
function estimateAudioFileSize(input) {
|
|
3054
|
+
const { mode, durationSeconds } = input;
|
|
3055
|
+
if (!Number.isFinite(durationSeconds) || durationSeconds <= 0) {
|
|
3056
|
+
return { error: "durationSeconds must be a positive number" };
|
|
3057
|
+
}
|
|
3058
|
+
const round22 = (n) => Math.round(n * 100) / 100;
|
|
3059
|
+
if (mode === "pcm") {
|
|
3060
|
+
const { sampleRateHz, bitDepth, channels } = input;
|
|
3061
|
+
if (!Number.isFinite(sampleRateHz) || sampleRateHz <= 0) {
|
|
3062
|
+
return { error: 'sampleRateHz must be a positive number for mode "pcm"' };
|
|
3063
|
+
}
|
|
3064
|
+
if (!Number.isFinite(bitDepth) || bitDepth <= 0) {
|
|
3065
|
+
return { error: 'bitDepth must be a positive number for mode "pcm"' };
|
|
3066
|
+
}
|
|
3067
|
+
if (!Number.isInteger(channels) || channels <= 0) {
|
|
3068
|
+
return { error: 'channels must be a positive whole number for mode "pcm"' };
|
|
3069
|
+
}
|
|
3070
|
+
const dataBytes = sampleRateHz * (bitDepth / 8) * channels * durationSeconds;
|
|
3071
|
+
const fileSizeBytes = dataBytes + AUDIO_FILE_SIZE_WAV_HEADER_BYTES;
|
|
3072
|
+
return {
|
|
3073
|
+
mode,
|
|
3074
|
+
durationSeconds,
|
|
3075
|
+
sampleRateHz,
|
|
3076
|
+
bitDepth,
|
|
3077
|
+
channels,
|
|
3078
|
+
dataBytes: Math.round(dataBytes),
|
|
3079
|
+
fileSizeBytes: Math.round(fileSizeBytes),
|
|
3080
|
+
fileSizeMB: round22(fileSizeBytes / 1e6),
|
|
3081
|
+
fileSizeMiB: round22(fileSizeBytes / 1048576)
|
|
3082
|
+
};
|
|
3083
|
+
}
|
|
3084
|
+
if (mode === "compressed") {
|
|
3085
|
+
const { bitrateKbps } = input;
|
|
3086
|
+
if (!Number.isFinite(bitrateKbps) || bitrateKbps <= 0) {
|
|
3087
|
+
return { error: 'bitrateKbps must be a positive number for mode "compressed"' };
|
|
3088
|
+
}
|
|
3089
|
+
const dataBytes = bitrateKbps * 1e3 * durationSeconds / 8;
|
|
3090
|
+
return {
|
|
3091
|
+
mode,
|
|
3092
|
+
durationSeconds,
|
|
3093
|
+
bitrateKbps,
|
|
3094
|
+
dataBytes: Math.round(dataBytes),
|
|
3095
|
+
fileSizeBytes: Math.round(dataBytes),
|
|
3096
|
+
fileSizeMB: round22(dataBytes / 1e6),
|
|
3097
|
+
fileSizeMiB: round22(dataBytes / 1048576)
|
|
3098
|
+
};
|
|
3099
|
+
}
|
|
3100
|
+
return { error: 'mode must be "pcm" or "compressed"' };
|
|
3101
|
+
}
|
|
3102
|
+
var ABA_FEDERAL_RESERVE_BANKS = {
|
|
3103
|
+
1: "Boston",
|
|
3104
|
+
2: "New York",
|
|
3105
|
+
3: "Philadelphia",
|
|
3106
|
+
4: "Cleveland",
|
|
3107
|
+
5: "Richmond",
|
|
3108
|
+
6: "Atlanta",
|
|
3109
|
+
7: "Chicago",
|
|
3110
|
+
8: "St. Louis",
|
|
3111
|
+
9: "Minneapolis",
|
|
3112
|
+
10: "Kansas City",
|
|
3113
|
+
11: "Dallas",
|
|
3114
|
+
12: "San Francisco"
|
|
3115
|
+
};
|
|
3116
|
+
function abaDistrictAndType(prefix) {
|
|
3117
|
+
if (prefix >= 1 && prefix <= 12) {
|
|
3118
|
+
return { type: "primary", district: { code: prefix, bank: ABA_FEDERAL_RESERVE_BANKS[prefix] } };
|
|
3119
|
+
}
|
|
3120
|
+
if (prefix >= 21 && prefix <= 32) {
|
|
3121
|
+
const code = prefix - 20;
|
|
3122
|
+
return { type: "thrift", district: { code, bank: ABA_FEDERAL_RESERVE_BANKS[code] } };
|
|
3123
|
+
}
|
|
3124
|
+
if (prefix >= 61 && prefix <= 72) {
|
|
3125
|
+
const code = prefix - 60;
|
|
3126
|
+
return { type: "electronic", district: { code, bank: ABA_FEDERAL_RESERVE_BANKS[code] } };
|
|
3127
|
+
}
|
|
3128
|
+
if (prefix === 80) {
|
|
3129
|
+
return { type: "traveler-check", district: null };
|
|
3130
|
+
}
|
|
3131
|
+
return { type: "unknown", district: null };
|
|
3132
|
+
}
|
|
3133
|
+
function formatRoutingNumber(digits) {
|
|
3134
|
+
return `${digits.slice(0, 4)} ${digits.slice(4, 8)} ${digits.slice(8)}`;
|
|
3135
|
+
}
|
|
3136
|
+
function validateRoutingNumber(input) {
|
|
3137
|
+
if (!input || !input.trim()) return { error: "Input is empty" };
|
|
3138
|
+
const digits = input.replace(/[\s-]/g, "");
|
|
3139
|
+
if (!/^\d+$/.test(digits)) return { error: "Routing number must contain only digits, spaces, or hyphens" };
|
|
3140
|
+
if (digits.length !== 9) return { error: `Routing number length (${digits.length}) must be exactly 9 digits` };
|
|
3141
|
+
const d = digits.split("").map(Number);
|
|
3142
|
+
const sum = 3 * (d[0] + d[3] + d[6]) + 7 * (d[1] + d[4] + d[7]) + 1 * (d[2] + d[5] + d[8]);
|
|
3143
|
+
const checksumValid = sum % 10 === 0;
|
|
3144
|
+
const prefix = Number(digits.slice(0, 2));
|
|
3145
|
+
const { type, district } = abaDistrictAndType(prefix);
|
|
3146
|
+
return {
|
|
3147
|
+
valid: checksumValid,
|
|
3148
|
+
checksumValid,
|
|
3149
|
+
length: digits.length,
|
|
3150
|
+
formatted: formatRoutingNumber(digits),
|
|
3151
|
+
routingNumberType: type,
|
|
3152
|
+
federalReserveDistrict: district
|
|
3153
|
+
};
|
|
3154
|
+
}
|
|
3052
3155
|
|
|
3053
3156
|
exports.BASE_LABELS = BASE_LABELS;
|
|
3054
3157
|
exports.BASE_PREFIXES = BASE_PREFIXES;
|
|
@@ -3117,6 +3220,7 @@ exports.decimalToIp = decimalToIp;
|
|
|
3117
3220
|
exports.decimalToIpCidr = decimalToIpCidr;
|
|
3118
3221
|
exports.describePermissions = describePermissions;
|
|
3119
3222
|
exports.detectNegativeAmortization = detectNegativeAmortization;
|
|
3223
|
+
exports.estimateAudioFileSize = estimateAudioFileSize;
|
|
3120
3224
|
exports.fitIntoBox = fitIntoBox;
|
|
3121
3225
|
exports.formatNumber = formatNumber;
|
|
3122
3226
|
exports.formatValue = formatValue;
|
|
@@ -3162,5 +3266,6 @@ exports.validateCardNumber = validateCardNumber;
|
|
|
3162
3266
|
exports.validateIban = validateIban;
|
|
3163
3267
|
exports.validateIsbn = validateIsbn;
|
|
3164
3268
|
exports.validateIsin = validateIsin;
|
|
3269
|
+
exports.validateRoutingNumber = validateRoutingNumber;
|
|
3165
3270
|
exports.validateVin = validateVin;
|
|
3166
3271
|
exports.viewportToPx = viewportToPx;
|
package/dist/tools/units.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { A as
|
|
1
|
+
export { A as AbaFederalReserveDistrict, a as AbaRoutingNumberResult, b as AbaRoutingNumberType, c as AmortizationRow, d as AnnuityPayoutInput, e as AnnuityPayoutMode, f as AnnuityPayoutResult, g as AnnuityStructure, h as AprApyDirection, i as AprApyResult, j as AspectRatioResult, k as AudioFileSizeInput, l as AudioFileSizeMode, m as AudioFileSizeResult, B as BASE_LABELS, n as BASE_PREFIXES, o as BYTE_UNITS, p as BarcodeFormat, q as BarcodeValidationResult, r as BaseConvertResult, s as BlendedLoanRateResult, t as BreakEvenInput, v as BreakEvenResult, w as ByteConvertResult, x as ByteUnit, C as COMMON_CURRENCIES, y as COMMON_LOCALES, z as COMMON_PERMISSIONS, D as COMMON_RATIOS, E as COMMON_SIZES, F as COMMON_TAX_RATES, G as COMMON_TIP_PERCENTAGES, H as COMMON_VIEWPORTS, I as CardValidationResult, J as CashBreakdownResult, K as CashChangeResult, L as CashDenominationItem, M as CashRoundingMode, N as CashRoundingResult, O as CdMaturityResult, P as CommissionBreakdownEntry, Q as CommissionInput, R as CommissionResult, S as CommissionTier, T as CompareUnitPricesResult, U as CompoundInterestResult, V as CompoundYearRow, W as CreditAccountInput, X as CreditAccountResult, Y as CreditCardMinimumPaymentResult, Z as CreditUtilizationResult, _ as DebtItemInput, $ as DebtItemResult, a0 as DebtPayoffComparison, a1 as DebtPayoffInput, a2 as DebtPayoffPlanResult, a3 as DebtPayoffScheduleEntry, a4 as DebtPayoffStrategy, a5 as DebtPayoffStrategyResult, a6 as DebtToIncomeRatioResult, a7 as DepreciationMethod, a8 as DepreciationResult, a9 as DepreciationYear, aa as Dimensions, ab as DiscountField, ac as DiscountInput, ad as DiscountResult, ae as DtiTier, af as EmiResult, ag as EmiTenureUnit, ah as EmiYearlyBreakdownRow, ai as ExtraPaymentPayoffResult, aj as FilePermissions, ak as FileSizeUnit, al as FormatOptions, am as FreelancerRateInput, an as FreelancerRateResult, ao as GPA_GRADE_POINTS, ap as GpaCourse, aq as GpaCourseResult, ar as GpaResult, as as IbanValidationResult, at as IpConversion, au as IsbnFormat, av as IsbnResult, aw as IsinValidationResult, ax as LoanBalanceInput, ay as LoanBalanceResult, az as LoanPrepaymentPenaltyResult, aA as LoanRefinanceResult, aB as LoanResult, aC as MarginMarkupField, aD as MarginMarkupInput, aE as MarginMarkupResult, aF as MortgagePointsResult, aG as MovingAveragePoint, aH as MovingAverageResult, aI as NegativeAmortizationInput, aJ as NegativeAmortizationMonth, aK as NegativeAmortizationResult, aL as NotationStyle, aM as NumberBase, aN as PaybackPeriodInput, aO as PaybackPeriodResult, aP as PercentChangeDirection, aQ as PercentageChangeResult, aR as Permission, aS as PrepaymentPenaltyType, aT as PxConvertResult, aU as RangeIntersectionResult, aV as RealRateField, aW as RealRateOfReturnInput, aX as RealRateOfReturnResult, aY as RequiredBandwidthResult, aZ as RoiInput, a_ as RoiResult, a$ as RuleOf72Direction, b0 as RuleOf72Result, b1 as SavingsGoalInput, b2 as SavingsGoalMode, b3 as SavingsGoalResult, b4 as SemverVersion, b5 as SimpleInterestResult, b6 as SubnetInfo, b7 as SuccessiveDiscountResult, b8 as SuccessiveDiscountStep, b9 as TaxDirection, ba as TaxEquivalentYieldDirection, bb as TaxEquivalentYieldResult, bc as TaxResult, bd as TimeValueDirection, be as TimeValueResult, bf as TipSplitResult, bg as TransferSpeedUnit, bh as TransferTimeResult, bi as USD_DENOMINATIONS, bj as UnitPriceItem, bk as UnitPriceResult, bl as UtilizationTier, bm as VideoBitrateInput, bn as VideoBitrateMode, bo as VideoBitrateResult, bp as ViewportConvertResult, bq as VinValidationResult, br as applySuccessiveDiscounts, bs as autoFormat, bt as bumpVersion, bu as calcAspectRatio, bv as calcSubnet, bw as calculateAnnuityPayout, bx as calculateBlendedLoanRate, by as calculateBreakEven, bz as calculateCashBreakdown, bA as calculateCashRounding, bB as calculateCdMaturity, bC as calculateChange, bD as calculateCompoundInterest, bE as calculateCreditCardMinimumPayment, bF as calculateCreditUtilization, bG as calculateDebtToIncomeRatio, bH as calculateDepreciationSchedule, bI as calculateDiscount, bJ as calculateEmi, bK as calculateExtraPaymentPayoff, bL as calculateFreelancerRate, bM as calculateGpa, bN as calculateLoan, bO as calculateLoanPrepaymentPenalty, bP as calculateLoanRefinance, bQ as calculateMarginMarkup, bR as calculateMortgagePoints, bS as calculateMovingAverages, bT as calculatePaybackPeriod, bU as calculatePercentageChange, bV as calculateRealRateOfReturn, bW as calculateRequiredBandwidth, bX as calculateRoi, bY as calculateRuleOf72, bZ as calculateSalesCommission, b_ as calculateSavingsGoal, b$ as calculateSimpleInterest, c0 as calculateTax, c1 as calculateTaxEquivalentYield, c2 as calculateTimeValue, c3 as calculateTipSplit, c4 as calculateTransferTime, c5 as calculateVideoBitrate, c6 as compareSemver, c7 as compareUnitPrices, c8 as convert, c9 as convertAprApy, ca as convertBytes, cb as convertIp, cc as coverBox, cd as decimalToIp, ce as decimalToIpCidr, cf as describePermissions, cg as detectNegativeAmortization, ch as estimateAudioFileSize, ci as fitIntoBox, cj as formatNumber, ck as formatValue, cl as formatVwValue, cm as formatWithSeparator, cn as gcd, co as intersectSemverRanges, cp as ipFromBinary, cq as ipFromDecimal, cr as ipFromHex, cs as ipToBinary, ct as ipToDecimal, cu as ipToDecimalCidr, cv as ipToHex, cw as ipToOctal, cx as isValid, cy as isValidCidr, cz as isValidIp, cA as isValidIpv4, cB as marginToMarkup, cC as markupToMargin, cD as octalToPermissions, cE as parseFileSize, cF as parseInput, cG as parseNumberString, cH as parseSemver, cI as permissionsToChmod, cJ as permissionsToOctal, cK as permissionsToSymbolic, cL as planDebtPayoff, cM as ptToPx, cN as pxToAll, cO as pxToViewport, cP as remToPx, cQ as satisfiesRange, cR as scaleByHeight, cS as scaleByWidth, cT as sortVersions, cU as splitSubnet, cV as symbolicToPermissions, cW as validateBarcode, cX as validateCardNumber, cY as validateIban, cZ as validateIsbn, c_ as validateIsin, c$ as validateRoutingNumber, d0 as validateVin, d1 as viewportToPx } from '../units-CG7wn_qJ.cjs';
|
package/dist/tools/units.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { A as
|
|
1
|
+
export { A as AbaFederalReserveDistrict, a as AbaRoutingNumberResult, b as AbaRoutingNumberType, c as AmortizationRow, d as AnnuityPayoutInput, e as AnnuityPayoutMode, f as AnnuityPayoutResult, g as AnnuityStructure, h as AprApyDirection, i as AprApyResult, j as AspectRatioResult, k as AudioFileSizeInput, l as AudioFileSizeMode, m as AudioFileSizeResult, B as BASE_LABELS, n as BASE_PREFIXES, o as BYTE_UNITS, p as BarcodeFormat, q as BarcodeValidationResult, r as BaseConvertResult, s as BlendedLoanRateResult, t as BreakEvenInput, v as BreakEvenResult, w as ByteConvertResult, x as ByteUnit, C as COMMON_CURRENCIES, y as COMMON_LOCALES, z as COMMON_PERMISSIONS, D as COMMON_RATIOS, E as COMMON_SIZES, F as COMMON_TAX_RATES, G as COMMON_TIP_PERCENTAGES, H as COMMON_VIEWPORTS, I as CardValidationResult, J as CashBreakdownResult, K as CashChangeResult, L as CashDenominationItem, M as CashRoundingMode, N as CashRoundingResult, O as CdMaturityResult, P as CommissionBreakdownEntry, Q as CommissionInput, R as CommissionResult, S as CommissionTier, T as CompareUnitPricesResult, U as CompoundInterestResult, V as CompoundYearRow, W as CreditAccountInput, X as CreditAccountResult, Y as CreditCardMinimumPaymentResult, Z as CreditUtilizationResult, _ as DebtItemInput, $ as DebtItemResult, a0 as DebtPayoffComparison, a1 as DebtPayoffInput, a2 as DebtPayoffPlanResult, a3 as DebtPayoffScheduleEntry, a4 as DebtPayoffStrategy, a5 as DebtPayoffStrategyResult, a6 as DebtToIncomeRatioResult, a7 as DepreciationMethod, a8 as DepreciationResult, a9 as DepreciationYear, aa as Dimensions, ab as DiscountField, ac as DiscountInput, ad as DiscountResult, ae as DtiTier, af as EmiResult, ag as EmiTenureUnit, ah as EmiYearlyBreakdownRow, ai as ExtraPaymentPayoffResult, aj as FilePermissions, ak as FileSizeUnit, al as FormatOptions, am as FreelancerRateInput, an as FreelancerRateResult, ao as GPA_GRADE_POINTS, ap as GpaCourse, aq as GpaCourseResult, ar as GpaResult, as as IbanValidationResult, at as IpConversion, au as IsbnFormat, av as IsbnResult, aw as IsinValidationResult, ax as LoanBalanceInput, ay as LoanBalanceResult, az as LoanPrepaymentPenaltyResult, aA as LoanRefinanceResult, aB as LoanResult, aC as MarginMarkupField, aD as MarginMarkupInput, aE as MarginMarkupResult, aF as MortgagePointsResult, aG as MovingAveragePoint, aH as MovingAverageResult, aI as NegativeAmortizationInput, aJ as NegativeAmortizationMonth, aK as NegativeAmortizationResult, aL as NotationStyle, aM as NumberBase, aN as PaybackPeriodInput, aO as PaybackPeriodResult, aP as PercentChangeDirection, aQ as PercentageChangeResult, aR as Permission, aS as PrepaymentPenaltyType, aT as PxConvertResult, aU as RangeIntersectionResult, aV as RealRateField, aW as RealRateOfReturnInput, aX as RealRateOfReturnResult, aY as RequiredBandwidthResult, aZ as RoiInput, a_ as RoiResult, a$ as RuleOf72Direction, b0 as RuleOf72Result, b1 as SavingsGoalInput, b2 as SavingsGoalMode, b3 as SavingsGoalResult, b4 as SemverVersion, b5 as SimpleInterestResult, b6 as SubnetInfo, b7 as SuccessiveDiscountResult, b8 as SuccessiveDiscountStep, b9 as TaxDirection, ba as TaxEquivalentYieldDirection, bb as TaxEquivalentYieldResult, bc as TaxResult, bd as TimeValueDirection, be as TimeValueResult, bf as TipSplitResult, bg as TransferSpeedUnit, bh as TransferTimeResult, bi as USD_DENOMINATIONS, bj as UnitPriceItem, bk as UnitPriceResult, bl as UtilizationTier, bm as VideoBitrateInput, bn as VideoBitrateMode, bo as VideoBitrateResult, bp as ViewportConvertResult, bq as VinValidationResult, br as applySuccessiveDiscounts, bs as autoFormat, bt as bumpVersion, bu as calcAspectRatio, bv as calcSubnet, bw as calculateAnnuityPayout, bx as calculateBlendedLoanRate, by as calculateBreakEven, bz as calculateCashBreakdown, bA as calculateCashRounding, bB as calculateCdMaturity, bC as calculateChange, bD as calculateCompoundInterest, bE as calculateCreditCardMinimumPayment, bF as calculateCreditUtilization, bG as calculateDebtToIncomeRatio, bH as calculateDepreciationSchedule, bI as calculateDiscount, bJ as calculateEmi, bK as calculateExtraPaymentPayoff, bL as calculateFreelancerRate, bM as calculateGpa, bN as calculateLoan, bO as calculateLoanPrepaymentPenalty, bP as calculateLoanRefinance, bQ as calculateMarginMarkup, bR as calculateMortgagePoints, bS as calculateMovingAverages, bT as calculatePaybackPeriod, bU as calculatePercentageChange, bV as calculateRealRateOfReturn, bW as calculateRequiredBandwidth, bX as calculateRoi, bY as calculateRuleOf72, bZ as calculateSalesCommission, b_ as calculateSavingsGoal, b$ as calculateSimpleInterest, c0 as calculateTax, c1 as calculateTaxEquivalentYield, c2 as calculateTimeValue, c3 as calculateTipSplit, c4 as calculateTransferTime, c5 as calculateVideoBitrate, c6 as compareSemver, c7 as compareUnitPrices, c8 as convert, c9 as convertAprApy, ca as convertBytes, cb as convertIp, cc as coverBox, cd as decimalToIp, ce as decimalToIpCidr, cf as describePermissions, cg as detectNegativeAmortization, ch as estimateAudioFileSize, ci as fitIntoBox, cj as formatNumber, ck as formatValue, cl as formatVwValue, cm as formatWithSeparator, cn as gcd, co as intersectSemverRanges, cp as ipFromBinary, cq as ipFromDecimal, cr as ipFromHex, cs as ipToBinary, ct as ipToDecimal, cu as ipToDecimalCidr, cv as ipToHex, cw as ipToOctal, cx as isValid, cy as isValidCidr, cz as isValidIp, cA as isValidIpv4, cB as marginToMarkup, cC as markupToMargin, cD as octalToPermissions, cE as parseFileSize, cF as parseInput, cG as parseNumberString, cH as parseSemver, cI as permissionsToChmod, cJ as permissionsToOctal, cK as permissionsToSymbolic, cL as planDebtPayoff, cM as ptToPx, cN as pxToAll, cO as pxToViewport, cP as remToPx, cQ as satisfiesRange, cR as scaleByHeight, cS as scaleByWidth, cT as sortVersions, cU as splitSubnet, cV as symbolicToPermissions, cW as validateBarcode, cX as validateCardNumber, cY as validateIban, cZ as validateIsbn, c_ as validateIsin, c$ as validateRoutingNumber, d0 as validateVin, d1 as viewportToPx } from '../units-CG7wn_qJ.js';
|
package/dist/tools/units.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { BASE_LABELS, BASE_PREFIXES, BYTE_UNITS, COMMON_CURRENCIES, COMMON_LOCALES, COMMON_PERMISSIONS, COMMON_RATIOS, COMMON_SIZES, COMMON_TAX_RATES, COMMON_TIP_PERCENTAGES, COMMON_VIEWPORTS, GPA_GRADE_POINTS, USD_DENOMINATIONS, applySuccessiveDiscounts, autoFormat, bumpVersion, calcAspectRatio, calcSubnet, calculateAnnuityPayout, calculateBlendedLoanRate, calculateBreakEven, calculateCashBreakdown, calculateCashRounding, calculateCdMaturity, calculateChange, calculateCompoundInterest, calculateCreditCardMinimumPayment, calculateCreditUtilization, calculateDebtToIncomeRatio, calculateDepreciationSchedule, calculateDiscount, calculateEmi, calculateExtraPaymentPayoff, calculateFreelancerRate, calculateGpa, calculateLoan, calculateLoanPrepaymentPenalty, calculateLoanRefinance, calculateMarginMarkup, calculateMortgagePoints, calculateMovingAverages, calculatePaybackPeriod, calculatePercentageChange, calculateRealRateOfReturn, calculateRequiredBandwidth, calculateRoi, calculateRuleOf72, calculateSalesCommission, calculateSavingsGoal, calculateSimpleInterest, calculateTax, calculateTaxEquivalentYield, calculateTimeValue, calculateTipSplit, calculateTransferTime, calculateVideoBitrate, compareSemver, compareUnitPrices, convert, convertAprApy, convertBytes, convertIp, coverBox, decimalToIp, decimalToIpCidr, describePermissions, detectNegativeAmortization, fitIntoBox, formatNumber, formatValue, formatVwValue, formatWithSeparator, gcd, intersectSemverRanges, ipFromBinary, ipFromDecimal, ipFromHex, ipToBinary, ipToDecimal, ipToDecimalCidr, ipToHex, ipToOctal, isValid, isValidCidr, isValidIp, isValidIpv4, marginToMarkup, markupToMargin, octalToPermissions, parseFileSize, parseInput, parseNumberString, parseSemver, permissionsToChmod, permissionsToOctal, permissionsToSymbolic, planDebtPayoff, ptToPx, pxToAll, pxToViewport, remToPx, satisfiesRange, scaleByHeight, scaleByWidth, sortVersions, splitSubnet, symbolicToPermissions, validateBarcode, validateCardNumber, validateIban, validateIsbn, validateIsin, validateVin, viewportToPx } from '../chunk-
|
|
1
|
+
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, GPA_GRADE_POINTS, USD_DENOMINATIONS, applySuccessiveDiscounts, autoFormat, bumpVersion, calcAspectRatio, calcSubnet, calculateAnnuityPayout, calculateBlendedLoanRate, calculateBreakEven, calculateCashBreakdown, calculateCashRounding, calculateCdMaturity, calculateChange, calculateCompoundInterest, calculateCreditCardMinimumPayment, calculateCreditUtilization, calculateDebtToIncomeRatio, calculateDepreciationSchedule, calculateDiscount, calculateEmi, calculateExtraPaymentPayoff, calculateFreelancerRate, calculateGpa, calculateLoan, calculateLoanPrepaymentPenalty, calculateLoanRefinance, calculateMarginMarkup, calculateMortgagePoints, calculateMovingAverages, calculatePaybackPeriod, calculatePercentageChange, calculateRealRateOfReturn, calculateRequiredBandwidth, calculateRoi, calculateRuleOf72, calculateSalesCommission, calculateSavingsGoal, calculateSimpleInterest, calculateTax, calculateTaxEquivalentYield, calculateTimeValue, calculateTipSplit, calculateTransferTime, calculateVideoBitrate, compareSemver, compareUnitPrices, convert, convertAprApy, convertBytes, convertIp, coverBox, decimalToIp, decimalToIpCidr, describePermissions, detectNegativeAmortization, estimateAudioFileSize, fitIntoBox, formatNumber, formatValue, formatVwValue, formatWithSeparator, gcd, intersectSemverRanges, ipFromBinary, ipFromDecimal, ipFromHex, ipToBinary, ipToDecimal, ipToDecimalCidr, ipToHex, ipToOctal, isValid, isValidCidr, isValidIp, isValidIpv4, marginToMarkup, markupToMargin, octalToPermissions, parseFileSize, parseInput, parseNumberString, parseSemver, permissionsToChmod, permissionsToOctal, permissionsToSymbolic, planDebtPayoff, ptToPx, pxToAll, pxToViewport, remToPx, satisfiesRange, scaleByHeight, scaleByWidth, sortVersions, splitSubnet, symbolicToPermissions, validateBarcode, validateCardNumber, validateIban, validateIsbn, validateIsin, validateRoutingNumber, validateVin, viewportToPx } from '../chunk-4EFSPTRH.js';
|
|
2
2
|
import '../chunk-MLKGABMK.js';
|