Add production dependencies
This commit is contained in:
parent
5a0114f3e2
commit
579ccdc29f
12113 changed files with 978046 additions and 3 deletions
21
node_modules/array-initial/index.js
generated
vendored
Normal file
21
node_modules/array-initial/index.js
generated
vendored
Normal file
|
@ -0,0 +1,21 @@
|
|||
/*!
|
||||
* array-initial <https://github.com/jonschlinkert/array-initial>
|
||||
*
|
||||
* Copyright (c) 2014 Jon Schlinkert, contributors.
|
||||
* Licensed under the MIT license.
|
||||
*/
|
||||
|
||||
var isNumber = require('is-number');
|
||||
var slice = require('array-slice');
|
||||
|
||||
module.exports = function arrayInitial(arr, num) {
|
||||
if (!Array.isArray(arr)) {
|
||||
throw new Error('array-initial expects an array as the first argument.');
|
||||
}
|
||||
|
||||
if (arr.length === 0) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return slice(arr, 0, arr.length - (isNumber(num) ? num : 1));
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue