MCPcopy Create free account
hub / github.com/GCWing/BitFun / collectRepositoryNearPairRows

Function collectRepositoryNearPairRows

scripts/audit-theme-colors.test.mjs:67–86  ·  view source on GitHub ↗
(sourceRoot, report)

Source from the content-addressed store, hash-verified

65}
66
67function collectRepositoryNearPairRows(sourceRoot, report) {
68 return COLOR_DOMAIN_KEYS.flatMap((domain) => {
69 const pairs = report.colorDomainNearPairs?.[domain];
70 if (!pairs) {
71 return [];
72 }
73 return [
74 ...(pairs.indistinguishable ?? []),
75 ...(pairs.near ?? []),
76 ].map(pair => ({
77 root: sourceRoot,
78 domain,
79 key: pair.key,
80 }));
81 }).sort((left, right) => (
82 left.root.localeCompare(right.root)
83 || left.domain.localeCompare(right.domain)
84 || left.key.localeCompare(right.key)
85 ));
86}
87
88function formatNearPairDecisionKey(row) {
89 return `${row.root}:${row.domain}:${row.key}`;

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected