@utilix-tech/sdk 0.68.0 → 0.69.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 CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  Full release notes for all Utilix surfaces (browser tools, REST API, SDKs, MCP server) live at [utilix.tech/changelog](https://utilix.tech/changelog). This file tracks just this package.
4
4
 
5
+ ## 0.69.0
6
+ - Add `parseCommitTrailers` (git-commit-trailer-parser): parse a commit message's trailer block (Co-authored-by, Signed-off-by, Fixes, Reviewed-by, etc.) per git's RFC 822-style trailer convention, returning each trailer's key and value plus the body with the trailer block removed.
7
+ - Add `extractMarkdownFootnotes` (markdown-footnote-extractor): extract every Markdown-Extra-style footnote reference and definition from a document, flagging references with no matching definition and definitions that are never referenced.
8
+
5
9
  ## 0.68.0
6
10
  - Add `buildRobotsMetaTag`, `parseRobotsMetaTag` (robots-meta-tag-builder): build a `<meta name="robots" content="...">` tag from the same directive vocabulary as X-Robots-Tag, optionally scoped to a crawler via the name attribute, or parse an existing tag into the same shape.
7
11
  - Add `extractSvgSpriteSymbols` (svg-sprite-symbol-extractor): parse an SVG sprite sheet's `<symbol>` definitions and list each one's id, viewBox, width, and height, alongside a ready-to-paste `<use href="#id"></use>` usage snippet.
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @utilix-tech/sdk
2
2
 
3
- **686 developer utility functions for Node.js: runs locally, no API key required.**
3
+ **688 developer utility functions for Node.js: runs locally, no API key required.**
4
4
 
5
5
  [![npm version](https://img.shields.io/npm/v/@utilix-tech/sdk?style=flat-square&color=cb3837)](https://www.npmjs.com/package/@utilix-tech/sdk)
6
6
  [![npm downloads](https://img.shields.io/npm/dm/@utilix-tech/sdk?style=flat-square)](https://www.npmjs.com/package/@utilix-tech/sdk)
@@ -796,6 +796,16 @@ auditDependencyRanges(JSON.stringify({ dependencies: { lodash: "^4.17.21", "left
796
796
  import { extractSvgSpriteSymbols } from "@utilix-tech/sdk/code";
797
797
  extractSvgSpriteSymbols('<svg><symbol id="icon-home" viewBox="0 0 24 24"></symbol></svg>');
798
798
  // { symbolCount: 1, symbols: [{ id: "icon-home", viewBox: "0 0 24 24", width: null, height: null, usageSnippet: '<svg><use href="#icon-home"></use></svg>' }], skippedCount: 0 }
799
+
800
+ // Parse a commit message's trailer block (Co-authored-by, Signed-off-by, Fixes, etc.) into key/value pairs plus the remaining body
801
+ import { parseCommitTrailers } from "@utilix-tech/sdk/code";
802
+ parseCommitTrailers("Fix bug\n\nSigned-off-by: A <a@example.com>");
803
+ // { trailers: [{ key: "Signed-off-by", value: "A <a@example.com>" }], body: "Fix bug", hasTrailers: true }
804
+
805
+ // Extract Markdown footnote references and definitions, flagging unresolved references and unused definitions
806
+ import { extractMarkdownFootnotes } from "@utilix-tech/sdk/code";
807
+ extractMarkdownFootnotes("A claim[^1].\n\n[^1]: The source.");
808
+ // { definitionCount: 1, referenceCount: 1, definitions: [{ label: "1", text: "The source." }], unresolvedReferences: [], unusedDefinitions: [] }
799
809
  ```
800
810
 
801
811
  ---
@@ -24,6 +24,7 @@ __export(code_exports, {
24
24
  detectRedos: () => detectRedos,
25
25
  envToExport: () => envToExport,
26
26
  envToJson: () => envToJson,
27
+ extractMarkdownFootnotes: () => extractMarkdownFootnotes,
27
28
  extractSvgSpriteSymbols: () => extractSvgSpriteSymbols,
28
29
  formatCss: () => formatCss,
29
30
  formatGql: () => formatGql,
@@ -42,6 +43,7 @@ __export(code_exports, {
42
43
  minifyJs: () => minifyJs,
43
44
  minifySql: () => minifySql,
44
45
  normalizeRef: () => normalizeRef,
46
+ parseCommitTrailers: () => parseCommitTrailers,
45
47
  parseDockerImage: () => parseDockerImage,
46
48
  parseEnv: () => parseEnv,
47
49
  parseGitCommand: () => parseGitCommand,
@@ -3625,5 +3627,92 @@ function extractSvgSpriteSymbols(svg) {
3625
3627
  }
3626
3628
  return { symbolCount: symbols.length, symbols, skippedCount };
3627
3629
  }
3630
+ var TRAILER_LINE_REGEX = /^([A-Za-z][A-Za-z0-9-]*): (.+)$/;
3631
+ var TRAILER_CONTINUATION_REGEX = /^[ \t]+\S/;
3632
+ function parseCommitTrailers(message) {
3633
+ const lines = message.replace(/\r\n/g, "\n").split("\n");
3634
+ while (lines.length > 0 && lines[lines.length - 1].trim() === "") lines.pop();
3635
+ if (lines.length === 0) return { error: "Empty input" };
3636
+ let start = 0;
3637
+ for (let i = lines.length - 1; i >= 0; i--) {
3638
+ if (lines[i].trim() === "") {
3639
+ start = i + 1;
3640
+ break;
3641
+ }
3642
+ }
3643
+ const paragraph = lines.slice(start);
3644
+ const trailers = [];
3645
+ let valid = true;
3646
+ for (const line of paragraph) {
3647
+ const m = line.match(TRAILER_LINE_REGEX);
3648
+ if (m) {
3649
+ trailers.push({ key: m[1], value: m[2].trim() });
3650
+ } else if (TRAILER_CONTINUATION_REGEX.test(line) && trailers.length > 0) {
3651
+ trailers[trailers.length - 1].value += " " + line.trim();
3652
+ } else {
3653
+ valid = false;
3654
+ break;
3655
+ }
3656
+ }
3657
+ if (!valid || trailers.length === 0) {
3658
+ return { trailers: [], body: lines.join("\n").trim(), hasTrailers: false };
3659
+ }
3660
+ const body = lines.slice(0, start).join("\n").trim();
3661
+ return { trailers, body, hasTrailers: true };
3662
+ }
3663
+ var FOOTNOTE_DEFINITION_LINE_REGEX = /^\[\^([^\]]+)\]:\s?(.*)$/;
3664
+ var FOOTNOTE_CONTINUATION_REGEX = /^(?: {4}|\t)/;
3665
+ var FOOTNOTE_REFERENCE_REGEX = /\[\^([^\]]+)\]/g;
3666
+ function extractMarkdownFootnotes(markdown) {
3667
+ const trimmed = markdown.trim();
3668
+ if (!trimmed) return { error: "Empty input" };
3669
+ if (!trimmed.includes("[^")) return { error: "No footnote references or definitions found" };
3670
+ const lines = markdown.replace(/\r\n/g, "\n").split("\n");
3671
+ const definitions = [];
3672
+ const definedLabels = /* @__PURE__ */ new Set();
3673
+ const consumed = new Array(lines.length).fill(false);
3674
+ let i = 0;
3675
+ while (i < lines.length) {
3676
+ const match = lines[i].match(FOOTNOTE_DEFINITION_LINE_REGEX);
3677
+ if (!match) {
3678
+ i++;
3679
+ continue;
3680
+ }
3681
+ const label = match[1];
3682
+ const textLines = [match[2]];
3683
+ consumed[i] = true;
3684
+ let j = i + 1;
3685
+ while (j < lines.length && (FOOTNOTE_CONTINUATION_REGEX.test(lines[j]) || lines[j].trim() === "" && j + 1 < lines.length && FOOTNOTE_CONTINUATION_REGEX.test(lines[j + 1]))) {
3686
+ textLines.push(lines[j].trim() === "" ? "" : lines[j].replace(FOOTNOTE_CONTINUATION_REGEX, ""));
3687
+ consumed[j] = true;
3688
+ j++;
3689
+ }
3690
+ if (!definedLabels.has(label)) {
3691
+ definedLabels.add(label);
3692
+ definitions.push({ label, text: textLines.join("\n").trim() });
3693
+ }
3694
+ i = j;
3695
+ }
3696
+ const referenceScanText = lines.filter((_, idx) => !consumed[idx]).join("\n");
3697
+ const refOrder = [];
3698
+ const refCounts = /* @__PURE__ */ new Map();
3699
+ for (const m of referenceScanText.matchAll(FOOTNOTE_REFERENCE_REGEX)) {
3700
+ const label = m[1];
3701
+ if (!refCounts.has(label)) {
3702
+ refCounts.set(label, 0);
3703
+ refOrder.push(label);
3704
+ }
3705
+ refCounts.set(label, (refCounts.get(label) ?? 0) + 1);
3706
+ }
3707
+ const references = refOrder.map((label) => ({ label, count: refCounts.get(label) ?? 0 }));
3708
+ const referencedSet = new Set(refOrder);
3709
+ const unresolvedReferences = refOrder.filter((label) => !definedLabels.has(label));
3710
+ const unusedDefinitions = definitions.filter((d) => !referencedSet.has(d.label)).map((d) => d.label);
3711
+ const referenceCount = refOrder.reduce((sum, label) => sum + (refCounts.get(label) ?? 0), 0);
3712
+ if (definitions.length === 0 && references.length === 0) {
3713
+ return { error: "No footnote references or definitions found" };
3714
+ }
3715
+ return { definitionCount: definitions.length, referenceCount, definitions, references, unresolvedReferences, unusedDefinitions };
3716
+ }
3628
3717
 
3629
- export { ALL_FLAGS, CHEATSHEET, DEFAULT_COMMIT_TYPES, MIME_TABLE, OPERATIONS, SQL_DEFAULT_OPTIONS, analyzeRegexGroups, auditDependencyRanges, buildDockerPull, buildDockerRun, buildGitCommand, code_exports, collapseHtmlWhitespace, collapseJsWhitespace, countProperties, countRules, detectDialect, detectOperationType, detectRedos, envToExport, envToJson, extractSvgSpriteSymbols, formatCss, formatGql, formatHtml, formatSql, getEndpointsByTag, getHtmlStats, getJsStats, getMethodColor, isValidTag, lintConventionalCommit, lookupMime, minifyCss, minifyGql, minifyHtml, minifyJs, minifySql, normalizeRef, parseDockerImage, parseEnv, parseGitCommand, parseGithubUrl, parseSpec, removeConsoleCalls, removeEmptyAttributes, removeHtmlComments, removeJsComments, removeRedundantAttributes, searchCheatsheet, searchEndpoints, splitStatements, testGitignorePatterns, testPattern, testRegex, validateEditorConfig, validateEnvKey, validatePackageExports, validateTsconfig };
3718
+ export { ALL_FLAGS, CHEATSHEET, DEFAULT_COMMIT_TYPES, MIME_TABLE, OPERATIONS, SQL_DEFAULT_OPTIONS, analyzeRegexGroups, auditDependencyRanges, buildDockerPull, buildDockerRun, buildGitCommand, code_exports, collapseHtmlWhitespace, collapseJsWhitespace, countProperties, countRules, detectDialect, detectOperationType, detectRedos, envToExport, envToJson, extractMarkdownFootnotes, extractSvgSpriteSymbols, formatCss, formatGql, formatHtml, formatSql, getEndpointsByTag, getHtmlStats, getJsStats, getMethodColor, isValidTag, lintConventionalCommit, lookupMime, minifyCss, minifyGql, minifyHtml, minifyJs, minifySql, normalizeRef, parseCommitTrailers, parseDockerImage, parseEnv, parseGitCommand, parseGithubUrl, parseSpec, removeConsoleCalls, removeEmptyAttributes, removeHtmlComments, removeJsComments, removeRedundantAttributes, searchCheatsheet, searchEndpoints, splitStatements, testGitignorePatterns, testPattern, testRegex, validateEditorConfig, validateEnvKey, validatePackageExports, validateTsconfig };
@@ -28,6 +28,8 @@
28
28
  * - package-json-dependency-auditor (auditDependencyRanges)
29
29
  * - regex-groups (analyzeRegexGroups)
30
30
  * - svg-sprite-symbol-extractor (extractSvgSpriteSymbols)
31
+ * - git-commit-trailer-parser (parseCommitTrailers)
32
+ * - markdown-footnote-extractor (extractMarkdownFootnotes)
31
33
  */
32
34
  type RegexFlag = 'g' | 'i' | 'm' | 's' | 'u';
33
35
  declare const ALL_FLAGS: RegexFlag[];
@@ -571,12 +573,63 @@ interface SvgSpriteResult {
571
573
  declare function extractSvgSpriteSymbols(svg: string): SvgSpriteResult | {
572
574
  error: string;
573
575
  };
576
+ interface CommitTrailer {
577
+ key: string;
578
+ value: string;
579
+ }
580
+ interface CommitTrailerResult {
581
+ trailers: CommitTrailer[];
582
+ body: string;
583
+ hasTrailers: boolean;
584
+ }
585
+ /**
586
+ * Parse a commit message's trailer block (Co-authored-by, Signed-off-by,
587
+ * Fixes, Reviewed-by, etc.) per git's RFC 822-style trailer convention
588
+ * (see `git-interpret-trailers`): the last paragraph of the message, where
589
+ * every line is either a `Key: value` pair or an indented continuation of
590
+ * the previous trailer's value. If the last paragraph doesn't consist
591
+ * entirely of trailer-shaped lines, no trailers are returned and the whole
592
+ * message is treated as body. This does not implement git's 25%-of-lines
593
+ * heuristic for a mixed last paragraph; it requires every line to match.
594
+ */
595
+ declare function parseCommitTrailers(message: string): CommitTrailerResult | {
596
+ error: string;
597
+ };
598
+ interface MarkdownFootnoteDefinition {
599
+ label: string;
600
+ text: string;
601
+ }
602
+ interface MarkdownFootnoteReference {
603
+ label: string;
604
+ count: number;
605
+ }
606
+ interface MarkdownFootnoteResult {
607
+ definitionCount: number;
608
+ referenceCount: number;
609
+ definitions: MarkdownFootnoteDefinition[];
610
+ references: MarkdownFootnoteReference[];
611
+ unresolvedReferences: string[];
612
+ unusedDefinitions: string[];
613
+ }
614
+ /**
615
+ * Extract every Markdown-Extra-style footnote reference (`[^label]`) and
616
+ * definition (`[^label]: text`, with 4-space/tab-indented continuation
617
+ * lines) from a document, then flag references with no matching definition
618
+ * and definitions that are never referenced. A `[^label]` occurring inside
619
+ * a definition's own continuation lines is not counted as a separate
620
+ * reference, since that text is part of the definition itself.
621
+ */
622
+ declare function extractMarkdownFootnotes(markdown: string): MarkdownFootnoteResult | {
623
+ error: string;
624
+ };
574
625
 
575
626
  declare const code_ALL_FLAGS: typeof ALL_FLAGS;
576
627
  type code_ApiEndpoint = ApiEndpoint;
577
628
  type code_ApiInfo = ApiInfo;
578
629
  declare const code_CHEATSHEET: typeof CHEATSHEET;
579
630
  type code_CheatsheetEntry = CheatsheetEntry;
631
+ type code_CommitTrailer = CommitTrailer;
632
+ type code_CommitTrailerResult = CommitTrailerResult;
580
633
  type code_ConventionalCommitFinding = ConventionalCommitFinding;
581
634
  type code_ConventionalCommitFooter = ConventionalCommitFooter;
582
635
  type code_ConventionalCommitOptions = ConventionalCommitOptions;
@@ -614,6 +667,9 @@ type code_HtmlMinifyResult = HtmlMinifyResult;
614
667
  type code_JsMinifyOptions = JsMinifyOptions;
615
668
  type code_JsMinifyResult = JsMinifyResult;
616
669
  declare const code_MIME_TABLE: typeof MIME_TABLE;
670
+ type code_MarkdownFootnoteDefinition = MarkdownFootnoteDefinition;
671
+ type code_MarkdownFootnoteReference = MarkdownFootnoteReference;
672
+ type code_MarkdownFootnoteResult = MarkdownFootnoteResult;
617
673
  type code_MatchResult = MatchResult;
618
674
  type code_MimeEntry = MimeEntry;
619
675
  type code_MimeLookupResult = MimeLookupResult;
@@ -655,6 +711,7 @@ declare const code_detectOperationType: typeof detectOperationType;
655
711
  declare const code_detectRedos: typeof detectRedos;
656
712
  declare const code_envToExport: typeof envToExport;
657
713
  declare const code_envToJson: typeof envToJson;
714
+ declare const code_extractMarkdownFootnotes: typeof extractMarkdownFootnotes;
658
715
  declare const code_extractSvgSpriteSymbols: typeof extractSvgSpriteSymbols;
659
716
  declare const code_formatCss: typeof formatCss;
660
717
  declare const code_formatGql: typeof formatGql;
@@ -673,6 +730,7 @@ declare const code_minifyHtml: typeof minifyHtml;
673
730
  declare const code_minifyJs: typeof minifyJs;
674
731
  declare const code_minifySql: typeof minifySql;
675
732
  declare const code_normalizeRef: typeof normalizeRef;
733
+ declare const code_parseCommitTrailers: typeof parseCommitTrailers;
676
734
  declare const code_parseDockerImage: typeof parseDockerImage;
677
735
  declare const code_parseEnv: typeof parseEnv;
678
736
  declare const code_parseGitCommand: typeof parseGitCommand;
@@ -694,7 +752,7 @@ declare const code_validateEnvKey: typeof validateEnvKey;
694
752
  declare const code_validatePackageExports: typeof validatePackageExports;
695
753
  declare const code_validateTsconfig: typeof validateTsconfig;
696
754
  declare namespace code {
697
- export { code_ALL_FLAGS as ALL_FLAGS, type code_ApiEndpoint as ApiEndpoint, type code_ApiInfo as ApiInfo, code_CHEATSHEET as CHEATSHEET, type code_CheatsheetEntry as CheatsheetEntry, type code_ConventionalCommitFinding as ConventionalCommitFinding, type code_ConventionalCommitFooter as ConventionalCommitFooter, type code_ConventionalCommitOptions as ConventionalCommitOptions, type code_ConventionalCommitParsed as ConventionalCommitParsed, type code_ConventionalCommitResult as ConventionalCommitResult, type code_ConventionalCommitSeverity as ConventionalCommitSeverity, type code_CssResult as CssResult, code_DEFAULT_COMMIT_TYPES as DEFAULT_COMMIT_TYPES, type code_DependencyAuditDuplicate as DependencyAuditDuplicate, type code_DependencyAuditEntry as DependencyAuditEntry, type code_DependencyAuditIssue as DependencyAuditIssue, type code_DependencyAuditResult as DependencyAuditResult, type code_DependencyRangeType as DependencyRangeType, type code_DependencySection as DependencySection, type code_DockerImageRef as DockerImageRef, type code_EditorConfigIssue as EditorConfigIssue, type code_EditorConfigProperty as EditorConfigProperty, type code_EditorConfigSection as EditorConfigSection, type code_EditorConfigValidationResult as EditorConfigValidationResult, type code_EnvEntry as EnvEntry, type code_EnvParseResult as EnvParseResult, type code_ExportsIssue as ExportsIssue, type code_ExportsShape as ExportsShape, type code_ExportsValidationResult as ExportsValidationResult, type code_GitCommandConfig as GitCommandConfig, type code_GitCommandResult as GitCommandResult, type code_GitOperation as GitOperation, type code_GithubUrlInfo as GithubUrlInfo, type code_GithubUrlType as GithubUrlType, type code_GitignoreTestResult as GitignoreTestResult, type code_GqlFormatResult as GqlFormatResult, type code_HtmlFormatResult as HtmlFormatResult, type code_HtmlMinifyOptions as HtmlMinifyOptions, type code_HtmlMinifyResult as HtmlMinifyResult, type code_JsMinifyOptions as JsMinifyOptions, type code_JsMinifyResult as JsMinifyResult, code_MIME_TABLE as MIME_TABLE, type code_MatchResult as MatchResult, type code_MimeEntry as MimeEntry, type code_MimeLookupResult as MimeLookupResult, code_OPERATIONS as OPERATIONS, type code_ParsedSpec as ParsedSpec, type code_RedosFinding as RedosFinding, type code_RedosResult as RedosResult, type code_RedosSeverity as RedosSeverity, type code_RegexBackreferenceInfo as RegexBackreferenceInfo, type code_RegexError as RegexError, type code_RegexFlag as RegexFlag, type code_RegexGroupAnalysis as RegexGroupAnalysis, type code_RegexGroupInfo as RegexGroupInfo, type code_RegexGroupIssue as RegexGroupIssue, type code_RegexMatch as RegexMatch, type code_RegexResult as RegexResult, type code_RegexSuccess as RegexSuccess, code_SQL_DEFAULT_OPTIONS as SQL_DEFAULT_OPTIONS, type code_Segment as Segment, type code_SpecVersion as SpecVersion, type code_SqlDialect as SqlDialect, type code_SqlFormatOptions as SqlFormatOptions, type code_SvgSpriteResult as SvgSpriteResult, type code_SvgSpriteSymbol as SvgSpriteSymbol, type code_TestPatternResult as TestPatternResult, type code_TsconfigIssue as TsconfigIssue, type code_TsconfigValidationResult as TsconfigValidationResult, code_analyzeRegexGroups as analyzeRegexGroups, code_auditDependencyRanges as auditDependencyRanges, code_buildDockerPull as buildDockerPull, code_buildDockerRun as buildDockerRun, code_buildGitCommand as buildGitCommand, code_collapseHtmlWhitespace as collapseHtmlWhitespace, code_collapseJsWhitespace as collapseJsWhitespace, code_countProperties as countProperties, code_countRules as countRules, code_detectDialect as detectDialect, code_detectOperationType as detectOperationType, code_detectRedos as detectRedos, code_envToExport as envToExport, code_envToJson as envToJson, code_extractSvgSpriteSymbols as extractSvgSpriteSymbols, code_formatCss as formatCss, code_formatGql as formatGql, code_formatHtml as formatHtml, code_formatSql as formatSql, code_getEndpointsByTag as getEndpointsByTag, code_getHtmlStats as getHtmlStats, code_getJsStats as getJsStats, code_getMethodColor as getMethodColor, code_isValidTag as isValidTag, code_lintConventionalCommit as lintConventionalCommit, code_lookupMime as lookupMime, code_minifyCss as minifyCss, code_minifyGql as minifyGql, code_minifyHtml as minifyHtml, code_minifyJs as minifyJs, code_minifySql as minifySql, code_normalizeRef as normalizeRef, code_parseDockerImage as parseDockerImage, code_parseEnv as parseEnv, code_parseGitCommand as parseGitCommand, code_parseGithubUrl as parseGithubUrl, code_parseSpec as parseSpec, code_removeConsoleCalls as removeConsoleCalls, code_removeEmptyAttributes as removeEmptyAttributes, code_removeHtmlComments as removeHtmlComments, code_removeJsComments as removeJsComments, code_removeRedundantAttributes as removeRedundantAttributes, code_searchCheatsheet as searchCheatsheet, code_searchEndpoints as searchEndpoints, code_splitStatements as splitStatements, code_testGitignorePatterns as testGitignorePatterns, code_testPattern as testPattern, code_testRegex as testRegex, code_validateEditorConfig as validateEditorConfig, code_validateEnvKey as validateEnvKey, code_validatePackageExports as validatePackageExports, code_validateTsconfig as validateTsconfig };
755
+ export { code_ALL_FLAGS as ALL_FLAGS, type code_ApiEndpoint as ApiEndpoint, type code_ApiInfo as ApiInfo, code_CHEATSHEET as CHEATSHEET, type code_CheatsheetEntry as CheatsheetEntry, type code_CommitTrailer as CommitTrailer, type code_CommitTrailerResult as CommitTrailerResult, type code_ConventionalCommitFinding as ConventionalCommitFinding, type code_ConventionalCommitFooter as ConventionalCommitFooter, type code_ConventionalCommitOptions as ConventionalCommitOptions, type code_ConventionalCommitParsed as ConventionalCommitParsed, type code_ConventionalCommitResult as ConventionalCommitResult, type code_ConventionalCommitSeverity as ConventionalCommitSeverity, type code_CssResult as CssResult, code_DEFAULT_COMMIT_TYPES as DEFAULT_COMMIT_TYPES, type code_DependencyAuditDuplicate as DependencyAuditDuplicate, type code_DependencyAuditEntry as DependencyAuditEntry, type code_DependencyAuditIssue as DependencyAuditIssue, type code_DependencyAuditResult as DependencyAuditResult, type code_DependencyRangeType as DependencyRangeType, type code_DependencySection as DependencySection, type code_DockerImageRef as DockerImageRef, type code_EditorConfigIssue as EditorConfigIssue, type code_EditorConfigProperty as EditorConfigProperty, type code_EditorConfigSection as EditorConfigSection, type code_EditorConfigValidationResult as EditorConfigValidationResult, type code_EnvEntry as EnvEntry, type code_EnvParseResult as EnvParseResult, type code_ExportsIssue as ExportsIssue, type code_ExportsShape as ExportsShape, type code_ExportsValidationResult as ExportsValidationResult, type code_GitCommandConfig as GitCommandConfig, type code_GitCommandResult as GitCommandResult, type code_GitOperation as GitOperation, type code_GithubUrlInfo as GithubUrlInfo, type code_GithubUrlType as GithubUrlType, type code_GitignoreTestResult as GitignoreTestResult, type code_GqlFormatResult as GqlFormatResult, type code_HtmlFormatResult as HtmlFormatResult, type code_HtmlMinifyOptions as HtmlMinifyOptions, type code_HtmlMinifyResult as HtmlMinifyResult, type code_JsMinifyOptions as JsMinifyOptions, type code_JsMinifyResult as JsMinifyResult, code_MIME_TABLE as MIME_TABLE, type code_MarkdownFootnoteDefinition as MarkdownFootnoteDefinition, type code_MarkdownFootnoteReference as MarkdownFootnoteReference, type code_MarkdownFootnoteResult as MarkdownFootnoteResult, type code_MatchResult as MatchResult, type code_MimeEntry as MimeEntry, type code_MimeLookupResult as MimeLookupResult, code_OPERATIONS as OPERATIONS, type code_ParsedSpec as ParsedSpec, type code_RedosFinding as RedosFinding, type code_RedosResult as RedosResult, type code_RedosSeverity as RedosSeverity, type code_RegexBackreferenceInfo as RegexBackreferenceInfo, type code_RegexError as RegexError, type code_RegexFlag as RegexFlag, type code_RegexGroupAnalysis as RegexGroupAnalysis, type code_RegexGroupInfo as RegexGroupInfo, type code_RegexGroupIssue as RegexGroupIssue, type code_RegexMatch as RegexMatch, type code_RegexResult as RegexResult, type code_RegexSuccess as RegexSuccess, code_SQL_DEFAULT_OPTIONS as SQL_DEFAULT_OPTIONS, type code_Segment as Segment, type code_SpecVersion as SpecVersion, type code_SqlDialect as SqlDialect, type code_SqlFormatOptions as SqlFormatOptions, type code_SvgSpriteResult as SvgSpriteResult, type code_SvgSpriteSymbol as SvgSpriteSymbol, type code_TestPatternResult as TestPatternResult, type code_TsconfigIssue as TsconfigIssue, type code_TsconfigValidationResult as TsconfigValidationResult, code_analyzeRegexGroups as analyzeRegexGroups, code_auditDependencyRanges as auditDependencyRanges, code_buildDockerPull as buildDockerPull, code_buildDockerRun as buildDockerRun, code_buildGitCommand as buildGitCommand, code_collapseHtmlWhitespace as collapseHtmlWhitespace, code_collapseJsWhitespace as collapseJsWhitespace, code_countProperties as countProperties, code_countRules as countRules, code_detectDialect as detectDialect, code_detectOperationType as detectOperationType, code_detectRedos as detectRedos, code_envToExport as envToExport, code_envToJson as envToJson, code_extractMarkdownFootnotes as extractMarkdownFootnotes, code_extractSvgSpriteSymbols as extractSvgSpriteSymbols, code_formatCss as formatCss, code_formatGql as formatGql, code_formatHtml as formatHtml, code_formatSql as formatSql, code_getEndpointsByTag as getEndpointsByTag, code_getHtmlStats as getHtmlStats, code_getJsStats as getJsStats, code_getMethodColor as getMethodColor, code_isValidTag as isValidTag, code_lintConventionalCommit as lintConventionalCommit, code_lookupMime as lookupMime, code_minifyCss as minifyCss, code_minifyGql as minifyGql, code_minifyHtml as minifyHtml, code_minifyJs as minifyJs, code_minifySql as minifySql, code_normalizeRef as normalizeRef, code_parseCommitTrailers as parseCommitTrailers, code_parseDockerImage as parseDockerImage, code_parseEnv as parseEnv, code_parseGitCommand as parseGitCommand, code_parseGithubUrl as parseGithubUrl, code_parseSpec as parseSpec, code_removeConsoleCalls as removeConsoleCalls, code_removeEmptyAttributes as removeEmptyAttributes, code_removeHtmlComments as removeHtmlComments, code_removeJsComments as removeJsComments, code_removeRedundantAttributes as removeRedundantAttributes, code_searchCheatsheet as searchCheatsheet, code_searchEndpoints as searchEndpoints, code_splitStatements as splitStatements, code_testGitignorePatterns as testGitignorePatterns, code_testPattern as testPattern, code_testRegex as testRegex, code_validateEditorConfig as validateEditorConfig, code_validateEnvKey as validateEnvKey, code_validatePackageExports as validatePackageExports, code_validateTsconfig as validateTsconfig };
698
756
  }
699
757
 
700
- export { type RegexFlag as $, ALL_FLAGS as A, type GitCommandResult as B, CHEATSHEET as C, DEFAULT_COMMIT_TYPES as D, type EditorConfigIssue as E, type GitOperation as F, type GitCommandConfig as G, type GithubUrlInfo as H, type GithubUrlType as I, type GitignoreTestResult as J, type GqlFormatResult as K, type HtmlFormatResult as L, type HtmlMinifyOptions as M, type HtmlMinifyResult as N, type JsMinifyOptions as O, type JsMinifyResult as P, MIME_TABLE as Q, type MatchResult as R, type MimeEntry as S, type MimeLookupResult as T, OPERATIONS as U, type ParsedSpec as V, type RedosFinding as W, type RedosResult as X, type RedosSeverity as Y, type RegexBackreferenceInfo as Z, type RegexError as _, type ApiEndpoint as a, testRegex as a$, type RegexGroupAnalysis as a0, type RegexGroupInfo as a1, type RegexGroupIssue as a2, type RegexMatch as a3, type RegexResult as a4, type RegexSuccess as a5, SQL_DEFAULT_OPTIONS as a6, type Segment as a7, type SpecVersion as a8, type SqlDialect as a9, getHtmlStats as aA, getJsStats as aB, getMethodColor as aC, isValidTag as aD, lintConventionalCommit as aE, lookupMime as aF, minifyCss as aG, minifyGql as aH, minifyHtml as aI, minifyJs as aJ, minifySql as aK, normalizeRef as aL, parseDockerImage as aM, parseEnv as aN, parseGitCommand as aO, parseGithubUrl as aP, parseSpec as aQ, removeConsoleCalls as aR, removeEmptyAttributes as aS, removeHtmlComments as aT, removeJsComments as aU, removeRedundantAttributes as aV, searchCheatsheet as aW, searchEndpoints as aX, splitStatements as aY, testGitignorePatterns as aZ, testPattern as a_, type SqlFormatOptions as aa, type SvgSpriteResult as ab, type SvgSpriteSymbol as ac, type TestPatternResult as ad, type TsconfigIssue as ae, type TsconfigValidationResult as af, analyzeRegexGroups as ag, auditDependencyRanges as ah, buildDockerPull as ai, buildDockerRun as aj, buildGitCommand as ak, collapseHtmlWhitespace as al, collapseJsWhitespace as am, countProperties as an, countRules as ao, detectDialect as ap, detectOperationType as aq, detectRedos as ar, envToExport as as, envToJson as at, extractSvgSpriteSymbols as au, formatCss as av, formatGql as aw, formatHtml as ax, formatSql as ay, getEndpointsByTag as az, type ApiInfo as b, validateEditorConfig as b0, validateEnvKey as b1, validatePackageExports as b2, validateTsconfig as b3, code as c, type CheatsheetEntry as d, type ConventionalCommitFinding as e, type ConventionalCommitFooter as f, type ConventionalCommitOptions as g, type ConventionalCommitParsed as h, type ConventionalCommitResult as i, type ConventionalCommitSeverity as j, type CssResult as k, type DependencyAuditDuplicate as l, type DependencyAuditEntry as m, type DependencyAuditIssue as n, type DependencyAuditResult as o, type DependencyRangeType as p, type DependencySection as q, type DockerImageRef as r, type EditorConfigProperty as s, type EditorConfigSection as t, type EditorConfigValidationResult as u, type EnvEntry as v, type EnvParseResult as w, type ExportsIssue as x, type ExportsShape as y, type ExportsValidationResult as z };
758
+ export { type RedosFinding as $, ALL_FLAGS as A, type ExportsShape as B, CHEATSHEET as C, DEFAULT_COMMIT_TYPES as D, type EditorConfigIssue as E, type ExportsValidationResult as F, type GitCommandConfig as G, type GitCommandResult as H, type GitOperation as I, type GithubUrlInfo as J, type GithubUrlType as K, type GitignoreTestResult as L, type GqlFormatResult as M, type HtmlFormatResult as N, type HtmlMinifyOptions as O, type HtmlMinifyResult as P, type JsMinifyOptions as Q, type JsMinifyResult as R, MIME_TABLE as S, type MarkdownFootnoteDefinition as T, type MarkdownFootnoteReference as U, type MarkdownFootnoteResult as V, type MatchResult as W, type MimeEntry as X, type MimeLookupResult as Y, OPERATIONS as Z, type ParsedSpec as _, type ApiEndpoint as a, removeJsComments as a$, type RedosResult as a0, type RedosSeverity as a1, type RegexBackreferenceInfo as a2, type RegexError as a3, type RegexFlag as a4, type RegexGroupAnalysis as a5, type RegexGroupInfo as a6, type RegexGroupIssue as a7, type RegexMatch as a8, type RegexResult as a9, extractSvgSpriteSymbols as aA, formatCss as aB, formatGql as aC, formatHtml as aD, formatSql as aE, getEndpointsByTag as aF, getHtmlStats as aG, getJsStats as aH, getMethodColor as aI, isValidTag as aJ, lintConventionalCommit as aK, lookupMime as aL, minifyCss as aM, minifyGql as aN, minifyHtml as aO, minifyJs as aP, minifySql as aQ, normalizeRef as aR, parseCommitTrailers as aS, parseDockerImage as aT, parseEnv as aU, parseGitCommand as aV, parseGithubUrl as aW, parseSpec as aX, removeConsoleCalls as aY, removeEmptyAttributes as aZ, removeHtmlComments as a_, type RegexSuccess as aa, SQL_DEFAULT_OPTIONS as ab, type Segment as ac, type SpecVersion as ad, type SqlDialect as ae, type SqlFormatOptions as af, type SvgSpriteResult as ag, type SvgSpriteSymbol as ah, type TestPatternResult as ai, type TsconfigIssue as aj, type TsconfigValidationResult as ak, analyzeRegexGroups as al, auditDependencyRanges as am, buildDockerPull as an, buildDockerRun as ao, buildGitCommand as ap, collapseHtmlWhitespace as aq, collapseJsWhitespace as ar, countProperties as as, countRules as at, detectDialect as au, detectOperationType as av, detectRedos as aw, envToExport as ax, envToJson as ay, extractMarkdownFootnotes as az, type ApiInfo as b, removeRedundantAttributes as b0, searchCheatsheet as b1, searchEndpoints as b2, splitStatements as b3, testGitignorePatterns as b4, testPattern as b5, testRegex as b6, validateEditorConfig as b7, validateEnvKey as b8, validatePackageExports as b9, validateTsconfig as ba, code as c, type CheatsheetEntry as d, type CommitTrailer as e, type CommitTrailerResult as f, type ConventionalCommitFinding as g, type ConventionalCommitFooter as h, type ConventionalCommitOptions as i, type ConventionalCommitParsed as j, type ConventionalCommitResult as k, type ConventionalCommitSeverity as l, type CssResult as m, type DependencyAuditDuplicate as n, type DependencyAuditEntry as o, type DependencyAuditIssue as p, type DependencyAuditResult as q, type DependencyRangeType as r, type DependencySection as s, type DockerImageRef as t, type EditorConfigProperty as u, type EditorConfigSection as v, type EditorConfigValidationResult as w, type EnvEntry as x, type EnvParseResult as y, type ExportsIssue as z };
@@ -28,6 +28,8 @@
28
28
  * - package-json-dependency-auditor (auditDependencyRanges)
29
29
  * - regex-groups (analyzeRegexGroups)
30
30
  * - svg-sprite-symbol-extractor (extractSvgSpriteSymbols)
31
+ * - git-commit-trailer-parser (parseCommitTrailers)
32
+ * - markdown-footnote-extractor (extractMarkdownFootnotes)
31
33
  */
32
34
  type RegexFlag = 'g' | 'i' | 'm' | 's' | 'u';
33
35
  declare const ALL_FLAGS: RegexFlag[];
@@ -571,12 +573,63 @@ interface SvgSpriteResult {
571
573
  declare function extractSvgSpriteSymbols(svg: string): SvgSpriteResult | {
572
574
  error: string;
573
575
  };
576
+ interface CommitTrailer {
577
+ key: string;
578
+ value: string;
579
+ }
580
+ interface CommitTrailerResult {
581
+ trailers: CommitTrailer[];
582
+ body: string;
583
+ hasTrailers: boolean;
584
+ }
585
+ /**
586
+ * Parse a commit message's trailer block (Co-authored-by, Signed-off-by,
587
+ * Fixes, Reviewed-by, etc.) per git's RFC 822-style trailer convention
588
+ * (see `git-interpret-trailers`): the last paragraph of the message, where
589
+ * every line is either a `Key: value` pair or an indented continuation of
590
+ * the previous trailer's value. If the last paragraph doesn't consist
591
+ * entirely of trailer-shaped lines, no trailers are returned and the whole
592
+ * message is treated as body. This does not implement git's 25%-of-lines
593
+ * heuristic for a mixed last paragraph; it requires every line to match.
594
+ */
595
+ declare function parseCommitTrailers(message: string): CommitTrailerResult | {
596
+ error: string;
597
+ };
598
+ interface MarkdownFootnoteDefinition {
599
+ label: string;
600
+ text: string;
601
+ }
602
+ interface MarkdownFootnoteReference {
603
+ label: string;
604
+ count: number;
605
+ }
606
+ interface MarkdownFootnoteResult {
607
+ definitionCount: number;
608
+ referenceCount: number;
609
+ definitions: MarkdownFootnoteDefinition[];
610
+ references: MarkdownFootnoteReference[];
611
+ unresolvedReferences: string[];
612
+ unusedDefinitions: string[];
613
+ }
614
+ /**
615
+ * Extract every Markdown-Extra-style footnote reference (`[^label]`) and
616
+ * definition (`[^label]: text`, with 4-space/tab-indented continuation
617
+ * lines) from a document, then flag references with no matching definition
618
+ * and definitions that are never referenced. A `[^label]` occurring inside
619
+ * a definition's own continuation lines is not counted as a separate
620
+ * reference, since that text is part of the definition itself.
621
+ */
622
+ declare function extractMarkdownFootnotes(markdown: string): MarkdownFootnoteResult | {
623
+ error: string;
624
+ };
574
625
 
575
626
  declare const code_ALL_FLAGS: typeof ALL_FLAGS;
576
627
  type code_ApiEndpoint = ApiEndpoint;
577
628
  type code_ApiInfo = ApiInfo;
578
629
  declare const code_CHEATSHEET: typeof CHEATSHEET;
579
630
  type code_CheatsheetEntry = CheatsheetEntry;
631
+ type code_CommitTrailer = CommitTrailer;
632
+ type code_CommitTrailerResult = CommitTrailerResult;
580
633
  type code_ConventionalCommitFinding = ConventionalCommitFinding;
581
634
  type code_ConventionalCommitFooter = ConventionalCommitFooter;
582
635
  type code_ConventionalCommitOptions = ConventionalCommitOptions;
@@ -614,6 +667,9 @@ type code_HtmlMinifyResult = HtmlMinifyResult;
614
667
  type code_JsMinifyOptions = JsMinifyOptions;
615
668
  type code_JsMinifyResult = JsMinifyResult;
616
669
  declare const code_MIME_TABLE: typeof MIME_TABLE;
670
+ type code_MarkdownFootnoteDefinition = MarkdownFootnoteDefinition;
671
+ type code_MarkdownFootnoteReference = MarkdownFootnoteReference;
672
+ type code_MarkdownFootnoteResult = MarkdownFootnoteResult;
617
673
  type code_MatchResult = MatchResult;
618
674
  type code_MimeEntry = MimeEntry;
619
675
  type code_MimeLookupResult = MimeLookupResult;
@@ -655,6 +711,7 @@ declare const code_detectOperationType: typeof detectOperationType;
655
711
  declare const code_detectRedos: typeof detectRedos;
656
712
  declare const code_envToExport: typeof envToExport;
657
713
  declare const code_envToJson: typeof envToJson;
714
+ declare const code_extractMarkdownFootnotes: typeof extractMarkdownFootnotes;
658
715
  declare const code_extractSvgSpriteSymbols: typeof extractSvgSpriteSymbols;
659
716
  declare const code_formatCss: typeof formatCss;
660
717
  declare const code_formatGql: typeof formatGql;
@@ -673,6 +730,7 @@ declare const code_minifyHtml: typeof minifyHtml;
673
730
  declare const code_minifyJs: typeof minifyJs;
674
731
  declare const code_minifySql: typeof minifySql;
675
732
  declare const code_normalizeRef: typeof normalizeRef;
733
+ declare const code_parseCommitTrailers: typeof parseCommitTrailers;
676
734
  declare const code_parseDockerImage: typeof parseDockerImage;
677
735
  declare const code_parseEnv: typeof parseEnv;
678
736
  declare const code_parseGitCommand: typeof parseGitCommand;
@@ -694,7 +752,7 @@ declare const code_validateEnvKey: typeof validateEnvKey;
694
752
  declare const code_validatePackageExports: typeof validatePackageExports;
695
753
  declare const code_validateTsconfig: typeof validateTsconfig;
696
754
  declare namespace code {
697
- export { code_ALL_FLAGS as ALL_FLAGS, type code_ApiEndpoint as ApiEndpoint, type code_ApiInfo as ApiInfo, code_CHEATSHEET as CHEATSHEET, type code_CheatsheetEntry as CheatsheetEntry, type code_ConventionalCommitFinding as ConventionalCommitFinding, type code_ConventionalCommitFooter as ConventionalCommitFooter, type code_ConventionalCommitOptions as ConventionalCommitOptions, type code_ConventionalCommitParsed as ConventionalCommitParsed, type code_ConventionalCommitResult as ConventionalCommitResult, type code_ConventionalCommitSeverity as ConventionalCommitSeverity, type code_CssResult as CssResult, code_DEFAULT_COMMIT_TYPES as DEFAULT_COMMIT_TYPES, type code_DependencyAuditDuplicate as DependencyAuditDuplicate, type code_DependencyAuditEntry as DependencyAuditEntry, type code_DependencyAuditIssue as DependencyAuditIssue, type code_DependencyAuditResult as DependencyAuditResult, type code_DependencyRangeType as DependencyRangeType, type code_DependencySection as DependencySection, type code_DockerImageRef as DockerImageRef, type code_EditorConfigIssue as EditorConfigIssue, type code_EditorConfigProperty as EditorConfigProperty, type code_EditorConfigSection as EditorConfigSection, type code_EditorConfigValidationResult as EditorConfigValidationResult, type code_EnvEntry as EnvEntry, type code_EnvParseResult as EnvParseResult, type code_ExportsIssue as ExportsIssue, type code_ExportsShape as ExportsShape, type code_ExportsValidationResult as ExportsValidationResult, type code_GitCommandConfig as GitCommandConfig, type code_GitCommandResult as GitCommandResult, type code_GitOperation as GitOperation, type code_GithubUrlInfo as GithubUrlInfo, type code_GithubUrlType as GithubUrlType, type code_GitignoreTestResult as GitignoreTestResult, type code_GqlFormatResult as GqlFormatResult, type code_HtmlFormatResult as HtmlFormatResult, type code_HtmlMinifyOptions as HtmlMinifyOptions, type code_HtmlMinifyResult as HtmlMinifyResult, type code_JsMinifyOptions as JsMinifyOptions, type code_JsMinifyResult as JsMinifyResult, code_MIME_TABLE as MIME_TABLE, type code_MatchResult as MatchResult, type code_MimeEntry as MimeEntry, type code_MimeLookupResult as MimeLookupResult, code_OPERATIONS as OPERATIONS, type code_ParsedSpec as ParsedSpec, type code_RedosFinding as RedosFinding, type code_RedosResult as RedosResult, type code_RedosSeverity as RedosSeverity, type code_RegexBackreferenceInfo as RegexBackreferenceInfo, type code_RegexError as RegexError, type code_RegexFlag as RegexFlag, type code_RegexGroupAnalysis as RegexGroupAnalysis, type code_RegexGroupInfo as RegexGroupInfo, type code_RegexGroupIssue as RegexGroupIssue, type code_RegexMatch as RegexMatch, type code_RegexResult as RegexResult, type code_RegexSuccess as RegexSuccess, code_SQL_DEFAULT_OPTIONS as SQL_DEFAULT_OPTIONS, type code_Segment as Segment, type code_SpecVersion as SpecVersion, type code_SqlDialect as SqlDialect, type code_SqlFormatOptions as SqlFormatOptions, type code_SvgSpriteResult as SvgSpriteResult, type code_SvgSpriteSymbol as SvgSpriteSymbol, type code_TestPatternResult as TestPatternResult, type code_TsconfigIssue as TsconfigIssue, type code_TsconfigValidationResult as TsconfigValidationResult, code_analyzeRegexGroups as analyzeRegexGroups, code_auditDependencyRanges as auditDependencyRanges, code_buildDockerPull as buildDockerPull, code_buildDockerRun as buildDockerRun, code_buildGitCommand as buildGitCommand, code_collapseHtmlWhitespace as collapseHtmlWhitespace, code_collapseJsWhitespace as collapseJsWhitespace, code_countProperties as countProperties, code_countRules as countRules, code_detectDialect as detectDialect, code_detectOperationType as detectOperationType, code_detectRedos as detectRedos, code_envToExport as envToExport, code_envToJson as envToJson, code_extractSvgSpriteSymbols as extractSvgSpriteSymbols, code_formatCss as formatCss, code_formatGql as formatGql, code_formatHtml as formatHtml, code_formatSql as formatSql, code_getEndpointsByTag as getEndpointsByTag, code_getHtmlStats as getHtmlStats, code_getJsStats as getJsStats, code_getMethodColor as getMethodColor, code_isValidTag as isValidTag, code_lintConventionalCommit as lintConventionalCommit, code_lookupMime as lookupMime, code_minifyCss as minifyCss, code_minifyGql as minifyGql, code_minifyHtml as minifyHtml, code_minifyJs as minifyJs, code_minifySql as minifySql, code_normalizeRef as normalizeRef, code_parseDockerImage as parseDockerImage, code_parseEnv as parseEnv, code_parseGitCommand as parseGitCommand, code_parseGithubUrl as parseGithubUrl, code_parseSpec as parseSpec, code_removeConsoleCalls as removeConsoleCalls, code_removeEmptyAttributes as removeEmptyAttributes, code_removeHtmlComments as removeHtmlComments, code_removeJsComments as removeJsComments, code_removeRedundantAttributes as removeRedundantAttributes, code_searchCheatsheet as searchCheatsheet, code_searchEndpoints as searchEndpoints, code_splitStatements as splitStatements, code_testGitignorePatterns as testGitignorePatterns, code_testPattern as testPattern, code_testRegex as testRegex, code_validateEditorConfig as validateEditorConfig, code_validateEnvKey as validateEnvKey, code_validatePackageExports as validatePackageExports, code_validateTsconfig as validateTsconfig };
755
+ export { code_ALL_FLAGS as ALL_FLAGS, type code_ApiEndpoint as ApiEndpoint, type code_ApiInfo as ApiInfo, code_CHEATSHEET as CHEATSHEET, type code_CheatsheetEntry as CheatsheetEntry, type code_CommitTrailer as CommitTrailer, type code_CommitTrailerResult as CommitTrailerResult, type code_ConventionalCommitFinding as ConventionalCommitFinding, type code_ConventionalCommitFooter as ConventionalCommitFooter, type code_ConventionalCommitOptions as ConventionalCommitOptions, type code_ConventionalCommitParsed as ConventionalCommitParsed, type code_ConventionalCommitResult as ConventionalCommitResult, type code_ConventionalCommitSeverity as ConventionalCommitSeverity, type code_CssResult as CssResult, code_DEFAULT_COMMIT_TYPES as DEFAULT_COMMIT_TYPES, type code_DependencyAuditDuplicate as DependencyAuditDuplicate, type code_DependencyAuditEntry as DependencyAuditEntry, type code_DependencyAuditIssue as DependencyAuditIssue, type code_DependencyAuditResult as DependencyAuditResult, type code_DependencyRangeType as DependencyRangeType, type code_DependencySection as DependencySection, type code_DockerImageRef as DockerImageRef, type code_EditorConfigIssue as EditorConfigIssue, type code_EditorConfigProperty as EditorConfigProperty, type code_EditorConfigSection as EditorConfigSection, type code_EditorConfigValidationResult as EditorConfigValidationResult, type code_EnvEntry as EnvEntry, type code_EnvParseResult as EnvParseResult, type code_ExportsIssue as ExportsIssue, type code_ExportsShape as ExportsShape, type code_ExportsValidationResult as ExportsValidationResult, type code_GitCommandConfig as GitCommandConfig, type code_GitCommandResult as GitCommandResult, type code_GitOperation as GitOperation, type code_GithubUrlInfo as GithubUrlInfo, type code_GithubUrlType as GithubUrlType, type code_GitignoreTestResult as GitignoreTestResult, type code_GqlFormatResult as GqlFormatResult, type code_HtmlFormatResult as HtmlFormatResult, type code_HtmlMinifyOptions as HtmlMinifyOptions, type code_HtmlMinifyResult as HtmlMinifyResult, type code_JsMinifyOptions as JsMinifyOptions, type code_JsMinifyResult as JsMinifyResult, code_MIME_TABLE as MIME_TABLE, type code_MarkdownFootnoteDefinition as MarkdownFootnoteDefinition, type code_MarkdownFootnoteReference as MarkdownFootnoteReference, type code_MarkdownFootnoteResult as MarkdownFootnoteResult, type code_MatchResult as MatchResult, type code_MimeEntry as MimeEntry, type code_MimeLookupResult as MimeLookupResult, code_OPERATIONS as OPERATIONS, type code_ParsedSpec as ParsedSpec, type code_RedosFinding as RedosFinding, type code_RedosResult as RedosResult, type code_RedosSeverity as RedosSeverity, type code_RegexBackreferenceInfo as RegexBackreferenceInfo, type code_RegexError as RegexError, type code_RegexFlag as RegexFlag, type code_RegexGroupAnalysis as RegexGroupAnalysis, type code_RegexGroupInfo as RegexGroupInfo, type code_RegexGroupIssue as RegexGroupIssue, type code_RegexMatch as RegexMatch, type code_RegexResult as RegexResult, type code_RegexSuccess as RegexSuccess, code_SQL_DEFAULT_OPTIONS as SQL_DEFAULT_OPTIONS, type code_Segment as Segment, type code_SpecVersion as SpecVersion, type code_SqlDialect as SqlDialect, type code_SqlFormatOptions as SqlFormatOptions, type code_SvgSpriteResult as SvgSpriteResult, type code_SvgSpriteSymbol as SvgSpriteSymbol, type code_TestPatternResult as TestPatternResult, type code_TsconfigIssue as TsconfigIssue, type code_TsconfigValidationResult as TsconfigValidationResult, code_analyzeRegexGroups as analyzeRegexGroups, code_auditDependencyRanges as auditDependencyRanges, code_buildDockerPull as buildDockerPull, code_buildDockerRun as buildDockerRun, code_buildGitCommand as buildGitCommand, code_collapseHtmlWhitespace as collapseHtmlWhitespace, code_collapseJsWhitespace as collapseJsWhitespace, code_countProperties as countProperties, code_countRules as countRules, code_detectDialect as detectDialect, code_detectOperationType as detectOperationType, code_detectRedos as detectRedos, code_envToExport as envToExport, code_envToJson as envToJson, code_extractMarkdownFootnotes as extractMarkdownFootnotes, code_extractSvgSpriteSymbols as extractSvgSpriteSymbols, code_formatCss as formatCss, code_formatGql as formatGql, code_formatHtml as formatHtml, code_formatSql as formatSql, code_getEndpointsByTag as getEndpointsByTag, code_getHtmlStats as getHtmlStats, code_getJsStats as getJsStats, code_getMethodColor as getMethodColor, code_isValidTag as isValidTag, code_lintConventionalCommit as lintConventionalCommit, code_lookupMime as lookupMime, code_minifyCss as minifyCss, code_minifyGql as minifyGql, code_minifyHtml as minifyHtml, code_minifyJs as minifyJs, code_minifySql as minifySql, code_normalizeRef as normalizeRef, code_parseCommitTrailers as parseCommitTrailers, code_parseDockerImage as parseDockerImage, code_parseEnv as parseEnv, code_parseGitCommand as parseGitCommand, code_parseGithubUrl as parseGithubUrl, code_parseSpec as parseSpec, code_removeConsoleCalls as removeConsoleCalls, code_removeEmptyAttributes as removeEmptyAttributes, code_removeHtmlComments as removeHtmlComments, code_removeJsComments as removeJsComments, code_removeRedundantAttributes as removeRedundantAttributes, code_searchCheatsheet as searchCheatsheet, code_searchEndpoints as searchEndpoints, code_splitStatements as splitStatements, code_testGitignorePatterns as testGitignorePatterns, code_testPattern as testPattern, code_testRegex as testRegex, code_validateEditorConfig as validateEditorConfig, code_validateEnvKey as validateEnvKey, code_validatePackageExports as validatePackageExports, code_validateTsconfig as validateTsconfig };
698
756
  }
699
757
 
700
- export { type RegexFlag as $, ALL_FLAGS as A, type GitCommandResult as B, CHEATSHEET as C, DEFAULT_COMMIT_TYPES as D, type EditorConfigIssue as E, type GitOperation as F, type GitCommandConfig as G, type GithubUrlInfo as H, type GithubUrlType as I, type GitignoreTestResult as J, type GqlFormatResult as K, type HtmlFormatResult as L, type HtmlMinifyOptions as M, type HtmlMinifyResult as N, type JsMinifyOptions as O, type JsMinifyResult as P, MIME_TABLE as Q, type MatchResult as R, type MimeEntry as S, type MimeLookupResult as T, OPERATIONS as U, type ParsedSpec as V, type RedosFinding as W, type RedosResult as X, type RedosSeverity as Y, type RegexBackreferenceInfo as Z, type RegexError as _, type ApiEndpoint as a, testRegex as a$, type RegexGroupAnalysis as a0, type RegexGroupInfo as a1, type RegexGroupIssue as a2, type RegexMatch as a3, type RegexResult as a4, type RegexSuccess as a5, SQL_DEFAULT_OPTIONS as a6, type Segment as a7, type SpecVersion as a8, type SqlDialect as a9, getHtmlStats as aA, getJsStats as aB, getMethodColor as aC, isValidTag as aD, lintConventionalCommit as aE, lookupMime as aF, minifyCss as aG, minifyGql as aH, minifyHtml as aI, minifyJs as aJ, minifySql as aK, normalizeRef as aL, parseDockerImage as aM, parseEnv as aN, parseGitCommand as aO, parseGithubUrl as aP, parseSpec as aQ, removeConsoleCalls as aR, removeEmptyAttributes as aS, removeHtmlComments as aT, removeJsComments as aU, removeRedundantAttributes as aV, searchCheatsheet as aW, searchEndpoints as aX, splitStatements as aY, testGitignorePatterns as aZ, testPattern as a_, type SqlFormatOptions as aa, type SvgSpriteResult as ab, type SvgSpriteSymbol as ac, type TestPatternResult as ad, type TsconfigIssue as ae, type TsconfigValidationResult as af, analyzeRegexGroups as ag, auditDependencyRanges as ah, buildDockerPull as ai, buildDockerRun as aj, buildGitCommand as ak, collapseHtmlWhitespace as al, collapseJsWhitespace as am, countProperties as an, countRules as ao, detectDialect as ap, detectOperationType as aq, detectRedos as ar, envToExport as as, envToJson as at, extractSvgSpriteSymbols as au, formatCss as av, formatGql as aw, formatHtml as ax, formatSql as ay, getEndpointsByTag as az, type ApiInfo as b, validateEditorConfig as b0, validateEnvKey as b1, validatePackageExports as b2, validateTsconfig as b3, code as c, type CheatsheetEntry as d, type ConventionalCommitFinding as e, type ConventionalCommitFooter as f, type ConventionalCommitOptions as g, type ConventionalCommitParsed as h, type ConventionalCommitResult as i, type ConventionalCommitSeverity as j, type CssResult as k, type DependencyAuditDuplicate as l, type DependencyAuditEntry as m, type DependencyAuditIssue as n, type DependencyAuditResult as o, type DependencyRangeType as p, type DependencySection as q, type DockerImageRef as r, type EditorConfigProperty as s, type EditorConfigSection as t, type EditorConfigValidationResult as u, type EnvEntry as v, type EnvParseResult as w, type ExportsIssue as x, type ExportsShape as y, type ExportsValidationResult as z };
758
+ export { type RedosFinding as $, ALL_FLAGS as A, type ExportsShape as B, CHEATSHEET as C, DEFAULT_COMMIT_TYPES as D, type EditorConfigIssue as E, type ExportsValidationResult as F, type GitCommandConfig as G, type GitCommandResult as H, type GitOperation as I, type GithubUrlInfo as J, type GithubUrlType as K, type GitignoreTestResult as L, type GqlFormatResult as M, type HtmlFormatResult as N, type HtmlMinifyOptions as O, type HtmlMinifyResult as P, type JsMinifyOptions as Q, type JsMinifyResult as R, MIME_TABLE as S, type MarkdownFootnoteDefinition as T, type MarkdownFootnoteReference as U, type MarkdownFootnoteResult as V, type MatchResult as W, type MimeEntry as X, type MimeLookupResult as Y, OPERATIONS as Z, type ParsedSpec as _, type ApiEndpoint as a, removeJsComments as a$, type RedosResult as a0, type RedosSeverity as a1, type RegexBackreferenceInfo as a2, type RegexError as a3, type RegexFlag as a4, type RegexGroupAnalysis as a5, type RegexGroupInfo as a6, type RegexGroupIssue as a7, type RegexMatch as a8, type RegexResult as a9, extractSvgSpriteSymbols as aA, formatCss as aB, formatGql as aC, formatHtml as aD, formatSql as aE, getEndpointsByTag as aF, getHtmlStats as aG, getJsStats as aH, getMethodColor as aI, isValidTag as aJ, lintConventionalCommit as aK, lookupMime as aL, minifyCss as aM, minifyGql as aN, minifyHtml as aO, minifyJs as aP, minifySql as aQ, normalizeRef as aR, parseCommitTrailers as aS, parseDockerImage as aT, parseEnv as aU, parseGitCommand as aV, parseGithubUrl as aW, parseSpec as aX, removeConsoleCalls as aY, removeEmptyAttributes as aZ, removeHtmlComments as a_, type RegexSuccess as aa, SQL_DEFAULT_OPTIONS as ab, type Segment as ac, type SpecVersion as ad, type SqlDialect as ae, type SqlFormatOptions as af, type SvgSpriteResult as ag, type SvgSpriteSymbol as ah, type TestPatternResult as ai, type TsconfigIssue as aj, type TsconfigValidationResult as ak, analyzeRegexGroups as al, auditDependencyRanges as am, buildDockerPull as an, buildDockerRun as ao, buildGitCommand as ap, collapseHtmlWhitespace as aq, collapseJsWhitespace as ar, countProperties as as, countRules as at, detectDialect as au, detectOperationType as av, detectRedos as aw, envToExport as ax, envToJson as ay, extractMarkdownFootnotes as az, type ApiInfo as b, removeRedundantAttributes as b0, searchCheatsheet as b1, searchEndpoints as b2, splitStatements as b3, testGitignorePatterns as b4, testPattern as b5, testRegex as b6, validateEditorConfig as b7, validateEnvKey as b8, validatePackageExports as b9, validateTsconfig as ba, code as c, type CheatsheetEntry as d, type CommitTrailer as e, type CommitTrailerResult as f, type ConventionalCommitFinding as g, type ConventionalCommitFooter as h, type ConventionalCommitOptions as i, type ConventionalCommitParsed as j, type ConventionalCommitResult as k, type ConventionalCommitSeverity as l, type CssResult as m, type DependencyAuditDuplicate as n, type DependencyAuditEntry as o, type DependencyAuditIssue as p, type DependencyAuditResult as q, type DependencyRangeType as r, type DependencySection as s, type DockerImageRef as t, type EditorConfigProperty as u, type EditorConfigSection as v, type EditorConfigValidationResult as w, type EnvEntry as x, type EnvParseResult as y, type ExportsIssue as z };
package/dist/index.cjs CHANGED
@@ -15850,6 +15850,7 @@ __export(code_exports, {
15850
15850
  detectRedos: () => detectRedos,
15851
15851
  envToExport: () => envToExport2,
15852
15852
  envToJson: () => envToJson2,
15853
+ extractMarkdownFootnotes: () => extractMarkdownFootnotes,
15853
15854
  extractSvgSpriteSymbols: () => extractSvgSpriteSymbols,
15854
15855
  formatCss: () => formatCss,
15855
15856
  formatGql: () => formatGql,
@@ -15868,6 +15869,7 @@ __export(code_exports, {
15868
15869
  minifyJs: () => minifyJs,
15869
15870
  minifySql: () => minifySql,
15870
15871
  normalizeRef: () => normalizeRef,
15872
+ parseCommitTrailers: () => parseCommitTrailers,
15871
15873
  parseDockerImage: () => parseDockerImage,
15872
15874
  parseEnv: () => parseEnv2,
15873
15875
  parseGitCommand: () => parseGitCommand,
@@ -19451,6 +19453,93 @@ function extractSvgSpriteSymbols(svg) {
19451
19453
  }
19452
19454
  return { symbolCount: symbols.length, symbols, skippedCount };
19453
19455
  }
19456
+ var TRAILER_LINE_REGEX = /^([A-Za-z][A-Za-z0-9-]*): (.+)$/;
19457
+ var TRAILER_CONTINUATION_REGEX = /^[ \t]+\S/;
19458
+ function parseCommitTrailers(message) {
19459
+ const lines = message.replace(/\r\n/g, "\n").split("\n");
19460
+ while (lines.length > 0 && lines[lines.length - 1].trim() === "") lines.pop();
19461
+ if (lines.length === 0) return { error: "Empty input" };
19462
+ let start = 0;
19463
+ for (let i = lines.length - 1; i >= 0; i--) {
19464
+ if (lines[i].trim() === "") {
19465
+ start = i + 1;
19466
+ break;
19467
+ }
19468
+ }
19469
+ const paragraph = lines.slice(start);
19470
+ const trailers = [];
19471
+ let valid = true;
19472
+ for (const line of paragraph) {
19473
+ const m = line.match(TRAILER_LINE_REGEX);
19474
+ if (m) {
19475
+ trailers.push({ key: m[1], value: m[2].trim() });
19476
+ } else if (TRAILER_CONTINUATION_REGEX.test(line) && trailers.length > 0) {
19477
+ trailers[trailers.length - 1].value += " " + line.trim();
19478
+ } else {
19479
+ valid = false;
19480
+ break;
19481
+ }
19482
+ }
19483
+ if (!valid || trailers.length === 0) {
19484
+ return { trailers: [], body: lines.join("\n").trim(), hasTrailers: false };
19485
+ }
19486
+ const body = lines.slice(0, start).join("\n").trim();
19487
+ return { trailers, body, hasTrailers: true };
19488
+ }
19489
+ var FOOTNOTE_DEFINITION_LINE_REGEX = /^\[\^([^\]]+)\]:\s?(.*)$/;
19490
+ var FOOTNOTE_CONTINUATION_REGEX = /^(?: {4}|\t)/;
19491
+ var FOOTNOTE_REFERENCE_REGEX = /\[\^([^\]]+)\]/g;
19492
+ function extractMarkdownFootnotes(markdown) {
19493
+ const trimmed = markdown.trim();
19494
+ if (!trimmed) return { error: "Empty input" };
19495
+ if (!trimmed.includes("[^")) return { error: "No footnote references or definitions found" };
19496
+ const lines = markdown.replace(/\r\n/g, "\n").split("\n");
19497
+ const definitions = [];
19498
+ const definedLabels = /* @__PURE__ */ new Set();
19499
+ const consumed = new Array(lines.length).fill(false);
19500
+ let i = 0;
19501
+ while (i < lines.length) {
19502
+ const match = lines[i].match(FOOTNOTE_DEFINITION_LINE_REGEX);
19503
+ if (!match) {
19504
+ i++;
19505
+ continue;
19506
+ }
19507
+ const label = match[1];
19508
+ const textLines = [match[2]];
19509
+ consumed[i] = true;
19510
+ let j = i + 1;
19511
+ while (j < lines.length && (FOOTNOTE_CONTINUATION_REGEX.test(lines[j]) || lines[j].trim() === "" && j + 1 < lines.length && FOOTNOTE_CONTINUATION_REGEX.test(lines[j + 1]))) {
19512
+ textLines.push(lines[j].trim() === "" ? "" : lines[j].replace(FOOTNOTE_CONTINUATION_REGEX, ""));
19513
+ consumed[j] = true;
19514
+ j++;
19515
+ }
19516
+ if (!definedLabels.has(label)) {
19517
+ definedLabels.add(label);
19518
+ definitions.push({ label, text: textLines.join("\n").trim() });
19519
+ }
19520
+ i = j;
19521
+ }
19522
+ const referenceScanText = lines.filter((_, idx) => !consumed[idx]).join("\n");
19523
+ const refOrder = [];
19524
+ const refCounts = /* @__PURE__ */ new Map();
19525
+ for (const m of referenceScanText.matchAll(FOOTNOTE_REFERENCE_REGEX)) {
19526
+ const label = m[1];
19527
+ if (!refCounts.has(label)) {
19528
+ refCounts.set(label, 0);
19529
+ refOrder.push(label);
19530
+ }
19531
+ refCounts.set(label, (refCounts.get(label) ?? 0) + 1);
19532
+ }
19533
+ const references = refOrder.map((label) => ({ label, count: refCounts.get(label) ?? 0 }));
19534
+ const referencedSet = new Set(refOrder);
19535
+ const unresolvedReferences = refOrder.filter((label) => !definedLabels.has(label));
19536
+ const unusedDefinitions = definitions.filter((d) => !referencedSet.has(d.label)).map((d) => d.label);
19537
+ const referenceCount = refOrder.reduce((sum, label) => sum + (refCounts.get(label) ?? 0), 0);
19538
+ if (definitions.length === 0 && references.length === 0) {
19539
+ return { error: "No footnote references or definitions found" };
19540
+ }
19541
+ return { definitionCount: definitions.length, referenceCount, definitions, references, unresolvedReferences, unusedDefinitions };
19542
+ }
19454
19543
 
19455
19544
  // src/tools/color.ts
19456
19545
  var color_exports = {};
package/dist/index.d.cts CHANGED
@@ -8,7 +8,7 @@ export { t as time } from './time-KqJjdqII.cjs';
8
8
  export { u as units } from './units-DPefgzmH.cjs';
9
9
  export { n as network } from './network-BmqYmfqY.cjs';
10
10
  export { a as api } from './api-DmTNE4c1.cjs';
11
- export { c as code } from './code-DB-5ZfG4.cjs';
11
+ export { c as code } from './code-CoeD4Fmq.cjs';
12
12
  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';
package/dist/index.d.ts CHANGED
@@ -8,7 +8,7 @@ export { t as time } from './time-KqJjdqII.js';
8
8
  export { u as units } from './units-DPefgzmH.js';
9
9
  export { n as network } from './network-BmqYmfqY.js';
10
10
  export { a as api } from './api-DmTNE4c1.js';
11
- export { c as code } from './code-DB-5ZfG4.js';
11
+ export { c as code } from './code-CoeD4Fmq.js';
12
12
  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';
package/dist/index.js CHANGED
@@ -2,7 +2,7 @@ export { media_exports as media } from './chunk-226EH3ZI.js';
2
2
  export { units_exports as units } from './chunk-4HNHEOJL.js';
3
3
  export { network_exports as network } from './chunk-ACGCCOCK.js';
4
4
  export { api_exports as api } from './chunk-52ZDKSIX.js';
5
- export { code_exports as code } from './chunk-COL3IM7U.js';
5
+ export { code_exports as code } from './chunk-DAD2ZOTJ.js';
6
6
  export { color_exports as color } from './chunk-BPVAB4P2.js';
7
7
  export { css_exports as css } from './chunk-6YPV2AB5.js';
8
8
  export { misc_exports as misc } from './chunk-GX7H6TAX.js';
@@ -3565,6 +3565,93 @@ function extractSvgSpriteSymbols(svg) {
3565
3565
  }
3566
3566
  return { symbolCount: symbols.length, symbols, skippedCount };
3567
3567
  }
3568
+ var TRAILER_LINE_REGEX = /^([A-Za-z][A-Za-z0-9-]*): (.+)$/;
3569
+ var TRAILER_CONTINUATION_REGEX = /^[ \t]+\S/;
3570
+ function parseCommitTrailers(message) {
3571
+ const lines = message.replace(/\r\n/g, "\n").split("\n");
3572
+ while (lines.length > 0 && lines[lines.length - 1].trim() === "") lines.pop();
3573
+ if (lines.length === 0) return { error: "Empty input" };
3574
+ let start = 0;
3575
+ for (let i = lines.length - 1; i >= 0; i--) {
3576
+ if (lines[i].trim() === "") {
3577
+ start = i + 1;
3578
+ break;
3579
+ }
3580
+ }
3581
+ const paragraph = lines.slice(start);
3582
+ const trailers = [];
3583
+ let valid = true;
3584
+ for (const line of paragraph) {
3585
+ const m = line.match(TRAILER_LINE_REGEX);
3586
+ if (m) {
3587
+ trailers.push({ key: m[1], value: m[2].trim() });
3588
+ } else if (TRAILER_CONTINUATION_REGEX.test(line) && trailers.length > 0) {
3589
+ trailers[trailers.length - 1].value += " " + line.trim();
3590
+ } else {
3591
+ valid = false;
3592
+ break;
3593
+ }
3594
+ }
3595
+ if (!valid || trailers.length === 0) {
3596
+ return { trailers: [], body: lines.join("\n").trim(), hasTrailers: false };
3597
+ }
3598
+ const body = lines.slice(0, start).join("\n").trim();
3599
+ return { trailers, body, hasTrailers: true };
3600
+ }
3601
+ var FOOTNOTE_DEFINITION_LINE_REGEX = /^\[\^([^\]]+)\]:\s?(.*)$/;
3602
+ var FOOTNOTE_CONTINUATION_REGEX = /^(?: {4}|\t)/;
3603
+ var FOOTNOTE_REFERENCE_REGEX = /\[\^([^\]]+)\]/g;
3604
+ function extractMarkdownFootnotes(markdown) {
3605
+ const trimmed = markdown.trim();
3606
+ if (!trimmed) return { error: "Empty input" };
3607
+ if (!trimmed.includes("[^")) return { error: "No footnote references or definitions found" };
3608
+ const lines = markdown.replace(/\r\n/g, "\n").split("\n");
3609
+ const definitions = [];
3610
+ const definedLabels = /* @__PURE__ */ new Set();
3611
+ const consumed = new Array(lines.length).fill(false);
3612
+ let i = 0;
3613
+ while (i < lines.length) {
3614
+ const match = lines[i].match(FOOTNOTE_DEFINITION_LINE_REGEX);
3615
+ if (!match) {
3616
+ i++;
3617
+ continue;
3618
+ }
3619
+ const label = match[1];
3620
+ const textLines = [match[2]];
3621
+ consumed[i] = true;
3622
+ let j = i + 1;
3623
+ while (j < lines.length && (FOOTNOTE_CONTINUATION_REGEX.test(lines[j]) || lines[j].trim() === "" && j + 1 < lines.length && FOOTNOTE_CONTINUATION_REGEX.test(lines[j + 1]))) {
3624
+ textLines.push(lines[j].trim() === "" ? "" : lines[j].replace(FOOTNOTE_CONTINUATION_REGEX, ""));
3625
+ consumed[j] = true;
3626
+ j++;
3627
+ }
3628
+ if (!definedLabels.has(label)) {
3629
+ definedLabels.add(label);
3630
+ definitions.push({ label, text: textLines.join("\n").trim() });
3631
+ }
3632
+ i = j;
3633
+ }
3634
+ const referenceScanText = lines.filter((_, idx) => !consumed[idx]).join("\n");
3635
+ const refOrder = [];
3636
+ const refCounts = /* @__PURE__ */ new Map();
3637
+ for (const m of referenceScanText.matchAll(FOOTNOTE_REFERENCE_REGEX)) {
3638
+ const label = m[1];
3639
+ if (!refCounts.has(label)) {
3640
+ refCounts.set(label, 0);
3641
+ refOrder.push(label);
3642
+ }
3643
+ refCounts.set(label, (refCounts.get(label) ?? 0) + 1);
3644
+ }
3645
+ const references = refOrder.map((label) => ({ label, count: refCounts.get(label) ?? 0 }));
3646
+ const referencedSet = new Set(refOrder);
3647
+ const unresolvedReferences = refOrder.filter((label) => !definedLabels.has(label));
3648
+ const unusedDefinitions = definitions.filter((d) => !referencedSet.has(d.label)).map((d) => d.label);
3649
+ const referenceCount = refOrder.reduce((sum, label) => sum + (refCounts.get(label) ?? 0), 0);
3650
+ if (definitions.length === 0 && references.length === 0) {
3651
+ return { error: "No footnote references or definitions found" };
3652
+ }
3653
+ return { definitionCount: definitions.length, referenceCount, definitions, references, unresolvedReferences, unusedDefinitions };
3654
+ }
3568
3655
 
3569
3656
  exports.ALL_FLAGS = ALL_FLAGS;
3570
3657
  exports.CHEATSHEET = CHEATSHEET;
@@ -3586,6 +3673,7 @@ exports.detectOperationType = detectOperationType;
3586
3673
  exports.detectRedos = detectRedos;
3587
3674
  exports.envToExport = envToExport;
3588
3675
  exports.envToJson = envToJson;
3676
+ exports.extractMarkdownFootnotes = extractMarkdownFootnotes;
3589
3677
  exports.extractSvgSpriteSymbols = extractSvgSpriteSymbols;
3590
3678
  exports.formatCss = formatCss;
3591
3679
  exports.formatGql = formatGql;
@@ -3604,6 +3692,7 @@ exports.minifyHtml = minifyHtml;
3604
3692
  exports.minifyJs = minifyJs;
3605
3693
  exports.minifySql = minifySql;
3606
3694
  exports.normalizeRef = normalizeRef;
3695
+ exports.parseCommitTrailers = parseCommitTrailers;
3607
3696
  exports.parseDockerImage = parseDockerImage;
3608
3697
  exports.parseEnv = parseEnv;
3609
3698
  exports.parseGitCommand = parseGitCommand;
@@ -1 +1 @@
1
- export { A as ALL_FLAGS, a as ApiEndpoint, b as ApiInfo, C as CHEATSHEET, d as CheatsheetEntry, e as ConventionalCommitFinding, f as ConventionalCommitFooter, g as ConventionalCommitOptions, h as ConventionalCommitParsed, i as ConventionalCommitResult, j as ConventionalCommitSeverity, k as CssResult, D as DEFAULT_COMMIT_TYPES, l as DependencyAuditDuplicate, m as DependencyAuditEntry, n as DependencyAuditIssue, o as DependencyAuditResult, p as DependencyRangeType, q as DependencySection, r as DockerImageRef, E as EditorConfigIssue, s as EditorConfigProperty, t as EditorConfigSection, u as EditorConfigValidationResult, v as EnvEntry, w as EnvParseResult, x as ExportsIssue, y as ExportsShape, z as ExportsValidationResult, G as GitCommandConfig, B as GitCommandResult, F as GitOperation, H as GithubUrlInfo, I as GithubUrlType, J as GitignoreTestResult, K as GqlFormatResult, L as HtmlFormatResult, M as HtmlMinifyOptions, N as HtmlMinifyResult, O as JsMinifyOptions, P as JsMinifyResult, Q as MIME_TABLE, R as MatchResult, S as MimeEntry, T as MimeLookupResult, U as OPERATIONS, V as ParsedSpec, W as RedosFinding, X as RedosResult, Y as RedosSeverity, Z as RegexBackreferenceInfo, _ as RegexError, $ as RegexFlag, a0 as RegexGroupAnalysis, a1 as RegexGroupInfo, a2 as RegexGroupIssue, a3 as RegexMatch, a4 as RegexResult, a5 as RegexSuccess, a6 as SQL_DEFAULT_OPTIONS, a7 as Segment, a8 as SpecVersion, a9 as SqlDialect, aa as SqlFormatOptions, ab as SvgSpriteResult, ac as SvgSpriteSymbol, ad as TestPatternResult, ae as TsconfigIssue, af as TsconfigValidationResult, ag as analyzeRegexGroups, ah as auditDependencyRanges, ai as buildDockerPull, aj as buildDockerRun, ak as buildGitCommand, al as collapseHtmlWhitespace, am as collapseJsWhitespace, an as countProperties, ao as countRules, ap as detectDialect, aq as detectOperationType, ar as detectRedos, as as envToExport, at as envToJson, au as extractSvgSpriteSymbols, av as formatCss, aw as formatGql, ax as formatHtml, ay as formatSql, az as getEndpointsByTag, aA as getHtmlStats, aB as getJsStats, aC as getMethodColor, aD as isValidTag, aE as lintConventionalCommit, aF as lookupMime, aG as minifyCss, aH as minifyGql, aI as minifyHtml, aJ as minifyJs, aK as minifySql, aL as normalizeRef, aM as parseDockerImage, aN as parseEnv, aO as parseGitCommand, aP as parseGithubUrl, aQ as parseSpec, aR as removeConsoleCalls, aS as removeEmptyAttributes, aT as removeHtmlComments, aU as removeJsComments, aV as removeRedundantAttributes, aW as searchCheatsheet, aX as searchEndpoints, aY as splitStatements, aZ as testGitignorePatterns, a_ as testPattern, a$ as testRegex, b0 as validateEditorConfig, b1 as validateEnvKey, b2 as validatePackageExports, b3 as validateTsconfig } from '../code-DB-5ZfG4.cjs';
1
+ export { A as ALL_FLAGS, a as ApiEndpoint, b as ApiInfo, C as CHEATSHEET, d as CheatsheetEntry, e as CommitTrailer, f as CommitTrailerResult, g as ConventionalCommitFinding, h as ConventionalCommitFooter, i as ConventionalCommitOptions, j as ConventionalCommitParsed, k as ConventionalCommitResult, l as ConventionalCommitSeverity, m as CssResult, D as DEFAULT_COMMIT_TYPES, n as DependencyAuditDuplicate, o as DependencyAuditEntry, p as DependencyAuditIssue, q as DependencyAuditResult, r as DependencyRangeType, s as DependencySection, t as DockerImageRef, E as EditorConfigIssue, u as EditorConfigProperty, v as EditorConfigSection, w as EditorConfigValidationResult, x as EnvEntry, y as EnvParseResult, z as ExportsIssue, B as ExportsShape, F as ExportsValidationResult, G as GitCommandConfig, H as GitCommandResult, I as GitOperation, J as GithubUrlInfo, K as GithubUrlType, L as GitignoreTestResult, M as GqlFormatResult, N as HtmlFormatResult, O as HtmlMinifyOptions, P as HtmlMinifyResult, Q as JsMinifyOptions, R as JsMinifyResult, S as MIME_TABLE, T as MarkdownFootnoteDefinition, U as MarkdownFootnoteReference, V as MarkdownFootnoteResult, W as MatchResult, X as MimeEntry, Y as MimeLookupResult, Z as OPERATIONS, _ as ParsedSpec, $ as RedosFinding, a0 as RedosResult, a1 as RedosSeverity, a2 as RegexBackreferenceInfo, a3 as RegexError, a4 as RegexFlag, a5 as RegexGroupAnalysis, a6 as RegexGroupInfo, a7 as RegexGroupIssue, a8 as RegexMatch, a9 as RegexResult, aa as RegexSuccess, ab as SQL_DEFAULT_OPTIONS, ac as Segment, ad as SpecVersion, ae as SqlDialect, af as SqlFormatOptions, ag as SvgSpriteResult, ah as SvgSpriteSymbol, ai as TestPatternResult, aj as TsconfigIssue, ak as TsconfigValidationResult, al as analyzeRegexGroups, am as auditDependencyRanges, an as buildDockerPull, ao as buildDockerRun, ap as buildGitCommand, aq as collapseHtmlWhitespace, ar as collapseJsWhitespace, as as countProperties, at as countRules, au as detectDialect, av as detectOperationType, aw as detectRedos, ax as envToExport, ay as envToJson, az as extractMarkdownFootnotes, aA as extractSvgSpriteSymbols, aB as formatCss, aC as formatGql, aD as formatHtml, aE as formatSql, aF as getEndpointsByTag, aG as getHtmlStats, aH as getJsStats, aI as getMethodColor, aJ as isValidTag, aK as lintConventionalCommit, aL as lookupMime, aM as minifyCss, aN as minifyGql, aO as minifyHtml, aP as minifyJs, aQ as minifySql, aR as normalizeRef, aS as parseCommitTrailers, aT as parseDockerImage, aU as parseEnv, aV as parseGitCommand, aW as parseGithubUrl, aX as parseSpec, aY as removeConsoleCalls, aZ as removeEmptyAttributes, a_ as removeHtmlComments, a$ as removeJsComments, b0 as removeRedundantAttributes, b1 as searchCheatsheet, b2 as searchEndpoints, b3 as splitStatements, b4 as testGitignorePatterns, b5 as testPattern, b6 as testRegex, b7 as validateEditorConfig, b8 as validateEnvKey, b9 as validatePackageExports, ba as validateTsconfig } from '../code-CoeD4Fmq.cjs';
@@ -1 +1 @@
1
- export { A as ALL_FLAGS, a as ApiEndpoint, b as ApiInfo, C as CHEATSHEET, d as CheatsheetEntry, e as ConventionalCommitFinding, f as ConventionalCommitFooter, g as ConventionalCommitOptions, h as ConventionalCommitParsed, i as ConventionalCommitResult, j as ConventionalCommitSeverity, k as CssResult, D as DEFAULT_COMMIT_TYPES, l as DependencyAuditDuplicate, m as DependencyAuditEntry, n as DependencyAuditIssue, o as DependencyAuditResult, p as DependencyRangeType, q as DependencySection, r as DockerImageRef, E as EditorConfigIssue, s as EditorConfigProperty, t as EditorConfigSection, u as EditorConfigValidationResult, v as EnvEntry, w as EnvParseResult, x as ExportsIssue, y as ExportsShape, z as ExportsValidationResult, G as GitCommandConfig, B as GitCommandResult, F as GitOperation, H as GithubUrlInfo, I as GithubUrlType, J as GitignoreTestResult, K as GqlFormatResult, L as HtmlFormatResult, M as HtmlMinifyOptions, N as HtmlMinifyResult, O as JsMinifyOptions, P as JsMinifyResult, Q as MIME_TABLE, R as MatchResult, S as MimeEntry, T as MimeLookupResult, U as OPERATIONS, V as ParsedSpec, W as RedosFinding, X as RedosResult, Y as RedosSeverity, Z as RegexBackreferenceInfo, _ as RegexError, $ as RegexFlag, a0 as RegexGroupAnalysis, a1 as RegexGroupInfo, a2 as RegexGroupIssue, a3 as RegexMatch, a4 as RegexResult, a5 as RegexSuccess, a6 as SQL_DEFAULT_OPTIONS, a7 as Segment, a8 as SpecVersion, a9 as SqlDialect, aa as SqlFormatOptions, ab as SvgSpriteResult, ac as SvgSpriteSymbol, ad as TestPatternResult, ae as TsconfigIssue, af as TsconfigValidationResult, ag as analyzeRegexGroups, ah as auditDependencyRanges, ai as buildDockerPull, aj as buildDockerRun, ak as buildGitCommand, al as collapseHtmlWhitespace, am as collapseJsWhitespace, an as countProperties, ao as countRules, ap as detectDialect, aq as detectOperationType, ar as detectRedos, as as envToExport, at as envToJson, au as extractSvgSpriteSymbols, av as formatCss, aw as formatGql, ax as formatHtml, ay as formatSql, az as getEndpointsByTag, aA as getHtmlStats, aB as getJsStats, aC as getMethodColor, aD as isValidTag, aE as lintConventionalCommit, aF as lookupMime, aG as minifyCss, aH as minifyGql, aI as minifyHtml, aJ as minifyJs, aK as minifySql, aL as normalizeRef, aM as parseDockerImage, aN as parseEnv, aO as parseGitCommand, aP as parseGithubUrl, aQ as parseSpec, aR as removeConsoleCalls, aS as removeEmptyAttributes, aT as removeHtmlComments, aU as removeJsComments, aV as removeRedundantAttributes, aW as searchCheatsheet, aX as searchEndpoints, aY as splitStatements, aZ as testGitignorePatterns, a_ as testPattern, a$ as testRegex, b0 as validateEditorConfig, b1 as validateEnvKey, b2 as validatePackageExports, b3 as validateTsconfig } from '../code-DB-5ZfG4.js';
1
+ export { A as ALL_FLAGS, a as ApiEndpoint, b as ApiInfo, C as CHEATSHEET, d as CheatsheetEntry, e as CommitTrailer, f as CommitTrailerResult, g as ConventionalCommitFinding, h as ConventionalCommitFooter, i as ConventionalCommitOptions, j as ConventionalCommitParsed, k as ConventionalCommitResult, l as ConventionalCommitSeverity, m as CssResult, D as DEFAULT_COMMIT_TYPES, n as DependencyAuditDuplicate, o as DependencyAuditEntry, p as DependencyAuditIssue, q as DependencyAuditResult, r as DependencyRangeType, s as DependencySection, t as DockerImageRef, E as EditorConfigIssue, u as EditorConfigProperty, v as EditorConfigSection, w as EditorConfigValidationResult, x as EnvEntry, y as EnvParseResult, z as ExportsIssue, B as ExportsShape, F as ExportsValidationResult, G as GitCommandConfig, H as GitCommandResult, I as GitOperation, J as GithubUrlInfo, K as GithubUrlType, L as GitignoreTestResult, M as GqlFormatResult, N as HtmlFormatResult, O as HtmlMinifyOptions, P as HtmlMinifyResult, Q as JsMinifyOptions, R as JsMinifyResult, S as MIME_TABLE, T as MarkdownFootnoteDefinition, U as MarkdownFootnoteReference, V as MarkdownFootnoteResult, W as MatchResult, X as MimeEntry, Y as MimeLookupResult, Z as OPERATIONS, _ as ParsedSpec, $ as RedosFinding, a0 as RedosResult, a1 as RedosSeverity, a2 as RegexBackreferenceInfo, a3 as RegexError, a4 as RegexFlag, a5 as RegexGroupAnalysis, a6 as RegexGroupInfo, a7 as RegexGroupIssue, a8 as RegexMatch, a9 as RegexResult, aa as RegexSuccess, ab as SQL_DEFAULT_OPTIONS, ac as Segment, ad as SpecVersion, ae as SqlDialect, af as SqlFormatOptions, ag as SvgSpriteResult, ah as SvgSpriteSymbol, ai as TestPatternResult, aj as TsconfigIssue, ak as TsconfigValidationResult, al as analyzeRegexGroups, am as auditDependencyRanges, an as buildDockerPull, ao as buildDockerRun, ap as buildGitCommand, aq as collapseHtmlWhitespace, ar as collapseJsWhitespace, as as countProperties, at as countRules, au as detectDialect, av as detectOperationType, aw as detectRedos, ax as envToExport, ay as envToJson, az as extractMarkdownFootnotes, aA as extractSvgSpriteSymbols, aB as formatCss, aC as formatGql, aD as formatHtml, aE as formatSql, aF as getEndpointsByTag, aG as getHtmlStats, aH as getJsStats, aI as getMethodColor, aJ as isValidTag, aK as lintConventionalCommit, aL as lookupMime, aM as minifyCss, aN as minifyGql, aO as minifyHtml, aP as minifyJs, aQ as minifySql, aR as normalizeRef, aS as parseCommitTrailers, aT as parseDockerImage, aU as parseEnv, aV as parseGitCommand, aW as parseGithubUrl, aX as parseSpec, aY as removeConsoleCalls, aZ as removeEmptyAttributes, a_ as removeHtmlComments, a$ as removeJsComments, b0 as removeRedundantAttributes, b1 as searchCheatsheet, b2 as searchEndpoints, b3 as splitStatements, b4 as testGitignorePatterns, b5 as testPattern, b6 as testRegex, b7 as validateEditorConfig, b8 as validateEnvKey, b9 as validatePackageExports, ba as validateTsconfig } from '../code-CoeD4Fmq.js';
@@ -1,2 +1,2 @@
1
- export { ALL_FLAGS, CHEATSHEET, DEFAULT_COMMIT_TYPES, MIME_TABLE, OPERATIONS, SQL_DEFAULT_OPTIONS, analyzeRegexGroups, auditDependencyRanges, buildDockerPull, buildDockerRun, buildGitCommand, collapseHtmlWhitespace, collapseJsWhitespace, countProperties, countRules, detectDialect, detectOperationType, detectRedos, envToExport, envToJson, extractSvgSpriteSymbols, formatCss, formatGql, formatHtml, formatSql, getEndpointsByTag, getHtmlStats, getJsStats, getMethodColor, isValidTag, lintConventionalCommit, lookupMime, minifyCss, minifyGql, minifyHtml, minifyJs, minifySql, normalizeRef, parseDockerImage, parseEnv, parseGitCommand, parseGithubUrl, parseSpec, removeConsoleCalls, removeEmptyAttributes, removeHtmlComments, removeJsComments, removeRedundantAttributes, searchCheatsheet, searchEndpoints, splitStatements, testGitignorePatterns, testPattern, testRegex, validateEditorConfig, validateEnvKey, validatePackageExports, validateTsconfig } from '../chunk-COL3IM7U.js';
1
+ export { ALL_FLAGS, CHEATSHEET, DEFAULT_COMMIT_TYPES, MIME_TABLE, OPERATIONS, SQL_DEFAULT_OPTIONS, analyzeRegexGroups, auditDependencyRanges, buildDockerPull, buildDockerRun, buildGitCommand, collapseHtmlWhitespace, collapseJsWhitespace, countProperties, countRules, detectDialect, detectOperationType, detectRedos, envToExport, envToJson, extractMarkdownFootnotes, extractSvgSpriteSymbols, formatCss, formatGql, formatHtml, formatSql, getEndpointsByTag, getHtmlStats, getJsStats, getMethodColor, isValidTag, lintConventionalCommit, lookupMime, minifyCss, minifyGql, minifyHtml, minifyJs, minifySql, normalizeRef, parseCommitTrailers, parseDockerImage, parseEnv, parseGitCommand, parseGithubUrl, parseSpec, removeConsoleCalls, removeEmptyAttributes, removeHtmlComments, removeJsComments, removeRedundantAttributes, searchCheatsheet, searchEndpoints, splitStatements, testGitignorePatterns, testPattern, testRegex, validateEditorConfig, validateEnvKey, validatePackageExports, validateTsconfig } from '../chunk-DAD2ZOTJ.js';
2
2
  import '../chunk-MLKGABMK.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@utilix-tech/sdk",
3
- "version": "0.68.0",
3
+ "version": "0.69.0",
4
4
  "description": "154+ developer utility tools for Node.js: JSON, encoding, hashing, color, CSS, network and more. Runs locally, no API key required.",
5
5
  "author": "Utilix <hello@utilix.tech>",
6
6
  "license": "MIT",