Comparing version 4.2.0 to 4.3.0
@@ -22,2 +22,9 @@ const ArcArray = require('../'); | ||
}); | ||
it('should throw an error if a non function is passed in as the callback', () => { | ||
let testArray = new ArcArray(); | ||
expect(() => { | ||
testArray.joinCallback(''); | ||
}).toThrow('ArcArray.joinCallback requires a valid callback to be passed in'); | ||
}) | ||
}); |
@@ -27,6 +27,4 @@ const ArcArray = require('../'); | ||
console.log(sequentialRuns); | ||
expect(sequentialRuns).not.toEqual(testArray.length); | ||
}); | ||
}); |
@@ -21,2 +21,8 @@ const is = require('arc-is'); | ||
}); | ||
it('show throw an error if wrapping non array', () => { | ||
expect(() => { | ||
ArcArray.wrap({}); | ||
}).toThrow('Cannot wrap value, valid array expected') | ||
}) | ||
}); |
14
index.js
@@ -6,2 +6,7 @@ const is = require('arc-is'); | ||
joinCallback(_callback,_separator){ | ||
//If it's not empty, ensure our argument is correct | ||
if(is(_callback) !== 'function'){ | ||
throw new TypeError('ArcArray.joinCallback requires a valid callback to be passed in'); | ||
} | ||
//Don't bother if the array is empty | ||
@@ -12,7 +17,2 @@ if(!this.length){ | ||
//If it's not empty, ensure our argument is correct | ||
if(is(_callback) !== 'function'){ | ||
throw new TypeError('ArcArray.joinCallback requires a valid callback to be passed in'); | ||
} | ||
//Normalize the separator | ||
@@ -41,2 +41,6 @@ _separator = (is(_separator) === 'string' ? _separator : ','); | ||
async pMap(_f) { | ||
return Promise.all(this.map(_f)) | ||
} | ||
//This is our format for evaluating named prototypes | ||
@@ -43,0 +47,0 @@ toString(){ |
{ | ||
"name": "arc-array", | ||
"version": "4.2.0", | ||
"version": "4.3.0", | ||
"description": "An array convenience subclass", | ||
@@ -26,4 +26,8 @@ "main": "index.js", | ||
"devDependencies": { | ||
"jest": "^24.9.0" | ||
"jest": "^27.3.1" | ||
}, | ||
"jest": { | ||
"verbose": true, | ||
"collectCoverage": true | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
9261
11
184