Skip to content
This repository was archived by the owner on Dec 3, 2024. It is now read-only.

Commit 2721fcb

Browse files
Resolves build issues with node < 6
1 parent aa24408 commit 2721fcb

File tree

8 files changed

+12
-24
lines changed

8 files changed

+12
-24
lines changed

.eslintrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
}],
2525
"key-spacing": [0],
2626
"radix": [0],
27+
"strict": [0, "never"],
2728
"import/extensions": [0]
2829
}
2930
}

bin/__tests__/index.spec.js

Lines changed: 0 additions & 21 deletions
This file was deleted.

bin/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/usr/bin/env node
22

3-
'use strict'; // eslint-disable-line
3+
'use strict';
44

55
// EXTERNAL DEPENDENCIES
66
const fs = require('fs');

bin/modules/convert-rgb-to-hex.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
* @return {String} hex - the hex of the above color
55
*/
66

7+
'use strict';
78

89
const rgbHex = require('rgb-hex');
910
const removeAllFromStr = require('../utils/remove-all-from-str.js');
@@ -12,7 +13,7 @@ module.exports = (color) => {
1213
// strip other strings off
1314
const stripNonValRgbText = str => removeAllFromStr(str, ['rgb', '(', ')', ' ']);
1415
// rgbHex only accepts numbers, this checks for NaN
15-
const includesNonNumbers = arr => arr.includes(val => isNaN(val));
16+
const includesNonNumbers = arr => !!(arr.filter(val => isNaN(val)).length);
1617
// actually generates our RGB values
1718
const values = color.split(',')
1819
.map(val => val.toLowerCase())

bin/utils/__tests__/alert-deletes.spec.js

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
'use strict';
2+
13
const alertDeletes = require('../alert-deletes.js');
24

35
const _console = console;

bin/utils/alert-deletes.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
* @param {Array} removals - array of labels to be removed
44
*/
55

6+
'use strict';
67

78
module.exports = (removals) => removals.map(label => ` - ${label.name}`).forEach(prettyLabel => {
89
console.log(prettyLabel);

bin/utils/filter-removal-labels.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,9 @@
55
* @return {Array} removals - array of proper label objects to be removed
66
*/
77

8+
'use strict';
89

910
module.exports = (labels, removals) => labels.reduce((a, label) => {
10-
if (removals.includes(label.name)) a.push(Object.assign({}, label, { color: `#${label.color}`, }));
11+
if (removals.indexOf(label.name) > -1) a.push(Object.assign({}, label, { color: `#${label.color}`, }));
1112
return a;
1213
}, []);

bin/utils/remove-all-from-str.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,9 @@
44
* @param {Array} finds - array of substrings to be removed
55
* @return {String} a "cleaned" string
66
*/
7+
8+
'use strict';
9+
710
const S = require('string');
811

912
const removeAllFromStr = (str, removals) => {

0 commit comments

Comments
 (0)