ubdate
This commit is contained in:
23
node_modules/arr-map/index.js
generated
vendored
Normal file
23
node_modules/arr-map/index.js
generated
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
/*!
|
||||
* arr-map <https://github.com/jonschlinkert/arr-map>
|
||||
*
|
||||
* Copyright (c) 2015, 2017, Jon Schlinkert.
|
||||
* Released under the MIT License.
|
||||
*/
|
||||
|
||||
'use strict';
|
||||
|
||||
var iterator = require('make-iterator');
|
||||
|
||||
module.exports = function map(arr, fn, thisArg) {
|
||||
if (arr == null) return [];
|
||||
fn = iterator(fn, thisArg);
|
||||
|
||||
var len = arr.length;
|
||||
var res = new Array(len);
|
||||
|
||||
for (var i = 0; i < len; i++) {
|
||||
res[i] = fn(arr[i], i, arr);
|
||||
}
|
||||
return res;
|
||||
};
|
||||
Reference in New Issue
Block a user