Skip to content

Commit cb2cb2d

Browse files
committed
build(build): fixes typo in method name
1 parent ce5d29b commit cb2cb2d

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

scripts/build.js

+14-14
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ const src = fs.readFileSync(
4141
const colorsSrc = parseCSVString(src);
4242

4343
// sort by sorting criteria
44-
colorsSrc.entires.sort((a, b) => {
44+
colorsSrc.entries.sort((a, b) => {
4545
return a[sortBy].localeCompare(b[sortBy]);
4646
});
4747

@@ -101,7 +101,7 @@ if (isTestRun) {
101101

102102
// creates JS related files
103103
const JSONExportString = JSON.stringify(
104-
[...colorsSrc.entires].map( // removes good name attributes
104+
[...colorsSrc.entries].map( // removes good name attributes
105105
(val) => ({
106106
name: val.name,
107107
hex: val.hex,
@@ -110,7 +110,7 @@ const JSONExportString = JSON.stringify(
110110
);
111111

112112
const JSONExportStringBestOf = JSON.stringify(
113-
[...colorsSrc.entires].filter(
113+
[...colorsSrc.entries].filter(
114114
(val) => (val[bestOfKey])
115115
).map( // removes good name attributes
116116
(val) => ({
@@ -121,7 +121,7 @@ const JSONExportStringBestOf = JSON.stringify(
121121
);
122122

123123
const JSONExportStringShort = JSON.stringify(
124-
[...colorsSrc.entires]
124+
[...colorsSrc.entries]
125125
.filter(
126126
// make sure its only one word long
127127
(val) =>
@@ -154,19 +154,19 @@ fs.writeFileSync(
154154
);
155155

156156
// 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) => {
158158
obj[entry.hex.replace('#', '')] = entry.name;
159159
return obj;
160160
}, {});
161161

162-
const miniJSONExportObjBestOf = colorsSrc.entires.reduce((obj, entry) => {
162+
const miniJSONExportObjBestOf = colorsSrc.entries.reduce((obj, entry) => {
163163
if(entry[bestOfKey]) {
164164
obj[entry.hex.replace('#', '')] = entry.name;
165165
}
166166
return obj;
167167
}, {});
168168

169-
const miniJSONExportObjShort = colorsSrc.entires.reduce((obj, entry) => {
169+
const miniJSONExportObjShort = colorsSrc.entries.reduce((obj, entry) => {
170170
if (
171171
entry[bestOfKey] &&
172172
//entry.name.split(" ").length === 1 &&
@@ -287,7 +287,7 @@ const outputFormats = {
287287
for (const outputFormat in outputFormats) {
288288
if (outputFormats[outputFormat]) {
289289
let outputString = objArrToString(
290-
colorsSrc.entires,
290+
colorsSrc.entries,
291291
csvKeys,
292292
outputFormats[outputFormat]
293293
);
@@ -305,7 +305,7 @@ for (const outputFormat in outputFormats) {
305305
for (const outputFormat in outputFormats) {
306306
if (outputFormats[outputFormat]) {
307307
let outputString = objArrToString(
308-
colorsSrc.entires.filter((val) => (val[bestOfKey])),
308+
colorsSrc.entries.filter((val) => (val[bestOfKey])),
309309
csvKeys,
310310
outputFormats[outputFormat]
311311
);
@@ -323,7 +323,7 @@ for (const outputFormat in outputFormats) {
323323
for (const outputFormat in outputFormats) {
324324
if (outputFormats[outputFormat]) {
325325
let outputString = objArrToString(
326-
colorsSrc.entires.filter(
326+
colorsSrc.entries.filter(
327327
(val) =>
328328
val[bestOfKey] &&
329329
//val.name.split(" ").length === 1 &&
@@ -352,15 +352,15 @@ fs.writeFileSync(
352352
readme.replace(
353353
// update color count in text
354354
/__\d+__/g,
355-
`__${colorsSrc.entires.length}__`
355+
`__${colorsSrc.entries.length}__`
356356
).replace(
357357
// update color count in badge
358358
/\d+-colors-orange/,
359-
`${colorsSrc.entires.length}-colors-orange`
359+
`${colorsSrc.entries.length}-colors-orange`
360360
).replace(
361361
// update color count in percentage
362362
/__\d+(\.\d+)?%__/,
363-
`__${((colorsSrc.entires.length / (256 * 256 * 256)) * 100).toFixed(2)}%__`
363+
`__${((colorsSrc.entries.length / (256 * 256 * 256)) * 100).toFixed(2)}%__`
364364
).replace(
365365
// update file size
366366
/\d+(\.\d+)? MB\)__/g,
@@ -399,7 +399,7 @@ function showLog() {
399399
function log(key, value, message, errorLevel = 1) {
400400
const error = {};
401401
// looks for the original item that caused the error
402-
error.entries = colorsSrc.entires.filter((entry) => {
402+
error.entries = colorsSrc.entries.filter((entry) => {
403403
return entry[key] === value;
404404
});
405405

scripts/lib.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ export const parseCSVString = (
2727
values[header] = [];
2828
});
2929

30-
const entires = rows.map((row) => {
30+
const entries = rows.map((row) => {
3131
// decomposes each row into its single entries
3232
const rowArr = row.split(csvDelimitor);
3333

@@ -46,7 +46,7 @@ export const parseCSVString = (
4646
return entry;
4747
});
4848

49-
return {headers, entires, values};
49+
return {headers, entries, values};
5050
};
5151

5252
/**

0 commit comments

Comments
 (0)