Skip to content

Commit

Permalink
use const and template literal
Browse files Browse the repository at this point in the history
[BREAKING] drop support for Node < 4
  • Loading branch information
shinnn committed Mar 2, 2017
1 parent 30f31cf commit b2c10ab
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
10 changes: 5 additions & 5 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,19 +4,19 @@
*/
'use strict';

var validateGlobOpts = require('validate-glob-opts');
const validateGlobOpts = require('validate-glob-opts');

function isTypeError(err) {
return err.name === 'TypeError';
}

function createMessageLine(msg, err, index) {
return msg + '\n ' + (index + 1) + '. ' + err.message;
return `${msg}\n ${index + 1}. ${err.message}`;
}

module.exports = function assertValidGlobOpts(obj) {
var results = validateGlobOpts(obj);
var count = results.length;
const results = validateGlobOpts(obj);
const count = results.length;

if (count === 0) {
return;
Expand All @@ -28,6 +28,6 @@ module.exports = function assertValidGlobOpts(obj) {

throw new (results.every(isTypeError) ? TypeError : Error)(results.reduce(
createMessageLine,
String(count) + ' errors found in the node-glob options:'
`${count} errors found in the node-glob options:`
));
};
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@
"validate-glob-opts": "^0.2.0"
},
"devDependencies": {
"@shinnn/eslint-config-node-legacy": "^3.0.0",
"eslint": "^3.14.0",
"@shinnn/eslint-config-node": "^3.0.0",
"eslint": "^3.16.1",
"istanbul": "^0.4.5",
"tape": "^4.6.3"
},
"eslintConfig": {
"extends": "@shinnn/node-legacy"
"extends": "@shinnn/node"
}
}

0 comments on commit b2c10ab

Please sign in to comment.