@utilix-tech/sdk 0.73.0 → 0.75.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.
@@ -30,6 +30,7 @@
30
30
  * - svg-sprite-symbol-extractor (extractSvgSpriteSymbols)
31
31
  * - git-commit-trailer-parser (parseCommitTrailers)
32
32
  * - markdown-footnote-extractor (extractMarkdownFootnotes)
33
+ * - aria-validator (validateAria)
33
34
  */
34
35
  type RegexFlag = 'g' | 'i' | 'm' | 's' | 'u';
35
36
  declare const ALL_FLAGS: RegexFlag[];
@@ -622,10 +623,38 @@ interface MarkdownFootnoteResult {
622
623
  declare function extractMarkdownFootnotes(markdown: string): MarkdownFootnoteResult | {
623
624
  error: string;
624
625
  };
626
+ interface AriaIssue {
627
+ element: string;
628
+ role: string | null;
629
+ severity: 'error' | 'warning';
630
+ message: string;
631
+ }
632
+ interface AriaValidationResult {
633
+ elementCount: number;
634
+ elementsWithRoleOrAria: number;
635
+ issues: AriaIssue[];
636
+ valid: boolean;
637
+ }
638
+ /**
639
+ * Parse an HTML snippet and check every `role` and `aria-*` attribute against
640
+ * a curated table of WAI-ARIA 1.2 roles: unknown role names, an aria-*
641
+ * attribute not permitted on the element's role, an unrecognized aria-*
642
+ * attribute name (likely typo) on an element with no role, and a widget role
643
+ * missing one of its required aria-* states (e.g. `role="checkbox"` without
644
+ * `aria-checked`). This is pure lookup-table validation against a static
645
+ * table (no headless browser, no DOM rendering), and it does not check
646
+ * implicit ARIA semantics carried by plain HTML elements (e.g. a native
647
+ * `<button>` with no `role` attribute at all).
648
+ */
649
+ declare function validateAria(html: string): AriaValidationResult | {
650
+ error: string;
651
+ };
625
652
 
626
653
  declare const code_ALL_FLAGS: typeof ALL_FLAGS;
627
654
  type code_ApiEndpoint = ApiEndpoint;
628
655
  type code_ApiInfo = ApiInfo;
656
+ type code_AriaIssue = AriaIssue;
657
+ type code_AriaValidationResult = AriaValidationResult;
629
658
  declare const code_CHEATSHEET: typeof CHEATSHEET;
630
659
  type code_CheatsheetEntry = CheatsheetEntry;
631
660
  type code_CommitTrailer = CommitTrailer;
@@ -747,12 +776,13 @@ declare const code_splitStatements: typeof splitStatements;
747
776
  declare const code_testGitignorePatterns: typeof testGitignorePatterns;
748
777
  declare const code_testPattern: typeof testPattern;
749
778
  declare const code_testRegex: typeof testRegex;
779
+ declare const code_validateAria: typeof validateAria;
750
780
  declare const code_validateEditorConfig: typeof validateEditorConfig;
751
781
  declare const code_validateEnvKey: typeof validateEnvKey;
752
782
  declare const code_validatePackageExports: typeof validatePackageExports;
753
783
  declare const code_validateTsconfig: typeof validateTsconfig;
754
784
  declare namespace code {
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 };
785
+ export { code_ALL_FLAGS as ALL_FLAGS, type code_ApiEndpoint as ApiEndpoint, type code_ApiInfo as ApiInfo, type code_AriaIssue as AriaIssue, type code_AriaValidationResult as AriaValidationResult, 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_validateAria as validateAria, code_validateEditorConfig as validateEditorConfig, code_validateEnvKey as validateEnvKey, code_validatePackageExports as validatePackageExports, code_validateTsconfig as validateTsconfig };
756
786
  }
757
787
 
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 };
788
+ export { OPERATIONS as $, ALL_FLAGS as A, type EnvParseResult as B, CHEATSHEET as C, DEFAULT_COMMIT_TYPES as D, type EditorConfigIssue as E, type ExportsIssue as F, type ExportsShape as G, type ExportsValidationResult as H, type GitCommandConfig as I, type GitCommandResult as J, type GitOperation as K, type GithubUrlInfo as L, type GithubUrlType as M, type GitignoreTestResult as N, type GqlFormatResult as O, type HtmlFormatResult as P, type HtmlMinifyOptions as Q, type HtmlMinifyResult as R, type JsMinifyOptions as S, type JsMinifyResult as T, MIME_TABLE as U, type MarkdownFootnoteDefinition as V, type MarkdownFootnoteReference as W, type MarkdownFootnoteResult as X, type MatchResult as Y, type MimeEntry as Z, type MimeLookupResult as _, type ApiEndpoint as a, removeEmptyAttributes as a$, type ParsedSpec as a0, type RedosFinding as a1, type RedosResult as a2, type RedosSeverity as a3, type RegexBackreferenceInfo as a4, type RegexError as a5, type RegexFlag as a6, type RegexGroupAnalysis as a7, type RegexGroupInfo as a8, type RegexGroupIssue as a9, envToJson as aA, extractMarkdownFootnotes as aB, extractSvgSpriteSymbols as aC, formatCss as aD, formatGql as aE, formatHtml as aF, formatSql as aG, getEndpointsByTag as aH, getHtmlStats as aI, getJsStats as aJ, getMethodColor as aK, isValidTag as aL, lintConventionalCommit as aM, lookupMime as aN, minifyCss as aO, minifyGql as aP, minifyHtml as aQ, minifyJs as aR, minifySql as aS, normalizeRef as aT, parseCommitTrailers as aU, parseDockerImage as aV, parseEnv as aW, parseGitCommand as aX, parseGithubUrl as aY, parseSpec as aZ, removeConsoleCalls as a_, type RegexMatch as aa, type RegexResult as ab, type RegexSuccess as ac, SQL_DEFAULT_OPTIONS as ad, type Segment as ae, type SpecVersion as af, type SqlDialect as ag, type SqlFormatOptions as ah, type SvgSpriteResult as ai, type SvgSpriteSymbol as aj, type TestPatternResult as ak, type TsconfigIssue as al, type TsconfigValidationResult as am, analyzeRegexGroups as an, auditDependencyRanges as ao, buildDockerPull as ap, buildDockerRun as aq, buildGitCommand as ar, collapseHtmlWhitespace as as, collapseJsWhitespace as at, countProperties as au, countRules as av, detectDialect as aw, detectOperationType as ax, detectRedos as ay, envToExport as az, type ApiInfo as b, removeHtmlComments as b0, removeJsComments as b1, removeRedundantAttributes as b2, searchCheatsheet as b3, searchEndpoints as b4, splitStatements as b5, testGitignorePatterns as b6, testPattern as b7, testRegex as b8, validateAria as b9, validateEditorConfig as ba, validateEnvKey as bb, validatePackageExports as bc, validateTsconfig as bd, code as c, type AriaIssue as d, type AriaValidationResult as e, type CheatsheetEntry as f, type CommitTrailer as g, type CommitTrailerResult as h, type ConventionalCommitFinding as i, type ConventionalCommitFooter as j, type ConventionalCommitOptions as k, type ConventionalCommitParsed as l, type ConventionalCommitResult as m, type ConventionalCommitSeverity as n, type CssResult as o, type DependencyAuditDuplicate as p, type DependencyAuditEntry as q, type DependencyAuditIssue as r, type DependencyAuditResult as s, type DependencyRangeType as t, type DependencySection as u, type DockerImageRef as v, type EditorConfigProperty as w, type EditorConfigSection as x, type EditorConfigValidationResult as y, type EnvEntry as z };
@@ -30,6 +30,7 @@
30
30
  * - svg-sprite-symbol-extractor (extractSvgSpriteSymbols)
31
31
  * - git-commit-trailer-parser (parseCommitTrailers)
32
32
  * - markdown-footnote-extractor (extractMarkdownFootnotes)
33
+ * - aria-validator (validateAria)
33
34
  */
34
35
  type RegexFlag = 'g' | 'i' | 'm' | 's' | 'u';
35
36
  declare const ALL_FLAGS: RegexFlag[];
@@ -622,10 +623,38 @@ interface MarkdownFootnoteResult {
622
623
  declare function extractMarkdownFootnotes(markdown: string): MarkdownFootnoteResult | {
623
624
  error: string;
624
625
  };
626
+ interface AriaIssue {
627
+ element: string;
628
+ role: string | null;
629
+ severity: 'error' | 'warning';
630
+ message: string;
631
+ }
632
+ interface AriaValidationResult {
633
+ elementCount: number;
634
+ elementsWithRoleOrAria: number;
635
+ issues: AriaIssue[];
636
+ valid: boolean;
637
+ }
638
+ /**
639
+ * Parse an HTML snippet and check every `role` and `aria-*` attribute against
640
+ * a curated table of WAI-ARIA 1.2 roles: unknown role names, an aria-*
641
+ * attribute not permitted on the element's role, an unrecognized aria-*
642
+ * attribute name (likely typo) on an element with no role, and a widget role
643
+ * missing one of its required aria-* states (e.g. `role="checkbox"` without
644
+ * `aria-checked`). This is pure lookup-table validation against a static
645
+ * table (no headless browser, no DOM rendering), and it does not check
646
+ * implicit ARIA semantics carried by plain HTML elements (e.g. a native
647
+ * `<button>` with no `role` attribute at all).
648
+ */
649
+ declare function validateAria(html: string): AriaValidationResult | {
650
+ error: string;
651
+ };
625
652
 
626
653
  declare const code_ALL_FLAGS: typeof ALL_FLAGS;
627
654
  type code_ApiEndpoint = ApiEndpoint;
628
655
  type code_ApiInfo = ApiInfo;
656
+ type code_AriaIssue = AriaIssue;
657
+ type code_AriaValidationResult = AriaValidationResult;
629
658
  declare const code_CHEATSHEET: typeof CHEATSHEET;
630
659
  type code_CheatsheetEntry = CheatsheetEntry;
631
660
  type code_CommitTrailer = CommitTrailer;
@@ -747,12 +776,13 @@ declare const code_splitStatements: typeof splitStatements;
747
776
  declare const code_testGitignorePatterns: typeof testGitignorePatterns;
748
777
  declare const code_testPattern: typeof testPattern;
749
778
  declare const code_testRegex: typeof testRegex;
779
+ declare const code_validateAria: typeof validateAria;
750
780
  declare const code_validateEditorConfig: typeof validateEditorConfig;
751
781
  declare const code_validateEnvKey: typeof validateEnvKey;
752
782
  declare const code_validatePackageExports: typeof validatePackageExports;
753
783
  declare const code_validateTsconfig: typeof validateTsconfig;
754
784
  declare namespace code {
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 };
785
+ export { code_ALL_FLAGS as ALL_FLAGS, type code_ApiEndpoint as ApiEndpoint, type code_ApiInfo as ApiInfo, type code_AriaIssue as AriaIssue, type code_AriaValidationResult as AriaValidationResult, 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_validateAria as validateAria, code_validateEditorConfig as validateEditorConfig, code_validateEnvKey as validateEnvKey, code_validatePackageExports as validatePackageExports, code_validateTsconfig as validateTsconfig };
756
786
  }
757
787
 
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 };
788
+ export { OPERATIONS as $, ALL_FLAGS as A, type EnvParseResult as B, CHEATSHEET as C, DEFAULT_COMMIT_TYPES as D, type EditorConfigIssue as E, type ExportsIssue as F, type ExportsShape as G, type ExportsValidationResult as H, type GitCommandConfig as I, type GitCommandResult as J, type GitOperation as K, type GithubUrlInfo as L, type GithubUrlType as M, type GitignoreTestResult as N, type GqlFormatResult as O, type HtmlFormatResult as P, type HtmlMinifyOptions as Q, type HtmlMinifyResult as R, type JsMinifyOptions as S, type JsMinifyResult as T, MIME_TABLE as U, type MarkdownFootnoteDefinition as V, type MarkdownFootnoteReference as W, type MarkdownFootnoteResult as X, type MatchResult as Y, type MimeEntry as Z, type MimeLookupResult as _, type ApiEndpoint as a, removeEmptyAttributes as a$, type ParsedSpec as a0, type RedosFinding as a1, type RedosResult as a2, type RedosSeverity as a3, type RegexBackreferenceInfo as a4, type RegexError as a5, type RegexFlag as a6, type RegexGroupAnalysis as a7, type RegexGroupInfo as a8, type RegexGroupIssue as a9, envToJson as aA, extractMarkdownFootnotes as aB, extractSvgSpriteSymbols as aC, formatCss as aD, formatGql as aE, formatHtml as aF, formatSql as aG, getEndpointsByTag as aH, getHtmlStats as aI, getJsStats as aJ, getMethodColor as aK, isValidTag as aL, lintConventionalCommit as aM, lookupMime as aN, minifyCss as aO, minifyGql as aP, minifyHtml as aQ, minifyJs as aR, minifySql as aS, normalizeRef as aT, parseCommitTrailers as aU, parseDockerImage as aV, parseEnv as aW, parseGitCommand as aX, parseGithubUrl as aY, parseSpec as aZ, removeConsoleCalls as a_, type RegexMatch as aa, type RegexResult as ab, type RegexSuccess as ac, SQL_DEFAULT_OPTIONS as ad, type Segment as ae, type SpecVersion as af, type SqlDialect as ag, type SqlFormatOptions as ah, type SvgSpriteResult as ai, type SvgSpriteSymbol as aj, type TestPatternResult as ak, type TsconfigIssue as al, type TsconfigValidationResult as am, analyzeRegexGroups as an, auditDependencyRanges as ao, buildDockerPull as ap, buildDockerRun as aq, buildGitCommand as ar, collapseHtmlWhitespace as as, collapseJsWhitespace as at, countProperties as au, countRules as av, detectDialect as aw, detectOperationType as ax, detectRedos as ay, envToExport as az, type ApiInfo as b, removeHtmlComments as b0, removeJsComments as b1, removeRedundantAttributes as b2, searchCheatsheet as b3, searchEndpoints as b4, splitStatements as b5, testGitignorePatterns as b6, testPattern as b7, testRegex as b8, validateAria as b9, validateEditorConfig as ba, validateEnvKey as bb, validatePackageExports as bc, validateTsconfig as bd, code as c, type AriaIssue as d, type AriaValidationResult as e, type CheatsheetEntry as f, type CommitTrailer as g, type CommitTrailerResult as h, type ConventionalCommitFinding as i, type ConventionalCommitFooter as j, type ConventionalCommitOptions as k, type ConventionalCommitParsed as l, type ConventionalCommitResult as m, type ConventionalCommitSeverity as n, type CssResult as o, type DependencyAuditDuplicate as p, type DependencyAuditEntry as q, type DependencyAuditIssue as r, type DependencyAuditResult as s, type DependencyRangeType as t, type DependencySection as u, type DockerImageRef as v, type EditorConfigProperty as w, type EditorConfigSection as x, type EditorConfigValidationResult as y, type EnvEntry as z };
package/dist/index.cjs CHANGED
@@ -8571,12 +8571,14 @@ __export(units_exports, {
8571
8571
  calculateFreelancerRate: () => calculateFreelancerRate,
8572
8572
  calculateGpa: () => calculateGpa,
8573
8573
  calculateLoan: () => calculateLoan,
8574
+ calculateLoanPrepaymentPenalty: () => calculateLoanPrepaymentPenalty,
8574
8575
  calculateLoanRefinance: () => calculateLoanRefinance,
8575
8576
  calculateMarginMarkup: () => calculateMarginMarkup,
8576
8577
  calculateMortgagePoints: () => calculateMortgagePoints,
8577
8578
  calculateMovingAverages: () => calculateMovingAverages,
8578
8579
  calculatePaybackPeriod: () => calculatePaybackPeriod,
8579
8580
  calculatePercentageChange: () => calculatePercentageChange,
8581
+ calculateRequiredBandwidth: () => calculateRequiredBandwidth,
8580
8582
  calculateRoi: () => calculateRoi,
8581
8583
  calculateRuleOf72: () => calculateRuleOf72,
8582
8584
  calculateSavingsGoal: () => calculateSavingsGoal,
@@ -8585,6 +8587,7 @@ __export(units_exports, {
8585
8587
  calculateTaxEquivalentYield: () => calculateTaxEquivalentYield,
8586
8588
  calculateTimeValue: () => calculateTimeValue,
8587
8589
  calculateTipSplit: () => calculateTipSplit,
8590
+ calculateTransferTime: () => calculateTransferTime,
8588
8591
  calculateVideoBitrate: () => calculateVideoBitrate,
8589
8592
  compareSemver: () => compareSemver,
8590
8593
  compareUnitPrices: () => compareUnitPrices,
@@ -11196,6 +11199,103 @@ function calculateMortgagePoints(loanAmount, baseRatePercent, termMonths, points
11196
11199
  totalInterestSavings: round2(withoutPoints.totalInterest - withPoints.totalInterest)
11197
11200
  };
11198
11201
  }
11202
+ function calculateLoanPrepaymentPenalty(payoffBalance, penaltyType, params) {
11203
+ if (!Number.isFinite(payoffBalance) || payoffBalance <= 0) {
11204
+ return { error: "Payoff balance must be a positive number" };
11205
+ }
11206
+ if (penaltyType !== "percent-of-balance" && penaltyType !== "months-of-interest") {
11207
+ return { error: 'penaltyType must be "percent-of-balance" or "months-of-interest"' };
11208
+ }
11209
+ let penaltyAmount;
11210
+ if (penaltyType === "percent-of-balance") {
11211
+ const penaltyPercent = params.penaltyPercent;
11212
+ if (!Number.isFinite(penaltyPercent) || penaltyPercent < 0) {
11213
+ return { error: "penaltyPercent must be zero or a positive number" };
11214
+ }
11215
+ penaltyAmount = round2(payoffBalance * (penaltyPercent / 100));
11216
+ } else {
11217
+ const monthsOfInterest = params.monthsOfInterest;
11218
+ const annualRatePercent = params.annualRatePercent;
11219
+ if (!Number.isFinite(monthsOfInterest) || monthsOfInterest < 0) {
11220
+ return { error: "monthsOfInterest must be zero or a positive number" };
11221
+ }
11222
+ if (!Number.isFinite(annualRatePercent) || annualRatePercent < 0) {
11223
+ return { error: "annualRatePercent must be zero or a positive number" };
11224
+ }
11225
+ const monthlyInterest = payoffBalance * (annualRatePercent / 100 / 12);
11226
+ penaltyAmount = round2(monthlyInterest * monthsOfInterest);
11227
+ }
11228
+ return {
11229
+ payoffBalance: round2(payoffBalance),
11230
+ penaltyType,
11231
+ penaltyAmount,
11232
+ effectivePenaltyPercent: round2(penaltyAmount / payoffBalance * 100),
11233
+ totalPayoffCost: round2(payoffBalance + penaltyAmount)
11234
+ };
11235
+ }
11236
+ var FILE_SIZE_UNIT_BYTES = {
11237
+ B: 1,
11238
+ KB: 1e3,
11239
+ MB: 1e6,
11240
+ GB: 1e9,
11241
+ TB: 1e12
11242
+ };
11243
+ var SPEED_UNIT_BITS_PER_SECOND = {
11244
+ Kbps: 1e3,
11245
+ Mbps: 1e6,
11246
+ Gbps: 1e9,
11247
+ KBps: 1e3 * 8,
11248
+ MBps: 1e6 * 8,
11249
+ GBps: 1e9 * 8
11250
+ };
11251
+ function formatDurationSeconds(totalSeconds) {
11252
+ if (totalSeconds < 1) return `${(totalSeconds * 1e3).toFixed(0)}ms`;
11253
+ if (totalSeconds < 60) {
11254
+ const decimals = totalSeconds < 10 && totalSeconds % 1 !== 0 ? 1 : 0;
11255
+ return `${totalSeconds.toFixed(decimals)}s`;
11256
+ }
11257
+ const days = Math.floor(totalSeconds / 86400);
11258
+ const hours = Math.floor(totalSeconds % 86400 / 3600);
11259
+ const minutes = Math.floor(totalSeconds % 3600 / 60);
11260
+ const seconds = Math.round(totalSeconds % 60);
11261
+ const parts = [];
11262
+ if (days > 0) parts.push(`${days}d`);
11263
+ if (hours > 0) parts.push(`${hours}h`);
11264
+ if (minutes > 0) parts.push(`${minutes}m`);
11265
+ if (seconds > 0 || parts.length === 0) parts.push(`${seconds}s`);
11266
+ return parts.join(" ");
11267
+ }
11268
+ function calculateTransferTime(fileSize, fileSizeUnit, speed, speedUnit) {
11269
+ if (!Number.isFinite(fileSize) || fileSize <= 0) return { error: "File size must be a positive number" };
11270
+ if (!Number.isFinite(speed) || speed <= 0) return { error: "Connection speed must be a positive number" };
11271
+ if (!(fileSizeUnit in FILE_SIZE_UNIT_BYTES)) return { error: `Unsupported file size unit: ${fileSizeUnit}` };
11272
+ if (!(speedUnit in SPEED_UNIT_BITS_PER_SECOND)) return { error: `Unsupported speed unit: ${speedUnit}` };
11273
+ const fileSizeBytes = fileSize * FILE_SIZE_UNIT_BYTES[fileSizeUnit];
11274
+ const speedBitsPerSecond = speed * SPEED_UNIT_BITS_PER_SECOND[speedUnit];
11275
+ const transferTimeSeconds = fileSizeBytes * 8 / speedBitsPerSecond;
11276
+ return {
11277
+ fileSizeBytes,
11278
+ speedBitsPerSecond,
11279
+ transferTimeSeconds,
11280
+ formattedTime: formatDurationSeconds(transferTimeSeconds)
11281
+ };
11282
+ }
11283
+ function calculateRequiredBandwidth(fileSize, fileSizeUnit, targetSeconds) {
11284
+ if (!Number.isFinite(fileSize) || fileSize <= 0) return { error: "File size must be a positive number" };
11285
+ if (!Number.isFinite(targetSeconds) || targetSeconds <= 0) {
11286
+ return { error: "Target time must be a positive number of seconds" };
11287
+ }
11288
+ if (!(fileSizeUnit in FILE_SIZE_UNIT_BYTES)) return { error: `Unsupported file size unit: ${fileSizeUnit}` };
11289
+ const fileSizeBytes = fileSize * FILE_SIZE_UNIT_BYTES[fileSizeUnit];
11290
+ const requiredBitsPerSecond = fileSizeBytes * 8 / targetSeconds;
11291
+ return {
11292
+ fileSizeBytes,
11293
+ targetSeconds,
11294
+ requiredBitsPerSecond,
11295
+ requiredMbps: requiredBitsPerSecond / 1e6,
11296
+ requiredMBps: requiredBitsPerSecond / 8 / 1e6
11297
+ };
11298
+ }
11199
11299
 
11200
11300
  // src/tools/network.ts
11201
11301
  var network_exports = {};
@@ -14754,7 +14854,8 @@ __export(api_exports, {
14754
14854
  signJwt: () => signJwt,
14755
14855
  validateCorsConfig: () => validateCorsConfig,
14756
14856
  validateCspConfig: () => validateCspConfig,
14757
- validateOgTags: () => validateOgTags
14857
+ validateOgTags: () => validateOgTags,
14858
+ verifyWebhookSignature: () => verifyWebhookSignature
14758
14859
  });
14759
14860
  function escapeShell(value) {
14760
14861
  return `'${value.replace(/'/g, "'\\''")}'`;
@@ -16087,6 +16188,40 @@ function generateTotp(secret, options = {}) {
16087
16188
  const secondsRemaining = periodSeconds - timestamp % periodSeconds;
16088
16189
  return { ...hotp, periodSeconds, secondsRemaining };
16089
16190
  }
16191
+ var WEBHOOK_HASH_ALGORITHMS = ["sha1", "sha256", "sha512"];
16192
+ function constantTimeEqual(a, b) {
16193
+ if (a.length !== b.length) return false;
16194
+ let diff = 0;
16195
+ for (let i = 0; i < a.length; i++) diff |= a.charCodeAt(i) ^ b.charCodeAt(i);
16196
+ return diff === 0;
16197
+ }
16198
+ function verifyWebhookSignature(payload, secret, signature, algorithm = "sha256") {
16199
+ if (!payload) return { error: "Payload is required" };
16200
+ if (!secret) return { error: "Secret is required" };
16201
+ if (!signature || !signature.trim()) return { error: "Signature is required" };
16202
+ if (!WEBHOOK_HASH_ALGORITHMS.includes(algorithm)) {
16203
+ return { error: "Algorithm must be one of sha1, sha256, sha512" };
16204
+ }
16205
+ const trimmedSignature = signature.trim();
16206
+ const prefixMatch = trimmedSignature.match(/^(sha1|sha256|sha512)=(.+)$/i);
16207
+ const providedSignature = prefixMatch ? prefixMatch[2].trim() : trimmedSignature;
16208
+ const expectedHex = crypto.createHmac(algorithm, secret).update(payload, "utf8").digest("hex");
16209
+ const expectedBase64 = crypto.createHmac(algorithm, secret).update(payload, "utf8").digest("base64");
16210
+ let matchedEncoding = null;
16211
+ if (constantTimeEqual(providedSignature.toLowerCase(), expectedHex.toLowerCase())) {
16212
+ matchedEncoding = "hex";
16213
+ } else if (constantTimeEqual(providedSignature, expectedBase64)) {
16214
+ matchedEncoding = "base64";
16215
+ }
16216
+ return {
16217
+ valid: matchedEncoding !== null,
16218
+ algorithm,
16219
+ expectedHex,
16220
+ expectedBase64,
16221
+ providedSignature: trimmedSignature,
16222
+ matchedEncoding
16223
+ };
16224
+ }
16090
16225
 
16091
16226
  // src/tools/code.ts
16092
16227
  var code_exports = {};
@@ -16147,6 +16282,7 @@ __export(code_exports, {
16147
16282
  testGitignorePatterns: () => testGitignorePatterns,
16148
16283
  testPattern: () => testPattern,
16149
16284
  testRegex: () => testRegex,
16285
+ validateAria: () => validateAria,
16150
16286
  validateEditorConfig: () => validateEditorConfig,
16151
16287
  validateEnvKey: () => validateEnvKey2,
16152
16288
  validatePackageExports: () => validatePackageExports,
@@ -19801,6 +19937,167 @@ function extractMarkdownFootnotes(markdown) {
19801
19937
  }
19802
19938
  return { definitionCount: definitions.length, referenceCount, definitions, references, unresolvedReferences, unusedDefinitions };
19803
19939
  }
19940
+ var ARIA_GLOBAL_ATTRS = /* @__PURE__ */ new Set([
19941
+ "aria-atomic",
19942
+ "aria-busy",
19943
+ "aria-controls",
19944
+ "aria-current",
19945
+ "aria-describedby",
19946
+ "aria-details",
19947
+ "aria-disabled",
19948
+ "aria-dropeffect",
19949
+ "aria-errormessage",
19950
+ "aria-flowto",
19951
+ "aria-grabbed",
19952
+ "aria-haspopup",
19953
+ "aria-hidden",
19954
+ "aria-invalid",
19955
+ "aria-keyshortcuts",
19956
+ "aria-label",
19957
+ "aria-labelledby",
19958
+ "aria-live",
19959
+ "aria-owns",
19960
+ "aria-relevant",
19961
+ "aria-roledescription"
19962
+ ]);
19963
+ var ARIA_ROLE_TABLE = {
19964
+ alert: { supported: ["aria-live", "aria-atomic"] },
19965
+ alertdialog: { supported: ["aria-modal"] },
19966
+ article: {},
19967
+ banner: {},
19968
+ button: { supported: ["aria-pressed", "aria-expanded", "aria-disabled"] },
19969
+ checkbox: { required: ["aria-checked"], supported: ["aria-readonly"] },
19970
+ columnheader: { supported: ["aria-sort", "aria-selected", "aria-readonly"] },
19971
+ combobox: { required: ["aria-expanded"], supported: ["aria-controls", "aria-autocomplete", "aria-activedescendant"] },
19972
+ complementary: {},
19973
+ contentinfo: {},
19974
+ dialog: { supported: ["aria-modal"] },
19975
+ form: {},
19976
+ grid: { supported: ["aria-multiselectable", "aria-activedescendant", "aria-level", "aria-readonly"] },
19977
+ gridcell: { supported: ["aria-selected", "aria-readonly", "aria-expanded"] },
19978
+ group: { supported: ["aria-activedescendant", "aria-disabled"] },
19979
+ heading: { required: ["aria-level"] },
19980
+ img: {},
19981
+ link: { supported: ["aria-disabled", "aria-expanded"] },
19982
+ list: {},
19983
+ listbox: { supported: ["aria-multiselectable", "aria-activedescendant", "aria-orientation"] },
19984
+ listitem: { supported: ["aria-level", "aria-posinset", "aria-setsize"] },
19985
+ log: { supported: ["aria-live", "aria-atomic"] },
19986
+ main: {},
19987
+ marquee: {},
19988
+ menu: { supported: ["aria-orientation", "aria-activedescendant"] },
19989
+ menubar: { supported: ["aria-orientation", "aria-activedescendant"] },
19990
+ menuitem: { supported: ["aria-disabled"] },
19991
+ menuitemcheckbox: { required: ["aria-checked"] },
19992
+ menuitemradio: { required: ["aria-checked"] },
19993
+ meter: { required: ["aria-valuenow"], supported: ["aria-valuemin", "aria-valuemax", "aria-valuetext"] },
19994
+ navigation: {},
19995
+ none: {},
19996
+ option: { supported: ["aria-selected", "aria-checked", "aria-posinset", "aria-setsize"] },
19997
+ presentation: {},
19998
+ progressbar: { supported: ["aria-valuenow", "aria-valuemin", "aria-valuemax", "aria-valuetext"] },
19999
+ radio: { required: ["aria-checked"] },
20000
+ radiogroup: { supported: ["aria-activedescendant"] },
20001
+ region: {},
20002
+ row: { supported: ["aria-selected", "aria-level", "aria-expanded"] },
20003
+ rowheader: { supported: ["aria-sort", "aria-selected", "aria-readonly"] },
20004
+ scrollbar: { required: ["aria-valuenow", "aria-controls"], supported: ["aria-valuemin", "aria-valuemax", "aria-orientation"] },
20005
+ search: {},
20006
+ searchbox: { supported: ["aria-multiline", "aria-placeholder", "aria-readonly", "aria-required", "aria-activedescendant", "aria-autocomplete"] },
20007
+ separator: { supported: ["aria-orientation", "aria-valuenow", "aria-valuemin", "aria-valuemax"] },
20008
+ slider: { required: ["aria-valuenow"], supported: ["aria-valuemin", "aria-valuemax", "aria-valuetext", "aria-orientation"] },
20009
+ spinbutton: { supported: ["aria-valuenow", "aria-valuemin", "aria-valuemax", "aria-valuetext", "aria-required"] },
20010
+ status: { supported: ["aria-live", "aria-atomic"] },
20011
+ switch: { required: ["aria-checked"] },
20012
+ tab: { supported: ["aria-selected", "aria-controls", "aria-disabled"] },
20013
+ table: { supported: ["aria-colcount", "aria-rowcount"] },
20014
+ tablist: { supported: ["aria-orientation", "aria-activedescendant", "aria-level"] },
20015
+ tabpanel: {},
20016
+ textbox: { supported: ["aria-multiline", "aria-placeholder", "aria-readonly", "aria-required", "aria-activedescendant", "aria-autocomplete"] },
20017
+ timer: {},
20018
+ toolbar: { supported: ["aria-orientation"] },
20019
+ tooltip: {},
20020
+ tree: { supported: ["aria-multiselectable", "aria-activedescendant", "aria-orientation"] },
20021
+ treegrid: { supported: ["aria-multiselectable", "aria-activedescendant", "aria-orientation", "aria-level", "aria-readonly"] },
20022
+ treeitem: { supported: ["aria-expanded", "aria-selected", "aria-checked", "aria-level"] }
20023
+ };
20024
+ var ARIA_ALL_KNOWN_ATTRS = new Set(ARIA_GLOBAL_ATTRS);
20025
+ for (const entry of Object.values(ARIA_ROLE_TABLE)) {
20026
+ for (const a of entry.required ?? []) ARIA_ALL_KNOWN_ATTRS.add(a);
20027
+ for (const a of entry.supported ?? []) ARIA_ALL_KNOWN_ATTRS.add(a);
20028
+ }
20029
+ var TAG_REGEX = /<([a-zA-Z][a-zA-Z0-9]*)\b((?:[^>"'/]|"[^"]*"|'[^']*')*)\/?>/g;
20030
+ var ATTR_REGEX = /([a-zA-Z][a-zA-Z0-9-]*)\s*=\s*(?:"([^"]*)"|'([^']*)')/g;
20031
+ function parseElements(html) {
20032
+ const elements = [];
20033
+ let match;
20034
+ TAG_REGEX.lastIndex = 0;
20035
+ while ((match = TAG_REGEX.exec(html)) !== null) {
20036
+ const tag = match[1].toLowerCase();
20037
+ if (tag === "script" || tag === "style" || tag === "!--") continue;
20038
+ const attrsStr = match[2] ?? "";
20039
+ const attrs = {};
20040
+ let attrMatch;
20041
+ ATTR_REGEX.lastIndex = 0;
20042
+ while ((attrMatch = ATTR_REGEX.exec(attrsStr)) !== null) {
20043
+ const name = attrMatch[1].toLowerCase();
20044
+ const value = attrMatch[2] ?? attrMatch[3] ?? "";
20045
+ attrs[name] = value;
20046
+ }
20047
+ elements.push({ tag, attrs, raw: match[0].length > 80 ? match[0].slice(0, 77) + "..." : match[0] });
20048
+ }
20049
+ return elements;
20050
+ }
20051
+ function validateAria(html) {
20052
+ if (!html || !html.trim()) return { error: "Input is empty" };
20053
+ const elements = parseElements(html);
20054
+ if (elements.length === 0) return { error: "No HTML elements found" };
20055
+ const issues = [];
20056
+ let elementsWithRoleOrAria = 0;
20057
+ for (const el of elements) {
20058
+ const roleAttr = el.attrs["role"];
20059
+ const ariaAttrNames = Object.keys(el.attrs).filter((a) => a.startsWith("aria-"));
20060
+ if (roleAttr === void 0 && ariaAttrNames.length === 0) continue;
20061
+ elementsWithRoleOrAria++;
20062
+ const roles = roleAttr !== void 0 ? roleAttr.trim().split(/\s+/).filter(Boolean) : [];
20063
+ const knownRoles = roles.filter((r) => Object.prototype.hasOwnProperty.call(ARIA_ROLE_TABLE, r));
20064
+ const unknownRoles = roles.filter((r) => !Object.prototype.hasOwnProperty.call(ARIA_ROLE_TABLE, r));
20065
+ for (const r of unknownRoles) {
20066
+ issues.push({ element: el.raw, role: r, severity: "error", message: `Unknown ARIA role "${r}"` });
20067
+ }
20068
+ const primaryRole = knownRoles[0];
20069
+ const roleDef = primaryRole ? ARIA_ROLE_TABLE[primaryRole] : void 0;
20070
+ if (roleDef?.required) {
20071
+ for (const req of roleDef.required) {
20072
+ if (el.attrs[req] === void 0) {
20073
+ issues.push({ element: el.raw, role: primaryRole, severity: "error", message: `role="${primaryRole}" is missing required attribute ${req}` });
20074
+ }
20075
+ }
20076
+ }
20077
+ for (const attrName of ariaAttrNames) {
20078
+ if (ARIA_GLOBAL_ATTRS.has(attrName)) continue;
20079
+ if (roleDef) {
20080
+ const allowed = /* @__PURE__ */ new Set([...roleDef.required ?? [], ...roleDef.supported ?? []]);
20081
+ if (!allowed.has(attrName)) {
20082
+ issues.push({
20083
+ element: el.raw,
20084
+ role: primaryRole ?? null,
20085
+ severity: "error",
20086
+ message: primaryRole ? `${attrName} is not permitted on role="${primaryRole}"` : `${attrName} is not a global aria-* attribute`
20087
+ });
20088
+ }
20089
+ } else if (!ARIA_ALL_KNOWN_ATTRS.has(attrName)) {
20090
+ issues.push({ element: el.raw, role: null, severity: "warning", message: `${attrName} is not a recognized aria-* attribute (possible typo)` });
20091
+ }
20092
+ }
20093
+ }
20094
+ return {
20095
+ elementCount: elements.length,
20096
+ elementsWithRoleOrAria,
20097
+ issues,
20098
+ valid: issues.every((i) => i.severity !== "error")
20099
+ };
20100
+ }
19804
20101
 
19805
20102
  // src/tools/color.ts
19806
20103
  var color_exports = {};
package/dist/index.d.cts CHANGED
@@ -5,10 +5,10 @@ export { t as text } from './text-DWUcY8H1.cjs';
5
5
  export { d as data } from './data-26TALa9U.cjs';
6
6
  export { g as generators } from './generators-DAXXrMvG.cjs';
7
7
  export { t as time } from './time-KqJjdqII.cjs';
8
- export { u as units } from './units-BgaUAUG5.cjs';
8
+ export { u as units } from './units-BqegyALA.cjs';
9
9
  export { n as network } from './network-Da3meCWM.cjs';
10
- export { a as api } from './api-C8rImfka.cjs';
11
- export { c as code } from './code-CoeD4Fmq.cjs';
10
+ export { a as api } from './api-CQnIUrVB.cjs';
11
+ export { c as code } from './code-46xO9xFf.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
@@ -5,10 +5,10 @@ export { t as text } from './text-DWUcY8H1.js';
5
5
  export { d as data } from './data-26TALa9U.js';
6
6
  export { g as generators } from './generators-DAXXrMvG.js';
7
7
  export { t as time } from './time-KqJjdqII.js';
8
- export { u as units } from './units-BgaUAUG5.js';
8
+ export { u as units } from './units-BqegyALA.js';
9
9
  export { n as network } from './network-Da3meCWM.js';
10
- export { a as api } from './api-C8rImfka.js';
11
- export { c as code } from './code-CoeD4Fmq.js';
10
+ export { a as api } from './api-CQnIUrVB.js';
11
+ export { c as code } from './code-46xO9xFf.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
@@ -1,8 +1,8 @@
1
1
  export { media_exports as media } from './chunk-PT4N4UBL.js';
2
- export { units_exports as units } from './chunk-XOUKIGJ4.js';
2
+ export { units_exports as units } from './chunk-RP574L5Z.js';
3
3
  export { network_exports as network } from './chunk-CXUOV672.js';
4
- export { api_exports as api } from './chunk-4S63T7Y4.js';
5
- export { code_exports as code } from './chunk-DAD2ZOTJ.js';
4
+ export { api_exports as api } from './chunk-U2HREMZU.js';
5
+ export { code_exports as code } from './chunk-XT2BQWXT.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';
@@ -1334,6 +1334,40 @@ function generateTotp(secret, options = {}) {
1334
1334
  const secondsRemaining = periodSeconds - timestamp % periodSeconds;
1335
1335
  return { ...hotp, periodSeconds, secondsRemaining };
1336
1336
  }
1337
+ var WEBHOOK_HASH_ALGORITHMS = ["sha1", "sha256", "sha512"];
1338
+ function constantTimeEqual(a, b) {
1339
+ if (a.length !== b.length) return false;
1340
+ let diff = 0;
1341
+ for (let i = 0; i < a.length; i++) diff |= a.charCodeAt(i) ^ b.charCodeAt(i);
1342
+ return diff === 0;
1343
+ }
1344
+ function verifyWebhookSignature(payload, secret, signature, algorithm = "sha256") {
1345
+ if (!payload) return { error: "Payload is required" };
1346
+ if (!secret) return { error: "Secret is required" };
1347
+ if (!signature || !signature.trim()) return { error: "Signature is required" };
1348
+ if (!WEBHOOK_HASH_ALGORITHMS.includes(algorithm)) {
1349
+ return { error: "Algorithm must be one of sha1, sha256, sha512" };
1350
+ }
1351
+ const trimmedSignature = signature.trim();
1352
+ const prefixMatch = trimmedSignature.match(/^(sha1|sha256|sha512)=(.+)$/i);
1353
+ const providedSignature = prefixMatch ? prefixMatch[2].trim() : trimmedSignature;
1354
+ const expectedHex = crypto.createHmac(algorithm, secret).update(payload, "utf8").digest("hex");
1355
+ const expectedBase64 = crypto.createHmac(algorithm, secret).update(payload, "utf8").digest("base64");
1356
+ let matchedEncoding = null;
1357
+ if (constantTimeEqual(providedSignature.toLowerCase(), expectedHex.toLowerCase())) {
1358
+ matchedEncoding = "hex";
1359
+ } else if (constantTimeEqual(providedSignature, expectedBase64)) {
1360
+ matchedEncoding = "base64";
1361
+ }
1362
+ return {
1363
+ valid: matchedEncoding !== null,
1364
+ algorithm,
1365
+ expectedHex,
1366
+ expectedBase64,
1367
+ providedSignature: trimmedSignature,
1368
+ matchedEncoding
1369
+ };
1370
+ }
1337
1371
 
1338
1372
  exports.COMMON_HEADERS = COMMON_HEADERS;
1339
1373
  exports.COMMON_PRESETS = COMMON_PRESETS;
@@ -1378,3 +1412,4 @@ exports.signJwt = signJwt;
1378
1412
  exports.validateCorsConfig = validateCorsConfig;
1379
1413
  exports.validateCspConfig = validateCspConfig;
1380
1414
  exports.validateOgTags = validateOgTags;
1415
+ exports.verifyWebhookSignature = verifyWebhookSignature;