Skip to content

Commit

Permalink
chore(editorconfig): changes line-endings
Browse files Browse the repository at this point in the history
  • Loading branch information
meodai committed Jun 28, 2024
1 parent fe95d71 commit 5f2a621
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ indent_size = 2
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
end_of_line = crlf
end_of_line = lf
# editorconfig-tools is unable to ignore longs strings or urls
max_line_length = null

Expand Down
2 changes: 1 addition & 1 deletion dist/history.json

Large diffs are not rendered by default.

22 changes: 15 additions & 7 deletions scripts/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,14 +71,22 @@ colorsSrc.values['name'].forEach((name) => {
});

// loop good name markers
colorsSrc.values['good name'].forEach((str) => {
colorsSrc.values[bestOfKey].forEach((str) => {
// check for spaces
if (spacesValidation.test(str)) {
log('"good name" marker', str, `${str} found either a leading or trailing space (or both)`);
log(
`"${bestOfKey}" marker'`,
str,
`${str} found either a leading or trailing space (or both)`
);
}

if (!(str == 'x' || str == '')) {
log('"good name" marker', str, `${str} must be a lowercase "x" character or empty`);
if (!(str == "x" || str == "")) {
log(
`"${bestOfKey}" marker`,
str,
`${str} must be a lowercase "x" character or empty`
);
}
});

Expand All @@ -101,7 +109,7 @@ const JSONExportString = JSON.stringify(

const JSONExportStringBestOf = JSON.stringify(
[...colorsSrc.entires].filter(
(val) => (val['good name'])
(val) => (val[bestOfKey])
).map( // removes good name attributes
(val) => ({
name: val.name,
Expand All @@ -127,7 +135,7 @@ const miniJSONExportObj = colorsSrc.entires.reduce((obj, entry) => {
}, {});

const miniJSONExportObjBestOf = colorsSrc.entires.reduce((obj, entry) => {
if(entry['good name']) {
if(entry[bestOfKey]) {
obj[entry.hex.replace('#', '')] = entry.name;
}
return obj;
Expand Down Expand Up @@ -242,7 +250,7 @@ for (const outputFormat in outputFormats) {
for (const outputFormat in outputFormats) {
if (outputFormats[outputFormat]) {
let outputString = objArrToString(
colorsSrc.entires.filter((val) => (val['good name'])),
colorsSrc.entires.filter((val) => (val[bestOfKey])),
csvKeys,
outputFormats[outputFormat]
);
Expand Down

0 comments on commit 5f2a621

Please sign in to comment.