color-name-list 13.17.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/dist/colornames.bestof.toon +4696 -0
- package/dist/colornames.short.toon +2963 -0
- package/dist/colornames.toon +29995 -0
- package/package.json +1 -1
- package/scripts/build.js +6 -0
- package/tests/formats.ci.test.js +16 -0
package/package.json
CHANGED
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: '"',
|
package/tests/formats.ci.test.js
CHANGED
|
@@ -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
|
});
|