color-name-list 13.19.0 → 13.19.2
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/CONTRIBUTING.md +3 -0
- package/README.md +71 -50
- package/changes.svg +3 -3
- package/dist/colornames.bestof.csv +40 -31
- 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.toon +41 -32
- package/dist/colornames.bestof.umd.js +1 -1
- package/dist/colornames.bestof.xml +67 -31
- package/dist/colornames.bestof.yaml +58 -31
- package/dist/colornames.csv +120 -127
- 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 +8 -8
- 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.toon +9 -9
- package/dist/colornames.short.umd.js +1 -1
- package/dist/colornames.short.xml +8 -8
- package/dist/colornames.short.yaml +8 -8
- package/dist/colornames.toon +121 -128
- package/dist/colornames.umd.js +1 -1
- package/dist/colornames.xml +141 -169
- package/dist/colornames.yaml +134 -155
- package/dist/history.json +1 -1
- package/package.json +1 -1
- package/scripts/build.js +2 -2
- package/scripts/lib.js +27 -2
- package/src/colornames.csv +120 -127
- package/tests/duplicates.test.js +65 -0
- package/tests/title-case-allowlist.json +46 -0
- package/tests/title-case.test.js +4 -2
package/package.json
CHANGED
package/scripts/build.js
CHANGED
|
@@ -295,8 +295,8 @@ fs.writeFileSync(
|
|
|
295
295
|
)
|
|
296
296
|
.replace(
|
|
297
297
|
// update file size (update all occurrences)
|
|
298
|
-
|
|
299
|
-
|
|
298
|
+
/Bundle size note \(≈?\d+(\.\d+)? MB\)__/g,
|
|
299
|
+
`Bundle size note (${(
|
|
300
300
|
fs.statSync(path.normalize(`${baseFolder}${folderDist}${fileNameSrc}.json`)).size /
|
|
301
301
|
1024 /
|
|
302
302
|
1024
|
package/scripts/lib.js
CHANGED
|
@@ -153,15 +153,40 @@ export const findNearDuplicateNameConflicts = (items, options = {}) => {
|
|
|
153
153
|
)
|
|
154
154
|
: null;
|
|
155
155
|
|
|
156
|
+
// Note: We intentionally do NOT fold business/legal suffixes globally here,
|
|
157
|
+
// as the dataset contains legitimate color names like "Limited Lime".
|
|
158
|
+
|
|
156
159
|
// Helper: normalize name using current options (stopword folding if enabled)
|
|
157
160
|
const normalizeForOptions = (name) => {
|
|
158
|
-
|
|
161
|
+
// Pre-pass: normalize symbols/abbreviations before tokenization
|
|
162
|
+
let base = String(name)
|
|
159
163
|
.toLowerCase()
|
|
160
164
|
.normalize('NFD')
|
|
161
165
|
.replace(/[\u0300-\u036f]/g, '');
|
|
166
|
+
// Symbolic swaps
|
|
167
|
+
base = base
|
|
168
|
+
.replace(/@/g, ' at ')
|
|
169
|
+
.replace(/[&+]/g, ' and ')
|
|
170
|
+
.replace(/\bw\/o\b/g, ' without ')
|
|
171
|
+
.replace(/\bw\//g, ' with ');
|
|
172
|
+
// Keep marketing spellings (lite/thru/nite) as-is globally to avoid over-merging
|
|
162
173
|
const tokens = base.match(/[a-z0-9]+/g) || [];
|
|
174
|
+
|
|
175
|
+
// Conjunction normalization: treat variants of "and" as the same token.
|
|
176
|
+
// This includes: "and", "n", "n'", "n`", "&", "+" (after stripping punctuation).
|
|
177
|
+
const normalizedTokens = tokens.map((t) => {
|
|
178
|
+
const raw = t.replace(/[`']/g, '');
|
|
179
|
+
if (raw === 'and' || raw === 'n') return 'and';
|
|
180
|
+
if (raw === '2') return 'to';
|
|
181
|
+
if (raw === '4') return 'for';
|
|
182
|
+
if (raw === 'u') return 'you';
|
|
183
|
+
if (raw === 'r') return 'are';
|
|
184
|
+
return raw;
|
|
185
|
+
});
|
|
163
186
|
const filtered =
|
|
164
|
-
foldStopwords && stopSet && stopSet.size
|
|
187
|
+
foldStopwords && stopSet && stopSet.size
|
|
188
|
+
? normalizedTokens.filter((t) => !stopSet.has(t))
|
|
189
|
+
: normalizedTokens;
|
|
165
190
|
return filtered.length ? filtered.join('') : normalizeNameForDuplicates(name);
|
|
166
191
|
};
|
|
167
192
|
|