color-name-list 13.2.0 → 13.4.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/README.md +3 -3
- package/changes.svg +3 -3
- package/dist/colornames.bestof.csv +37 -15
- package/dist/colornames.bestof.esm.js +1 -1
- package/dist/colornames.bestof.esm.mjs +1 -1
- package/dist/colornames.bestof.html +1 -1
- package/dist/colornames.bestof.json +1 -1
- package/dist/colornames.bestof.min.json +1 -1
- package/dist/colornames.bestof.scss +1 -1
- package/dist/colornames.bestof.umd.js +1 -1
- package/dist/colornames.bestof.xml +139 -51
- package/dist/colornames.bestof.yaml +105 -39
- package/dist/colornames.csv +106 -291
- package/dist/colornames.esm.js +1 -1
- package/dist/colornames.esm.mjs +1 -1
- package/dist/colornames.html +1 -1
- package/dist/colornames.json +1 -1
- package/dist/colornames.min.json +1 -1
- package/dist/colornames.scss +1 -1
- package/dist/colornames.short.csv +18 -11
- package/dist/colornames.short.esm.js +1 -1
- package/dist/colornames.short.esm.mjs +1 -1
- package/dist/colornames.short.html +1 -1
- package/dist/colornames.short.json +1 -1
- package/dist/colornames.short.min.json +1 -1
- package/dist/colornames.short.scss +1 -1
- package/dist/colornames.short.umd.js +1 -1
- package/dist/colornames.short.xml +69 -41
- package/dist/colornames.short.yaml +52 -31
- package/dist/colornames.umd.js +1 -1
- package/dist/colornames.xml +336 -1076
- package/dist/colornames.yaml +260 -815
- package/dist/history.json +1 -1
- package/package.json +1 -1
- package/src/colornames.csv +115 -300
- package/tests/duplicate-allowlist.json +44 -1
- package/tests/duplicates.test.js +11 -8
|
@@ -36,5 +36,48 @@
|
|
|
36
36
|
"Dark as Night",
|
|
37
37
|
"Green With Envy",
|
|
38
38
|
"Lost in Space",
|
|
39
|
-
"Fruit of Passion"
|
|
39
|
+
"Fruit of Passion",
|
|
40
|
+
"Aroma Garden",
|
|
41
|
+
"Back in Black",
|
|
42
|
+
"Tea Rose",
|
|
43
|
+
"Red Violet",
|
|
44
|
+
"Blue Green",
|
|
45
|
+
"Blue Grey",
|
|
46
|
+
"Pink Red",
|
|
47
|
+
"Black Green",
|
|
48
|
+
"Red Purple",
|
|
49
|
+
"Red Revival",
|
|
50
|
+
"Purple Pink",
|
|
51
|
+
"Pearl White",
|
|
52
|
+
"Milk Chocolate",
|
|
53
|
+
"Violet Blue",
|
|
54
|
+
"Black Violet",
|
|
55
|
+
"Black Velvet",
|
|
56
|
+
"Rose Pearl",
|
|
57
|
+
"Yellow Orange",
|
|
58
|
+
"Red Orange",
|
|
59
|
+
"Pink Orange",
|
|
60
|
+
"Pine Mountain",
|
|
61
|
+
"Star of the Morning",
|
|
62
|
+
"Rose Madder",
|
|
63
|
+
"Lily the Pink",
|
|
64
|
+
"Purple Grey",
|
|
65
|
+
"Yellow Green",
|
|
66
|
+
"White Green",
|
|
67
|
+
"Turquoise Green",
|
|
68
|
+
"Green Teal",
|
|
69
|
+
"Yellow Brown",
|
|
70
|
+
"Grey Green",
|
|
71
|
+
"Grape Wine",
|
|
72
|
+
"Blue Light",
|
|
73
|
+
"Indigo Blue",
|
|
74
|
+
"Blue Purple",
|
|
75
|
+
"Blue Turquoise",
|
|
76
|
+
"Brown Green",
|
|
77
|
+
"Brown Grey",
|
|
78
|
+
"Brown Orange",
|
|
79
|
+
"Brown Red",
|
|
80
|
+
"Brown Rose",
|
|
81
|
+
"Honey Butter",
|
|
82
|
+
"Custard Cream"
|
|
40
83
|
]
|
package/tests/duplicates.test.js
CHANGED
|
@@ -74,6 +74,13 @@ describe('Duplicate-like color names', () => {
|
|
|
74
74
|
groups.get(key).push({ name: item.name, lineNumber: item.lineNumber, order });
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
+
// Build allowlist set once
|
|
78
|
+
const allowSet = new Set(
|
|
79
|
+
(Array.isArray(allowlist) ? allowlist : [])
|
|
80
|
+
.filter((v) => typeof v === 'string' && v.trim().length)
|
|
81
|
+
.map((v) => normalize(v))
|
|
82
|
+
);
|
|
83
|
+
|
|
77
84
|
const conflicts = [];
|
|
78
85
|
for (const [key, entries] of groups.entries()) {
|
|
79
86
|
// We have a potential conflict if we see both orders "a b" and "b a"
|
|
@@ -99,13 +106,9 @@ describe('Duplicate-like color names', () => {
|
|
|
99
106
|
})
|
|
100
107
|
.sort((a, b) => a.lineNumber - b.lineNumber);
|
|
101
108
|
|
|
102
|
-
// Respect allowlist: if
|
|
103
|
-
const
|
|
104
|
-
|
|
105
|
-
.filter((v) => typeof v === 'string' && v.trim().length)
|
|
106
|
-
.map((v) => normalize(v))
|
|
107
|
-
);
|
|
108
|
-
if (allowSet.has(forward) || allowSet.has(backward)) continue;
|
|
109
|
+
// Respect allowlist: check if any of the actual names are allowlisted
|
|
110
|
+
const hasAllowlisted = unique.some((e) => allowSet.has(normalize(e.name)));
|
|
111
|
+
if (hasAllowlisted) continue;
|
|
109
112
|
|
|
110
113
|
conflicts.push({ key, tokens: [t1, t2], entries: unique });
|
|
111
114
|
}
|
|
@@ -250,7 +253,7 @@ describe('Duplicate-like color names', () => {
|
|
|
250
253
|
expect(conflicts[0].entries.length).toBe(2);
|
|
251
254
|
});
|
|
252
255
|
|
|
253
|
-
it
|
|
256
|
+
it('should not contain two-word names that are exact reversals of each other', () => {
|
|
254
257
|
expect(csvTestData.lineCount).toBeGreaterThan(1);
|
|
255
258
|
|
|
256
259
|
const conflicts = findTwoWordReversedPairs(csvTestData.items);
|