@@ -41,7 +41,7 @@ const src = fs.readFileSync(
41
41
const colorsSrc = parseCSVString ( src ) ;
42
42
43
43
// sort by sorting criteria
44
- colorsSrc . entires . sort ( ( a , b ) => {
44
+ colorsSrc . entries . sort ( ( a , b ) => {
45
45
return a [ sortBy ] . localeCompare ( b [ sortBy ] ) ;
46
46
} ) ;
47
47
@@ -101,7 +101,7 @@ if (isTestRun) {
101
101
102
102
// creates JS related files
103
103
const JSONExportString = JSON . stringify (
104
- [ ...colorsSrc . entires ] . map ( // removes good name attributes
104
+ [ ...colorsSrc . entries ] . map ( // removes good name attributes
105
105
( val ) => ( {
106
106
name : val . name ,
107
107
hex : val . hex ,
@@ -110,7 +110,7 @@ const JSONExportString = JSON.stringify(
110
110
) ;
111
111
112
112
const JSONExportStringBestOf = JSON . stringify (
113
- [ ...colorsSrc . entires ] . filter (
113
+ [ ...colorsSrc . entries ] . filter (
114
114
( val ) => ( val [ bestOfKey ] )
115
115
) . map ( // removes good name attributes
116
116
( val ) => ( {
@@ -121,7 +121,7 @@ const JSONExportStringBestOf = JSON.stringify(
121
121
) ;
122
122
123
123
const JSONExportStringShort = JSON . stringify (
124
- [ ...colorsSrc . entires ]
124
+ [ ...colorsSrc . entries ]
125
125
. filter (
126
126
// make sure its only one word long
127
127
( val ) =>
@@ -154,19 +154,19 @@ fs.writeFileSync(
154
154
) ;
155
155
156
156
// creates a more compact JSON file, where the HEX color serves as an id
157
- const miniJSONExportObj = colorsSrc . entires . reduce ( ( obj , entry ) => {
157
+ const miniJSONExportObj = colorsSrc . entries . reduce ( ( obj , entry ) => {
158
158
obj [ entry . hex . replace ( '#' , '' ) ] = entry . name ;
159
159
return obj ;
160
160
} , { } ) ;
161
161
162
- const miniJSONExportObjBestOf = colorsSrc . entires . reduce ( ( obj , entry ) => {
162
+ const miniJSONExportObjBestOf = colorsSrc . entries . reduce ( ( obj , entry ) => {
163
163
if ( entry [ bestOfKey ] ) {
164
164
obj [ entry . hex . replace ( '#' , '' ) ] = entry . name ;
165
165
}
166
166
return obj ;
167
167
} , { } ) ;
168
168
169
- const miniJSONExportObjShort = colorsSrc . entires . reduce ( ( obj , entry ) => {
169
+ const miniJSONExportObjShort = colorsSrc . entries . reduce ( ( obj , entry ) => {
170
170
if (
171
171
entry [ bestOfKey ] &&
172
172
//entry.name.split(" ").length === 1 &&
@@ -287,7 +287,7 @@ const outputFormats = {
287
287
for ( const outputFormat in outputFormats ) {
288
288
if ( outputFormats [ outputFormat ] ) {
289
289
let outputString = objArrToString (
290
- colorsSrc . entires ,
290
+ colorsSrc . entries ,
291
291
csvKeys ,
292
292
outputFormats [ outputFormat ]
293
293
) ;
@@ -305,7 +305,7 @@ for (const outputFormat in outputFormats) {
305
305
for ( const outputFormat in outputFormats ) {
306
306
if ( outputFormats [ outputFormat ] ) {
307
307
let outputString = objArrToString (
308
- colorsSrc . entires . filter ( ( val ) => ( val [ bestOfKey ] ) ) ,
308
+ colorsSrc . entries . filter ( ( val ) => ( val [ bestOfKey ] ) ) ,
309
309
csvKeys ,
310
310
outputFormats [ outputFormat ]
311
311
) ;
@@ -323,7 +323,7 @@ for (const outputFormat in outputFormats) {
323
323
for ( const outputFormat in outputFormats ) {
324
324
if ( outputFormats [ outputFormat ] ) {
325
325
let outputString = objArrToString (
326
- colorsSrc . entires . filter (
326
+ colorsSrc . entries . filter (
327
327
( val ) =>
328
328
val [ bestOfKey ] &&
329
329
//val.name.split(" ").length === 1 &&
@@ -352,15 +352,15 @@ fs.writeFileSync(
352
352
readme . replace (
353
353
// update color count in text
354
354
/ _ _ \d + _ _ / g,
355
- `__${ colorsSrc . entires . length } __`
355
+ `__${ colorsSrc . entries . length } __`
356
356
) . replace (
357
357
// update color count in badge
358
358
/ \d + - c o l o r s - o r a n g e / ,
359
- `${ colorsSrc . entires . length } -colors-orange`
359
+ `${ colorsSrc . entries . length } -colors-orange`
360
360
) . replace (
361
361
// update color count in percentage
362
362
/ _ _ \d + ( \. \d + ) ? % _ _ / ,
363
- `__${ ( ( colorsSrc . entires . length / ( 256 * 256 * 256 ) ) * 100 ) . toFixed ( 2 ) } %__`
363
+ `__${ ( ( colorsSrc . entries . length / ( 256 * 256 * 256 ) ) * 100 ) . toFixed ( 2 ) } %__`
364
364
) . replace (
365
365
// update file size
366
366
/ \d + ( \. \d + ) ? M B \) _ _ / g,
@@ -399,7 +399,7 @@ function showLog() {
399
399
function log ( key , value , message , errorLevel = 1 ) {
400
400
const error = { } ;
401
401
// looks for the original item that caused the error
402
- error . entries = colorsSrc . entires . filter ( ( entry ) => {
402
+ error . entries = colorsSrc . entries . filter ( ( entry ) => {
403
403
return entry [ key ] === value ;
404
404
} ) ;
405
405
0 commit comments