Skip to content

Commit

Permalink
Linter pass
Browse files Browse the repository at this point in the history
  • Loading branch information
Yomguithereal committed Feb 25, 2017
1 parent 32ebdef commit c14547c
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -574,7 +574,7 @@ export function splice(array, startIndex, nb, ...elements) {
nb = array.length - startIndex;
else if (nb === null)
nb = 0;
else if (Number.isNaN(Number.parseInt(nb)))
else if (Number.isNaN(Number.parseInt(nb, 10)))
throw new Error(`argument nb ${nb} can not be parsed into a number!`);
nb = Math.max(0, nb);

Expand Down
2 changes: 1 addition & 1 deletion src/type.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ type.primitive = function(target) {
type.splicer = function(target) {
if (!type.array(target) || target.length < 1)
return false;
if(target.length > 1 && Number.isNaN(Number.parseInt(target[1])))
if (target.length > 1 && Number.isNaN(Number.parseInt(target[1], 10)))
return false;

return anyOf(target[0], ['number', 'function', 'object']);
Expand Down
6 changes: 3 additions & 3 deletions test/suites/helpers.js
Original file line number Diff line number Diff line change
Expand Up @@ -238,11 +238,11 @@ describe('Helpers', function() {
it('should throw an error when supplying an argument for nb (deleteCount) which is not parseable as number', function () {
const array = [0, 1, 2, 3, 4];

assert.throws(function () {
splice(array, 2, "a");
assert.throws(function() {
splice(array, 2, 'a');
}, Error);

assert.throws(function () {
assert.throws(function() {
splice(array, 2, {});
}, Error);
});
Expand Down

0 comments on commit c14547c

Please sign in to comment.