color-name-list 13.16.0 → 13.18.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "color-name-list",
3
- "version": "13.16.0",
3
+ "version": "13.18.0",
4
4
  "description": "long list of color names",
5
5
  "main": "dist/colornames.json",
6
6
  "browser": "dist/colornames.umd.js",
@@ -60,7 +60,7 @@
60
60
  "@eslint/js": "^9.25.1",
61
61
  "closestvector": "^0.6.0",
62
62
  "color-name-lists": "^3.2.0",
63
- "commitizen": "^3.0.0",
63
+ "commitizen": "^4.3.1",
64
64
  "eslint": "^9.25.1",
65
65
  "eslint-config-google": "^0.10.0",
66
66
  "eslint-config-prettier": "^10.1.2",
@@ -71,6 +71,7 @@
71
71
  "prettier": "^3.5.3",
72
72
  "seedrandom": "^3.0.5",
73
73
  "semantic-release": "^24.2.0",
74
+ "typescript": "5.9.3",
74
75
  "vitest": "^3.1.2"
75
76
  },
76
77
  "engines": {
package/scripts/build.js CHANGED
@@ -179,6 +179,12 @@ const outputFormats = {
179
179
  csv: {
180
180
  insertBefore: csvKeys.join(',') + '\n',
181
181
  },
182
+ toon: {
183
+ // TOON tabular array header for flat objects: [N]{name,hex}:
184
+ insertBefore: `[${colorsSrc.entries.length}]{${csvKeys.join(',')}}:\n `,
185
+ itemDelimitor: ',',
186
+ rowDelimitor: '\n ',
187
+ },
182
188
  yaml: {
183
189
  insertBefore: '-\n ',
184
190
  beforeValue: '"',
@@ -44,4 +44,20 @@ describe('Other Format Tests', () => {
44
44
  expect(mainData.entries[0]).toHaveProperty('hex');
45
45
  });
46
46
  });
47
+
48
+ describe('TOON Output', () => {
49
+ it('should generate TOON files alongside other formats', () => {
50
+ const mainToon = fs.readFileSync(path.resolve('./dist/colornames.toon'), 'utf8');
51
+ const bestofToon = fs.readFileSync(path.resolve('./dist/colornames.bestof.toon'), 'utf8');
52
+ const shortToon = fs.readFileSync(path.resolve('./dist/colornames.short.toon'), 'utf8');
53
+
54
+ expect(mainToon.length).toBeGreaterThan(0);
55
+ expect(bestofToon.length).toBeGreaterThan(0);
56
+ expect(shortToon.length).toBeGreaterThan(0);
57
+
58
+ // Basic TOON shape: header with array length and fields, then at least one data row
59
+ expect(mainToon).toMatch(/\[\d+\]{name,hex}:/);
60
+ expect(mainToon).toMatch(/\n\s+[^,]+,#?[0-9a-fA-F]{6}/);
61
+ });
62
+ });
47
63
  });