@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
|
@@ -25,6 +25,7 @@
|
|
|
25
25
|
* - markdown-internal-link-checker: checkMarkdownInternalLinks
|
|
26
26
|
* - yaml-duplicate-key-detector: findYamlDuplicateKeys
|
|
27
27
|
* - csv-column-stats-summarizer: summarizeCsvColumnStats
|
|
28
|
+
* - markdown-image-alt-text-auditor: auditMarkdownImageAltText
|
|
28
29
|
*/
|
|
29
30
|
interface ValidationResult {
|
|
30
31
|
valid: boolean;
|
|
@@ -656,6 +657,35 @@ interface CsvColumnStatsResult {
|
|
|
656
657
|
declare function summarizeCsvColumnStats(input: string, options?: CsvColumnStatsOptions): CsvColumnStatsResult | {
|
|
657
658
|
error: string;
|
|
658
659
|
};
|
|
660
|
+
type MarkdownImageAltIssueType = 'empty-alt' | 'generic-alt' | 'redundant-prefix' | 'filename-as-alt';
|
|
661
|
+
interface MarkdownImageEntry {
|
|
662
|
+
line: number;
|
|
663
|
+
alt: string;
|
|
664
|
+
src: string;
|
|
665
|
+
}
|
|
666
|
+
interface MarkdownImageAltIssue {
|
|
667
|
+
line: number;
|
|
668
|
+
type: MarkdownImageAltIssueType;
|
|
669
|
+
src: string;
|
|
670
|
+
message: string;
|
|
671
|
+
}
|
|
672
|
+
interface MarkdownImageAltTextAuditResult {
|
|
673
|
+
images: MarkdownImageEntry[];
|
|
674
|
+
issues: MarkdownImageAltIssue[];
|
|
675
|
+
imageCount: number;
|
|
676
|
+
}
|
|
677
|
+
/**
|
|
678
|
+
* Scan a Markdown document's inline images (``) and flag alt
|
|
679
|
+
* text accessibility smells: missing/empty alt text, a generic placeholder
|
|
680
|
+
* word used alone ("image", "photo"), alt text that's just the image's own
|
|
681
|
+
* filename, and a redundant "image of"/"photo of" prefix that screen
|
|
682
|
+
* readers already announce. Only inline image syntax is scanned;
|
|
683
|
+
* reference-style images (`![alt][ref]`) and raw HTML `<img>` tags are not
|
|
684
|
+
* detected, and fenced code blocks are skipped.
|
|
685
|
+
*/
|
|
686
|
+
declare function auditMarkdownImageAltText(markdown: string): MarkdownImageAltTextAuditResult | {
|
|
687
|
+
error: string;
|
|
688
|
+
};
|
|
659
689
|
|
|
660
690
|
type data_CaptionSpeedCue = CaptionSpeedCue;
|
|
661
691
|
type data_CaptionSpeedResult = CaptionSpeedResult;
|
|
@@ -687,6 +717,10 @@ type data_HeadingIssueType = HeadingIssueType;
|
|
|
687
717
|
type data_IniSection = IniSection;
|
|
688
718
|
type data_MarkdownAnchorHeading = MarkdownAnchorHeading;
|
|
689
719
|
type data_MarkdownAnchorLink = MarkdownAnchorLink;
|
|
720
|
+
type data_MarkdownImageAltIssue = MarkdownImageAltIssue;
|
|
721
|
+
type data_MarkdownImageAltIssueType = MarkdownImageAltIssueType;
|
|
722
|
+
type data_MarkdownImageAltTextAuditResult = MarkdownImageAltTextAuditResult;
|
|
723
|
+
type data_MarkdownImageEntry = MarkdownImageEntry;
|
|
690
724
|
type data_MarkdownInternalLinkCheckResult = MarkdownInternalLinkCheckResult;
|
|
691
725
|
type data_MarkdownTableAlignResult = MarkdownTableAlignResult;
|
|
692
726
|
type data_MarkdownTableColumnAlignment = MarkdownTableColumnAlignment;
|
|
@@ -717,6 +751,7 @@ type data_YamlDuplicateKeyError = YamlDuplicateKeyError;
|
|
|
717
751
|
type data_YamlDuplicateKeyResult = YamlDuplicateKeyResult;
|
|
718
752
|
declare const data_alignMarkdownTables: typeof alignMarkdownTables;
|
|
719
753
|
declare const data_analyzeCaptionSpeed: typeof analyzeCaptionSpeed;
|
|
754
|
+
declare const data_auditMarkdownImageAltText: typeof auditMarkdownImageAltText;
|
|
720
755
|
declare const data_calculateMarkdownTaskListProgress: typeof calculateMarkdownTaskListProgress;
|
|
721
756
|
declare const data_checkMarkdownInternalLinks: typeof checkMarkdownInternalLinks;
|
|
722
757
|
declare const data_convertSubtitles: typeof convertSubtitles;
|
|
@@ -774,7 +809,7 @@ declare const data_validateXml: typeof validateXml;
|
|
|
774
809
|
declare const data_validateYaml: typeof validateYaml;
|
|
775
810
|
declare const data_xmlToJson: typeof xmlToJson;
|
|
776
811
|
declare namespace data {
|
|
777
|
-
export { type data_CaptionSpeedCue as CaptionSpeedCue, type data_CaptionSpeedResult as CaptionSpeedResult, type data_ConvertedSubtitles as ConvertedSubtitles, type data_CsvColumnMostCommon as CsvColumnMostCommon, type data_CsvColumnStats as CsvColumnStats, type data_CsvColumnStatsOptions as CsvColumnStatsOptions, type data_CsvColumnStatsResult as CsvColumnStatsResult, type data_CsvColumnType as CsvColumnType, type data_CsvColumnTypeInfo as CsvColumnTypeInfo, type data_CsvColumnTypeOptions as CsvColumnTypeOptions, type data_CsvColumnTypeResult as CsvColumnTypeResult, type data_CsvDuplicateGroup as CsvDuplicateGroup, type data_CsvDuplicateOptions as CsvDuplicateOptions, type data_CsvDuplicateResult as CsvDuplicateResult, type data_CsvParseResult as CsvParseResult, type data_CsvToSqlOptions as CsvToSqlOptions, type data_CsvToSqlResult as CsvToSqlResult, type data_EnvDiffError as EnvDiffError, type data_EnvDiffResult as EnvDiffResult, type data_EnvEntry as EnvEntry, type data_EnvParseResult as EnvParseResult, type data_FrontMatterError as FrontMatterError, type data_FrontMatterResult as FrontMatterResult, type data_HeadingEntry as HeadingEntry, type data_HeadingHierarchyResult as HeadingHierarchyResult, type data_HeadingIssue as HeadingIssue, type data_HeadingIssueType as HeadingIssueType, type data_IniSection as IniSection, type data_MarkdownAnchorHeading as MarkdownAnchorHeading, type data_MarkdownAnchorLink as MarkdownAnchorLink, type data_MarkdownInternalLinkCheckResult as MarkdownInternalLinkCheckResult, type data_MarkdownTableAlignResult as MarkdownTableAlignResult, type data_MarkdownTableColumnAlignment as MarkdownTableColumnAlignment, type data_MarkdownTableInfo as MarkdownTableInfo, type data_MarkdownTaskListItem as MarkdownTaskListItem, type data_MarkdownTaskListProgressResult as MarkdownTaskListProgressResult, type data_MarkdownTaskListSectionSummary as MarkdownTaskListSectionSummary, type data_MarkdownTocEntry as MarkdownTocEntry, type data_MarkdownTocOptions as MarkdownTocOptions, type data_MarkdownTocResult as MarkdownTocResult, type data_NdjsonDedupeResult as NdjsonDedupeResult, type data_NdjsonLineResult as NdjsonLineResult, type data_NdjsonValidateResult as NdjsonValidateResult, type data_ParseOptions as ParseOptions, type data_ParsedIni as ParsedIni, type data_ParsedSubtitles as ParsedSubtitles, type data_SubtitleCue as SubtitleCue, type data_SubtitleFormat as SubtitleFormat, type data_TomlFormatResult as TomlFormatResult, type data_ValidationResult as ValidationResult, type data_XmlFormatResult as XmlFormatResult, type data_XmlToJsonOptions as XmlToJsonOptions, type data_YamlAnchorInfo as YamlAnchorInfo, type data_YamlAnchorResolveError as YamlAnchorResolveError, type data_YamlAnchorResolveResult as YamlAnchorResolveResult, type data_YamlDuplicateKeyEntry as YamlDuplicateKeyEntry, type data_YamlDuplicateKeyError as YamlDuplicateKeyError, type data_YamlDuplicateKeyResult as YamlDuplicateKeyResult, data_alignMarkdownTables as alignMarkdownTables, data_analyzeCaptionSpeed as analyzeCaptionSpeed, data_calculateMarkdownTaskListProgress as calculateMarkdownTaskListProgress, data_checkMarkdownInternalLinks as checkMarkdownInternalLinks, data_convertSubtitles as convertSubtitles, data_csvToJson as csvToJson, data_csvToSqlInsert as csvToSqlInsert, data_dedupeNdjson as dedupeNdjson, data_detectDelimiter as detectDelimiter, data_detectSubtitleFormat as detectSubtitleFormat, data_diffEnvExample as diffEnvExample, data_envToExport as envToExport, data_envToJson as envToJson, data_findCsvDuplicateRows as findCsvDuplicateRows, data_findYamlDuplicateKeys as findYamlDuplicateKeys, data_formatNdjson as formatNdjson, data_formatSubtitleTimestamp as formatSubtitleTimestamp, data_formatToml as formatToml, data_formatXml as formatXml, data_generateMarkdownToc as generateMarkdownToc, data_getSection as getSection, data_getSectionNames as getSectionNames, data_getTomlStats as getTomlStats, data_getXmlStats as getXmlStats, data_getYamlStats as getYamlStats, data_inferCsvColumnTypes as inferCsvColumnTypes, data_iniToJson as iniToJson, data_jsonArrayToNdjson as jsonArrayToNdjson, data_jsonToIni as jsonToIni, data_jsonToToml as jsonToToml, data_jsonToXml as jsonToXml, data_minifyNdjson as minifyNdjson, data_minifyToml as minifyToml, data_minifyXml as minifyXml, data_ndjsonToCsv as ndjsonToCsv, data_ndjsonToJsonArray as ndjsonToJsonArray, data_parseCsv as parseCsv, data_parseEnv as parseEnv, data_parseFrontMatter as parseFrontMatter, data_parseIni as parseIni, data_parseSubtitleTimestamp as parseSubtitleTimestamp, data_parseSubtitles as parseSubtitles, data_parseXmlToObject as parseXmlToObject, data_resolveYamlAnchors as resolveYamlAnchors, data_serializeSubtitles as serializeSubtitles, data_shiftSubtitles as shiftSubtitles, data_stringifyIni as stringifyIni, data_summarizeCsvColumnStats as summarizeCsvColumnStats, data_toCsvString as toCsvString, data_tomlToJson as tomlToJson, data_validateEnvKey as validateEnvKey, data_validateIni as validateIni, data_validateMarkdownHeadingHierarchy as validateMarkdownHeadingHierarchy, data_validateNdjson as validateNdjson, data_validateToml as validateToml, data_validateXml as validateXml, data_validateYaml as validateYaml, data_xmlToJson as xmlToJson };
|
|
812
|
+
export { type data_CaptionSpeedCue as CaptionSpeedCue, type data_CaptionSpeedResult as CaptionSpeedResult, type data_ConvertedSubtitles as ConvertedSubtitles, type data_CsvColumnMostCommon as CsvColumnMostCommon, type data_CsvColumnStats as CsvColumnStats, type data_CsvColumnStatsOptions as CsvColumnStatsOptions, type data_CsvColumnStatsResult as CsvColumnStatsResult, type data_CsvColumnType as CsvColumnType, type data_CsvColumnTypeInfo as CsvColumnTypeInfo, type data_CsvColumnTypeOptions as CsvColumnTypeOptions, type data_CsvColumnTypeResult as CsvColumnTypeResult, type data_CsvDuplicateGroup as CsvDuplicateGroup, type data_CsvDuplicateOptions as CsvDuplicateOptions, type data_CsvDuplicateResult as CsvDuplicateResult, type data_CsvParseResult as CsvParseResult, type data_CsvToSqlOptions as CsvToSqlOptions, type data_CsvToSqlResult as CsvToSqlResult, type data_EnvDiffError as EnvDiffError, type data_EnvDiffResult as EnvDiffResult, type data_EnvEntry as EnvEntry, type data_EnvParseResult as EnvParseResult, type data_FrontMatterError as FrontMatterError, type data_FrontMatterResult as FrontMatterResult, type data_HeadingEntry as HeadingEntry, type data_HeadingHierarchyResult as HeadingHierarchyResult, type data_HeadingIssue as HeadingIssue, type data_HeadingIssueType as HeadingIssueType, type data_IniSection as IniSection, type data_MarkdownAnchorHeading as MarkdownAnchorHeading, type data_MarkdownAnchorLink as MarkdownAnchorLink, type data_MarkdownImageAltIssue as MarkdownImageAltIssue, type data_MarkdownImageAltIssueType as MarkdownImageAltIssueType, type data_MarkdownImageAltTextAuditResult as MarkdownImageAltTextAuditResult, type data_MarkdownImageEntry as MarkdownImageEntry, type data_MarkdownInternalLinkCheckResult as MarkdownInternalLinkCheckResult, type data_MarkdownTableAlignResult as MarkdownTableAlignResult, type data_MarkdownTableColumnAlignment as MarkdownTableColumnAlignment, type data_MarkdownTableInfo as MarkdownTableInfo, type data_MarkdownTaskListItem as MarkdownTaskListItem, type data_MarkdownTaskListProgressResult as MarkdownTaskListProgressResult, type data_MarkdownTaskListSectionSummary as MarkdownTaskListSectionSummary, type data_MarkdownTocEntry as MarkdownTocEntry, type data_MarkdownTocOptions as MarkdownTocOptions, type data_MarkdownTocResult as MarkdownTocResult, type data_NdjsonDedupeResult as NdjsonDedupeResult, type data_NdjsonLineResult as NdjsonLineResult, type data_NdjsonValidateResult as NdjsonValidateResult, type data_ParseOptions as ParseOptions, type data_ParsedIni as ParsedIni, type data_ParsedSubtitles as ParsedSubtitles, type data_SubtitleCue as SubtitleCue, type data_SubtitleFormat as SubtitleFormat, type data_TomlFormatResult as TomlFormatResult, type data_ValidationResult as ValidationResult, type data_XmlFormatResult as XmlFormatResult, type data_XmlToJsonOptions as XmlToJsonOptions, type data_YamlAnchorInfo as YamlAnchorInfo, type data_YamlAnchorResolveError as YamlAnchorResolveError, type data_YamlAnchorResolveResult as YamlAnchorResolveResult, type data_YamlDuplicateKeyEntry as YamlDuplicateKeyEntry, type data_YamlDuplicateKeyError as YamlDuplicateKeyError, type data_YamlDuplicateKeyResult as YamlDuplicateKeyResult, data_alignMarkdownTables as alignMarkdownTables, data_analyzeCaptionSpeed as analyzeCaptionSpeed, data_auditMarkdownImageAltText as auditMarkdownImageAltText, data_calculateMarkdownTaskListProgress as calculateMarkdownTaskListProgress, data_checkMarkdownInternalLinks as checkMarkdownInternalLinks, data_convertSubtitles as convertSubtitles, data_csvToJson as csvToJson, data_csvToSqlInsert as csvToSqlInsert, data_dedupeNdjson as dedupeNdjson, data_detectDelimiter as detectDelimiter, data_detectSubtitleFormat as detectSubtitleFormat, data_diffEnvExample as diffEnvExample, data_envToExport as envToExport, data_envToJson as envToJson, data_findCsvDuplicateRows as findCsvDuplicateRows, data_findYamlDuplicateKeys as findYamlDuplicateKeys, data_formatNdjson as formatNdjson, data_formatSubtitleTimestamp as formatSubtitleTimestamp, data_formatToml as formatToml, data_formatXml as formatXml, data_generateMarkdownToc as generateMarkdownToc, data_getSection as getSection, data_getSectionNames as getSectionNames, data_getTomlStats as getTomlStats, data_getXmlStats as getXmlStats, data_getYamlStats as getYamlStats, data_inferCsvColumnTypes as inferCsvColumnTypes, data_iniToJson as iniToJson, data_jsonArrayToNdjson as jsonArrayToNdjson, data_jsonToIni as jsonToIni, data_jsonToToml as jsonToToml, data_jsonToXml as jsonToXml, data_minifyNdjson as minifyNdjson, data_minifyToml as minifyToml, data_minifyXml as minifyXml, data_ndjsonToCsv as ndjsonToCsv, data_ndjsonToJsonArray as ndjsonToJsonArray, data_parseCsv as parseCsv, data_parseEnv as parseEnv, data_parseFrontMatter as parseFrontMatter, data_parseIni as parseIni, data_parseSubtitleTimestamp as parseSubtitleTimestamp, data_parseSubtitles as parseSubtitles, data_parseXmlToObject as parseXmlToObject, data_resolveYamlAnchors as resolveYamlAnchors, data_serializeSubtitles as serializeSubtitles, data_shiftSubtitles as shiftSubtitles, data_stringifyIni as stringifyIni, data_summarizeCsvColumnStats as summarizeCsvColumnStats, data_toCsvString as toCsvString, data_tomlToJson as tomlToJson, data_validateEnvKey as validateEnvKey, data_validateIni as validateIni, data_validateMarkdownHeadingHierarchy as validateMarkdownHeadingHierarchy, data_validateNdjson as validateNdjson, data_validateToml as validateToml, data_validateXml as validateXml, data_validateYaml as validateYaml, data_xmlToJson as xmlToJson };
|
|
778
813
|
}
|
|
779
814
|
|
|
780
|
-
export { type
|
|
815
|
+
export { type TomlFormatResult as $, type MarkdownImageAltIssueType as A, type MarkdownImageAltTextAuditResult as B, type CaptionSpeedCue as C, type MarkdownImageEntry as D, type EnvDiffError as E, type FrontMatterError as F, type MarkdownInternalLinkCheckResult as G, type HeadingEntry as H, type IniSection as I, type MarkdownTableAlignResult as J, type MarkdownTableColumnAlignment as K, type MarkdownTableInfo as L, type MarkdownAnchorHeading as M, type MarkdownTaskListItem as N, type MarkdownTaskListProgressResult as O, type MarkdownTaskListSectionSummary as P, type MarkdownTocEntry as Q, type MarkdownTocOptions as R, type MarkdownTocResult as S, type NdjsonDedupeResult as T, type NdjsonLineResult as U, type NdjsonValidateResult as V, type ParseOptions as W, type ParsedIni as X, type ParsedSubtitles as Y, type SubtitleCue as Z, type SubtitleFormat as _, type CaptionSpeedResult as a, validateNdjson as a$, type ValidationResult as a0, type XmlFormatResult as a1, type XmlToJsonOptions as a2, type YamlAnchorInfo as a3, type YamlAnchorResolveError as a4, type YamlAnchorResolveResult as a5, type YamlDuplicateKeyEntry as a6, type YamlDuplicateKeyError as a7, type YamlDuplicateKeyResult as a8, alignMarkdownTables as a9, iniToJson as aA, jsonArrayToNdjson as aB, jsonToIni as aC, jsonToToml as aD, jsonToXml as aE, minifyNdjson as aF, minifyToml as aG, minifyXml as aH, ndjsonToCsv as aI, ndjsonToJsonArray as aJ, parseCsv as aK, parseEnv as aL, parseFrontMatter as aM, parseIni as aN, parseSubtitleTimestamp as aO, parseSubtitles as aP, parseXmlToObject as aQ, resolveYamlAnchors as aR, serializeSubtitles as aS, shiftSubtitles as aT, stringifyIni as aU, summarizeCsvColumnStats as aV, toCsvString as aW, tomlToJson as aX, validateEnvKey as aY, validateIni as aZ, validateMarkdownHeadingHierarchy as a_, analyzeCaptionSpeed as aa, auditMarkdownImageAltText as ab, calculateMarkdownTaskListProgress as ac, checkMarkdownInternalLinks as ad, convertSubtitles as ae, csvToJson as af, csvToSqlInsert as ag, dedupeNdjson as ah, detectDelimiter as ai, detectSubtitleFormat as aj, diffEnvExample as ak, envToExport as al, envToJson as am, findCsvDuplicateRows as an, findYamlDuplicateKeys as ao, formatNdjson as ap, formatSubtitleTimestamp as aq, formatToml as ar, formatXml as as, generateMarkdownToc as at, getSection as au, getSectionNames as av, getTomlStats as aw, getXmlStats as ax, getYamlStats as ay, inferCsvColumnTypes as az, type ConvertedSubtitles as b, validateToml as b0, validateXml as b1, validateYaml as b2, xmlToJson as b3, type CsvColumnMostCommon as c, data as d, type CsvColumnStats as e, type CsvColumnStatsOptions as f, type CsvColumnStatsResult as g, type CsvColumnType as h, type CsvColumnTypeInfo as i, type CsvColumnTypeOptions as j, type CsvColumnTypeResult as k, type CsvDuplicateGroup as l, type CsvDuplicateOptions as m, type CsvDuplicateResult as n, type CsvParseResult as o, type CsvToSqlOptions as p, type CsvToSqlResult as q, type EnvDiffResult as r, type EnvEntry as s, type EnvParseResult as t, type FrontMatterResult as u, type HeadingHierarchyResult as v, type HeadingIssue as w, type HeadingIssueType as x, type MarkdownAnchorLink as y, type MarkdownImageAltIssue as z };
|
package/dist/index.cjs
CHANGED
|
@@ -5637,6 +5637,7 @@ var data_exports = {};
|
|
|
5637
5637
|
__export(data_exports, {
|
|
5638
5638
|
alignMarkdownTables: () => alignMarkdownTables,
|
|
5639
5639
|
analyzeCaptionSpeed: () => analyzeCaptionSpeed,
|
|
5640
|
+
auditMarkdownImageAltText: () => auditMarkdownImageAltText,
|
|
5640
5641
|
calculateMarkdownTaskListProgress: () => calculateMarkdownTaskListProgress,
|
|
5641
5642
|
checkMarkdownInternalLinks: () => checkMarkdownInternalLinks,
|
|
5642
5643
|
convertSubtitles: () => convertSubtitles,
|
|
@@ -7853,6 +7854,90 @@ function summarizeCsvColumnStats(input, options) {
|
|
|
7853
7854
|
});
|
|
7854
7855
|
return { columns, rowCount: parsed.rows.length };
|
|
7855
7856
|
}
|
|
7857
|
+
var MARKDOWN_IMAGE_RE = /!\[([^\]]*)\]\(([^)\s]+)(?:\s+"[^"]*")?\)/g;
|
|
7858
|
+
var MARKDOWN_IMAGE_GENERIC_ALT_WORDS = /* @__PURE__ */ new Set([
|
|
7859
|
+
"image",
|
|
7860
|
+
"picture",
|
|
7861
|
+
"photo",
|
|
7862
|
+
"photograph",
|
|
7863
|
+
"pic",
|
|
7864
|
+
"img",
|
|
7865
|
+
"graphic",
|
|
7866
|
+
"screenshot",
|
|
7867
|
+
"icon",
|
|
7868
|
+
"logo"
|
|
7869
|
+
]);
|
|
7870
|
+
var MARKDOWN_IMAGE_REDUNDANT_PREFIX_RE = /^(image|picture|photo|photograph)\s+of\s+/i;
|
|
7871
|
+
var MARKDOWN_IMAGE_FILENAME_EXT_RE = /\.(png|jpe?g|gif|svg|webp|bmp|avif|tiff?)$/i;
|
|
7872
|
+
function markdownImageBasenameWithoutExt(src) {
|
|
7873
|
+
const withoutQuery = src.split(/[?#]/)[0];
|
|
7874
|
+
const file = withoutQuery.split("/").pop() ?? withoutQuery;
|
|
7875
|
+
return file.replace(MARKDOWN_IMAGE_FILENAME_EXT_RE, "");
|
|
7876
|
+
}
|
|
7877
|
+
function auditMarkdownImageAltText(markdown) {
|
|
7878
|
+
if (typeof markdown !== "string") return { error: "markdown must be a string" };
|
|
7879
|
+
const lines = markdown.replace(/\r\n/g, "\n").split("\n");
|
|
7880
|
+
const images = [];
|
|
7881
|
+
const issues = [];
|
|
7882
|
+
let inFence = false;
|
|
7883
|
+
let fenceMarker = "";
|
|
7884
|
+
lines.forEach((line, idx) => {
|
|
7885
|
+
const fenceMatch = line.match(/^\s*(```+|~~~+)/);
|
|
7886
|
+
if (fenceMatch) {
|
|
7887
|
+
if (!inFence) {
|
|
7888
|
+
inFence = true;
|
|
7889
|
+
fenceMarker = fenceMatch[1][0];
|
|
7890
|
+
} else if (fenceMatch[1][0] === fenceMarker) {
|
|
7891
|
+
inFence = false;
|
|
7892
|
+
}
|
|
7893
|
+
return;
|
|
7894
|
+
}
|
|
7895
|
+
if (inFence) return;
|
|
7896
|
+
const lineNo = idx + 1;
|
|
7897
|
+
MARKDOWN_IMAGE_RE.lastIndex = 0;
|
|
7898
|
+
let match;
|
|
7899
|
+
while ((match = MARKDOWN_IMAGE_RE.exec(line)) !== null) {
|
|
7900
|
+
const alt = match[1].trim();
|
|
7901
|
+
const src = match[2];
|
|
7902
|
+
images.push({ line: lineNo, alt, src });
|
|
7903
|
+
if (alt === "") {
|
|
7904
|
+
issues.push({
|
|
7905
|
+
line: lineNo,
|
|
7906
|
+
type: "empty-alt",
|
|
7907
|
+
src,
|
|
7908
|
+
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.`
|
|
7909
|
+
});
|
|
7910
|
+
continue;
|
|
7911
|
+
}
|
|
7912
|
+
if (MARKDOWN_IMAGE_GENERIC_ALT_WORDS.has(alt.toLowerCase())) {
|
|
7913
|
+
issues.push({
|
|
7914
|
+
line: lineNo,
|
|
7915
|
+
type: "generic-alt",
|
|
7916
|
+
src,
|
|
7917
|
+
message: `Alt text "${alt}" at line ${lineNo} is a generic placeholder and doesn't describe the image's content.`
|
|
7918
|
+
});
|
|
7919
|
+
}
|
|
7920
|
+
if (MARKDOWN_IMAGE_REDUNDANT_PREFIX_RE.test(alt)) {
|
|
7921
|
+
issues.push({
|
|
7922
|
+
line: lineNo,
|
|
7923
|
+
type: "redundant-prefix",
|
|
7924
|
+
src,
|
|
7925
|
+
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.`
|
|
7926
|
+
});
|
|
7927
|
+
}
|
|
7928
|
+
const baseName = markdownImageBasenameWithoutExt(src);
|
|
7929
|
+
if (MARKDOWN_IMAGE_FILENAME_EXT_RE.test(alt) || baseName !== "" && alt.toLowerCase() === baseName.toLowerCase()) {
|
|
7930
|
+
issues.push({
|
|
7931
|
+
line: lineNo,
|
|
7932
|
+
type: "filename-as-alt",
|
|
7933
|
+
src,
|
|
7934
|
+
message: `Alt text "${alt}" at line ${lineNo} looks like the image's own filename rather than a description.`
|
|
7935
|
+
});
|
|
7936
|
+
}
|
|
7937
|
+
}
|
|
7938
|
+
});
|
|
7939
|
+
return { images, issues, imageCount: images.length };
|
|
7940
|
+
}
|
|
7856
7941
|
|
|
7857
7942
|
// src/tools/generators.ts
|
|
7858
7943
|
var generators_exports = {};
|
|
@@ -9372,6 +9457,7 @@ __export(units_exports, {
|
|
|
9372
9457
|
decimalToIpCidr: () => decimalToIpCidr,
|
|
9373
9458
|
describePermissions: () => describePermissions,
|
|
9374
9459
|
detectNegativeAmortization: () => detectNegativeAmortization,
|
|
9460
|
+
estimateAudioFileSize: () => estimateAudioFileSize,
|
|
9375
9461
|
fitIntoBox: () => fitIntoBox,
|
|
9376
9462
|
formatNumber: () => formatNumber,
|
|
9377
9463
|
formatValue: () => formatValue,
|
|
@@ -9417,6 +9503,7 @@ __export(units_exports, {
|
|
|
9417
9503
|
validateIban: () => validateIban,
|
|
9418
9504
|
validateIsbn: () => validateIsbn,
|
|
9419
9505
|
validateIsin: () => validateIsin,
|
|
9506
|
+
validateRoutingNumber: () => validateRoutingNumber,
|
|
9420
9507
|
validateVin: () => validateVin,
|
|
9421
9508
|
viewportToPx: () => viewportToPx
|
|
9422
9509
|
});
|
|
@@ -12468,6 +12555,109 @@ function detectNegativeAmortization(input) {
|
|
|
12468
12555
|
capCrossedMonth
|
|
12469
12556
|
};
|
|
12470
12557
|
}
|
|
12558
|
+
var AUDIO_FILE_SIZE_WAV_HEADER_BYTES = 44;
|
|
12559
|
+
function estimateAudioFileSize(input) {
|
|
12560
|
+
const { mode, durationSeconds } = input;
|
|
12561
|
+
if (!Number.isFinite(durationSeconds) || durationSeconds <= 0) {
|
|
12562
|
+
return { error: "durationSeconds must be a positive number" };
|
|
12563
|
+
}
|
|
12564
|
+
const round23 = (n) => Math.round(n * 100) / 100;
|
|
12565
|
+
if (mode === "pcm") {
|
|
12566
|
+
const { sampleRateHz, bitDepth, channels } = input;
|
|
12567
|
+
if (!Number.isFinite(sampleRateHz) || sampleRateHz <= 0) {
|
|
12568
|
+
return { error: 'sampleRateHz must be a positive number for mode "pcm"' };
|
|
12569
|
+
}
|
|
12570
|
+
if (!Number.isFinite(bitDepth) || bitDepth <= 0) {
|
|
12571
|
+
return { error: 'bitDepth must be a positive number for mode "pcm"' };
|
|
12572
|
+
}
|
|
12573
|
+
if (!Number.isInteger(channels) || channels <= 0) {
|
|
12574
|
+
return { error: 'channels must be a positive whole number for mode "pcm"' };
|
|
12575
|
+
}
|
|
12576
|
+
const dataBytes = sampleRateHz * (bitDepth / 8) * channels * durationSeconds;
|
|
12577
|
+
const fileSizeBytes = dataBytes + AUDIO_FILE_SIZE_WAV_HEADER_BYTES;
|
|
12578
|
+
return {
|
|
12579
|
+
mode,
|
|
12580
|
+
durationSeconds,
|
|
12581
|
+
sampleRateHz,
|
|
12582
|
+
bitDepth,
|
|
12583
|
+
channels,
|
|
12584
|
+
dataBytes: Math.round(dataBytes),
|
|
12585
|
+
fileSizeBytes: Math.round(fileSizeBytes),
|
|
12586
|
+
fileSizeMB: round23(fileSizeBytes / 1e6),
|
|
12587
|
+
fileSizeMiB: round23(fileSizeBytes / 1048576)
|
|
12588
|
+
};
|
|
12589
|
+
}
|
|
12590
|
+
if (mode === "compressed") {
|
|
12591
|
+
const { bitrateKbps } = input;
|
|
12592
|
+
if (!Number.isFinite(bitrateKbps) || bitrateKbps <= 0) {
|
|
12593
|
+
return { error: 'bitrateKbps must be a positive number for mode "compressed"' };
|
|
12594
|
+
}
|
|
12595
|
+
const dataBytes = bitrateKbps * 1e3 * durationSeconds / 8;
|
|
12596
|
+
return {
|
|
12597
|
+
mode,
|
|
12598
|
+
durationSeconds,
|
|
12599
|
+
bitrateKbps,
|
|
12600
|
+
dataBytes: Math.round(dataBytes),
|
|
12601
|
+
fileSizeBytes: Math.round(dataBytes),
|
|
12602
|
+
fileSizeMB: round23(dataBytes / 1e6),
|
|
12603
|
+
fileSizeMiB: round23(dataBytes / 1048576)
|
|
12604
|
+
};
|
|
12605
|
+
}
|
|
12606
|
+
return { error: 'mode must be "pcm" or "compressed"' };
|
|
12607
|
+
}
|
|
12608
|
+
var ABA_FEDERAL_RESERVE_BANKS = {
|
|
12609
|
+
1: "Boston",
|
|
12610
|
+
2: "New York",
|
|
12611
|
+
3: "Philadelphia",
|
|
12612
|
+
4: "Cleveland",
|
|
12613
|
+
5: "Richmond",
|
|
12614
|
+
6: "Atlanta",
|
|
12615
|
+
7: "Chicago",
|
|
12616
|
+
8: "St. Louis",
|
|
12617
|
+
9: "Minneapolis",
|
|
12618
|
+
10: "Kansas City",
|
|
12619
|
+
11: "Dallas",
|
|
12620
|
+
12: "San Francisco"
|
|
12621
|
+
};
|
|
12622
|
+
function abaDistrictAndType(prefix) {
|
|
12623
|
+
if (prefix >= 1 && prefix <= 12) {
|
|
12624
|
+
return { type: "primary", district: { code: prefix, bank: ABA_FEDERAL_RESERVE_BANKS[prefix] } };
|
|
12625
|
+
}
|
|
12626
|
+
if (prefix >= 21 && prefix <= 32) {
|
|
12627
|
+
const code = prefix - 20;
|
|
12628
|
+
return { type: "thrift", district: { code, bank: ABA_FEDERAL_RESERVE_BANKS[code] } };
|
|
12629
|
+
}
|
|
12630
|
+
if (prefix >= 61 && prefix <= 72) {
|
|
12631
|
+
const code = prefix - 60;
|
|
12632
|
+
return { type: "electronic", district: { code, bank: ABA_FEDERAL_RESERVE_BANKS[code] } };
|
|
12633
|
+
}
|
|
12634
|
+
if (prefix === 80) {
|
|
12635
|
+
return { type: "traveler-check", district: null };
|
|
12636
|
+
}
|
|
12637
|
+
return { type: "unknown", district: null };
|
|
12638
|
+
}
|
|
12639
|
+
function formatRoutingNumber(digits) {
|
|
12640
|
+
return `${digits.slice(0, 4)} ${digits.slice(4, 8)} ${digits.slice(8)}`;
|
|
12641
|
+
}
|
|
12642
|
+
function validateRoutingNumber(input) {
|
|
12643
|
+
if (!input || !input.trim()) return { error: "Input is empty" };
|
|
12644
|
+
const digits = input.replace(/[\s-]/g, "");
|
|
12645
|
+
if (!/^\d+$/.test(digits)) return { error: "Routing number must contain only digits, spaces, or hyphens" };
|
|
12646
|
+
if (digits.length !== 9) return { error: `Routing number length (${digits.length}) must be exactly 9 digits` };
|
|
12647
|
+
const d = digits.split("").map(Number);
|
|
12648
|
+
const sum = 3 * (d[0] + d[3] + d[6]) + 7 * (d[1] + d[4] + d[7]) + 1 * (d[2] + d[5] + d[8]);
|
|
12649
|
+
const checksumValid = sum % 10 === 0;
|
|
12650
|
+
const prefix = Number(digits.slice(0, 2));
|
|
12651
|
+
const { type, district } = abaDistrictAndType(prefix);
|
|
12652
|
+
return {
|
|
12653
|
+
valid: checksumValid,
|
|
12654
|
+
checksumValid,
|
|
12655
|
+
length: digits.length,
|
|
12656
|
+
formatted: formatRoutingNumber(digits),
|
|
12657
|
+
routingNumberType: type,
|
|
12658
|
+
federalReserveDistrict: district
|
|
12659
|
+
};
|
|
12660
|
+
}
|
|
12471
12661
|
|
|
12472
12662
|
// src/tools/network.ts
|
|
12473
12663
|
var network_exports = {};
|
|
@@ -27334,6 +27524,7 @@ __export(media_exports, {
|
|
|
27334
27524
|
readPdfMetadata: () => readPdfMetadata,
|
|
27335
27525
|
readPdfOutline: () => readPdfOutline,
|
|
27336
27526
|
readPdfPageDimensions: () => readPdfPageDimensions,
|
|
27527
|
+
readPngChunks: () => readPngChunks,
|
|
27337
27528
|
readVideoInfo: () => readVideoInfo,
|
|
27338
27529
|
readWavInfo: () => readWavInfo
|
|
27339
27530
|
});
|
|
@@ -28827,6 +29018,116 @@ function readMidiInfo(bytes) {
|
|
|
28827
29018
|
tracks
|
|
28828
29019
|
};
|
|
28829
29020
|
}
|
|
29021
|
+
var PNG_SIGNATURE = [137, 80, 78, 71, 13, 10, 26, 10];
|
|
29022
|
+
var PNG_CRC_TABLE = null;
|
|
29023
|
+
function getPngCrcTable() {
|
|
29024
|
+
if (PNG_CRC_TABLE) return PNG_CRC_TABLE;
|
|
29025
|
+
const table = new Uint32Array(256);
|
|
29026
|
+
for (let n = 0; n < 256; n++) {
|
|
29027
|
+
let c = n;
|
|
29028
|
+
for (let k = 0; k < 8; k++) {
|
|
29029
|
+
c = c & 1 ? 3988292384 ^ c >>> 1 : c >>> 1;
|
|
29030
|
+
}
|
|
29031
|
+
table[n] = c;
|
|
29032
|
+
}
|
|
29033
|
+
PNG_CRC_TABLE = table;
|
|
29034
|
+
return table;
|
|
29035
|
+
}
|
|
29036
|
+
function pngCrc32(bytes) {
|
|
29037
|
+
const table = getPngCrcTable();
|
|
29038
|
+
let crc = 4294967295;
|
|
29039
|
+
for (let i = 0; i < bytes.length; i++) {
|
|
29040
|
+
crc = table[(crc ^ bytes[i]) & 255] ^ crc >>> 8;
|
|
29041
|
+
}
|
|
29042
|
+
return (crc ^ 4294967295) >>> 0;
|
|
29043
|
+
}
|
|
29044
|
+
function pad2(n) {
|
|
29045
|
+
return n < 10 ? `0${n}` : `${n}`;
|
|
29046
|
+
}
|
|
29047
|
+
function readPngChunks(bytes) {
|
|
29048
|
+
if (bytes.length < 8) return { error: "File too small to be a valid PNG file" };
|
|
29049
|
+
for (let i = 0; i < 8; i++) {
|
|
29050
|
+
if (bytes[i] !== PNG_SIGNATURE[i]) return { error: "Not a valid PNG file (bad 8-byte signature)" };
|
|
29051
|
+
}
|
|
29052
|
+
const chunks = [];
|
|
29053
|
+
const textChunks = [];
|
|
29054
|
+
let header = null;
|
|
29055
|
+
let physicalDimensions = null;
|
|
29056
|
+
let gamma = null;
|
|
29057
|
+
let lastModified = null;
|
|
29058
|
+
let isAnimated = false;
|
|
29059
|
+
let offset = 8;
|
|
29060
|
+
while (offset + 8 <= bytes.length) {
|
|
29061
|
+
const dataLength = readU32BE(bytes, offset);
|
|
29062
|
+
const type = String.fromCharCode(bytes[offset + 4], bytes[offset + 5], bytes[offset + 6], bytes[offset + 7]);
|
|
29063
|
+
const dataStart = offset + 8;
|
|
29064
|
+
const dataEnd = dataStart + dataLength;
|
|
29065
|
+
const crcOffset = dataEnd;
|
|
29066
|
+
if (crcOffset + 4 > bytes.length) {
|
|
29067
|
+
return { error: `Truncated chunk "${type}" at offset ${offset}` };
|
|
29068
|
+
}
|
|
29069
|
+
const data = bytes.subarray(dataStart, dataEnd);
|
|
29070
|
+
const expectedCrc = readU32BE(bytes, crcOffset);
|
|
29071
|
+
const actualCrc = pngCrc32(bytes.subarray(offset + 4, dataEnd));
|
|
29072
|
+
const firstChar = type.charCodeAt(0);
|
|
29073
|
+
const critical = firstChar >= 65 && firstChar <= 90;
|
|
29074
|
+
chunks.push({ type, offset, dataLength, crcValid: actualCrc === expectedCrc, critical });
|
|
29075
|
+
if (type === "IHDR" && data.length >= 13) {
|
|
29076
|
+
const colorTypeNum = data[9];
|
|
29077
|
+
header = {
|
|
29078
|
+
width: readU32BE(data, 0),
|
|
29079
|
+
height: readU32BE(data, 4),
|
|
29080
|
+
bitDepth: data[8],
|
|
29081
|
+
colorType: PNG_COLOR_TYPES[colorTypeNum] ?? "unknown",
|
|
29082
|
+
hasAlpha: colorTypeNum === 4 || colorTypeNum === 6,
|
|
29083
|
+
interlace: data[12] === 1
|
|
29084
|
+
};
|
|
29085
|
+
} else if (type === "tEXt") {
|
|
29086
|
+
const nullIdx = data.indexOf(0);
|
|
29087
|
+
if (nullIdx !== -1) {
|
|
29088
|
+
textChunks.push({
|
|
29089
|
+
keyword: Buffer.from(data.subarray(0, nullIdx)).toString("latin1"),
|
|
29090
|
+
text: Buffer.from(data.subarray(nullIdx + 1)).toString("latin1"),
|
|
29091
|
+
compressed: false
|
|
29092
|
+
});
|
|
29093
|
+
}
|
|
29094
|
+
} else if (type === "zTXt" || type === "iTXt") {
|
|
29095
|
+
const nullIdx = data.indexOf(0);
|
|
29096
|
+
if (nullIdx !== -1) {
|
|
29097
|
+
textChunks.push({ keyword: Buffer.from(data.subarray(0, nullIdx)).toString("latin1"), text: null, compressed: true });
|
|
29098
|
+
}
|
|
29099
|
+
} else if (type === "pHYs" && data.length >= 9) {
|
|
29100
|
+
physicalDimensions = {
|
|
29101
|
+
pixelsPerUnitX: readU32BE(data, 0),
|
|
29102
|
+
pixelsPerUnitY: readU32BE(data, 4),
|
|
29103
|
+
unit: data[8] === 1 ? "meter" : "unknown"
|
|
29104
|
+
};
|
|
29105
|
+
} else if (type === "gAMA" && data.length >= 4) {
|
|
29106
|
+
gamma = readU32BE(data, 0) / 1e5;
|
|
29107
|
+
} else if (type === "tIME" && data.length >= 7) {
|
|
29108
|
+
const year = data[0] << 8 | data[1];
|
|
29109
|
+
lastModified = `${year}-${pad2(data[2])}-${pad2(data[3])}T${pad2(data[4])}:${pad2(data[5])}:${pad2(data[6])}Z`;
|
|
29110
|
+
} else if (type === "acTL") {
|
|
29111
|
+
isAnimated = true;
|
|
29112
|
+
}
|
|
29113
|
+
offset = crcOffset + 4;
|
|
29114
|
+
if (type === "IEND") break;
|
|
29115
|
+
}
|
|
29116
|
+
if (chunks.length === 0) return { error: "No chunks found after the PNG signature" };
|
|
29117
|
+
if (!header) return { error: "Missing required IHDR chunk" };
|
|
29118
|
+
return {
|
|
29119
|
+
valid: true,
|
|
29120
|
+
fileSize: bytes.length,
|
|
29121
|
+
chunkCount: chunks.length,
|
|
29122
|
+
chunks,
|
|
29123
|
+
header,
|
|
29124
|
+
textChunks,
|
|
29125
|
+
physicalDimensions,
|
|
29126
|
+
gamma,
|
|
29127
|
+
lastModified,
|
|
29128
|
+
isAnimated
|
|
29129
|
+
};
|
|
29130
|
+
}
|
|
28830
29131
|
|
|
28831
29132
|
// src/index.ts
|
|
28832
29133
|
var version = "0.1.0";
|
package/dist/index.d.cts
CHANGED
|
@@ -2,10 +2,10 @@ export { j as json } from './json-Ca6gZCNB.cjs';
|
|
|
2
2
|
export { e as encoding } from './encoding-Dk3wpmb3.cjs';
|
|
3
3
|
export { h as hashing } from './hashing-CJjlvqS_.cjs';
|
|
4
4
|
export { t as text } from './text-DOopHoK3.cjs';
|
|
5
|
-
export { d as data } from './data-
|
|
5
|
+
export { d as data } from './data-Dg5dEwWl.cjs';
|
|
6
6
|
export { g as generators } from './generators-DAXXrMvG.cjs';
|
|
7
7
|
export { t as time } from './time-VMAy_SrV.cjs';
|
|
8
|
-
export { u as units } from './units-
|
|
8
|
+
export { u as units } from './units-CG7wn_qJ.cjs';
|
|
9
9
|
export { n as network } from './network-B6fQrsCc.cjs';
|
|
10
10
|
export { a as api } from './api-CQnIUrVB.cjs';
|
|
11
11
|
export { c as code } from './code-CZHElFHu.cjs';
|
|
@@ -13,7 +13,7 @@ export { c as color } from './color-tPwZCr9H.cjs';
|
|
|
13
13
|
export { c as css } from './css-Cf7AMGM-.cjs';
|
|
14
14
|
export { m as misc } from './misc-CA3N198T.cjs';
|
|
15
15
|
export { a as ai_agent } from './ai_agent-B9wWLBDf.cjs';
|
|
16
|
-
export { m as media } from './media-
|
|
16
|
+
export { m as media } from './media-C8Y67lUI.cjs';
|
|
17
17
|
|
|
18
18
|
declare const version = "0.1.0";
|
|
19
19
|
|
package/dist/index.d.ts
CHANGED
|
@@ -2,10 +2,10 @@ export { j as json } from './json-Ca6gZCNB.js';
|
|
|
2
2
|
export { e as encoding } from './encoding-Dk3wpmb3.js';
|
|
3
3
|
export { h as hashing } from './hashing-CJjlvqS_.js';
|
|
4
4
|
export { t as text } from './text-DOopHoK3.js';
|
|
5
|
-
export { d as data } from './data-
|
|
5
|
+
export { d as data } from './data-Dg5dEwWl.js';
|
|
6
6
|
export { g as generators } from './generators-DAXXrMvG.js';
|
|
7
7
|
export { t as time } from './time-VMAy_SrV.js';
|
|
8
|
-
export { u as units } from './units-
|
|
8
|
+
export { u as units } from './units-CG7wn_qJ.js';
|
|
9
9
|
export { n as network } from './network-B6fQrsCc.js';
|
|
10
10
|
export { a as api } from './api-CQnIUrVB.js';
|
|
11
11
|
export { c as code } from './code-CZHElFHu.js';
|
|
@@ -13,7 +13,7 @@ export { c as color } from './color-tPwZCr9H.js';
|
|
|
13
13
|
export { c as css } from './css-Cf7AMGM-.js';
|
|
14
14
|
export { m as misc } from './misc-CA3N198T.js';
|
|
15
15
|
export { a as ai_agent } from './ai_agent-B9wWLBDf.js';
|
|
16
|
-
export { m as media } from './media-
|
|
16
|
+
export { m as media } from './media-C8Y67lUI.js';
|
|
17
17
|
|
|
18
18
|
declare const version = "0.1.0";
|
|
19
19
|
|
package/dist/index.js
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
export { media_exports as media } from './chunk-
|
|
2
|
-
export { units_exports as units } from './chunk-
|
|
1
|
+
export { media_exports as media } from './chunk-YSS4VVZU.js';
|
|
2
|
+
export { units_exports as units } from './chunk-4EFSPTRH.js';
|
|
3
3
|
export { network_exports as network } from './chunk-K242OOF4.js';
|
|
4
4
|
export { api_exports as api } from './chunk-U2HREMZU.js';
|
|
5
5
|
export { code_exports as code } from './chunk-KRPIOHJ4.js';
|
|
@@ -11,7 +11,7 @@ export { json_exports as json } from './chunk-WUOZHCIC.js';
|
|
|
11
11
|
export { encoding_exports as encoding } from './chunk-DOWQZUTP.js';
|
|
12
12
|
export { hashing_exports as hashing } from './chunk-PET2CGTH.js';
|
|
13
13
|
export { text_exports as text } from './chunk-YQJ7CEUL.js';
|
|
14
|
-
export { data_exports as data } from './chunk-
|
|
14
|
+
export { data_exports as data } from './chunk-NTHUTIZH.js';
|
|
15
15
|
export { generators_exports as generators } from './chunk-422ICOZX.js';
|
|
16
16
|
export { time_exports as time } from './chunk-6EJVNQSY.js';
|
|
17
17
|
import './chunk-MLKGABMK.js';
|
|
@@ -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 };
|