Urara-Blog/node_modules/.pnpm-store/v3/files/bb/5f0d150b9e845c968487274fe310a6ac0f814d277f968be8e2602fb38b3a55fec949ee014f1452f12b78418e323e7c51f4c25e747d0c9cb31ebb25c8622a51
2022-08-14 01:14:53 +08:00

21 lines
556 B
Text

/**
* A specialized version of `_.map` for arrays without support for iteratee
* shorthands.
*
* @private
* @param {Array} [array] The array to iterate over.
* @param {Function} iteratee The function invoked per iteration.
* @returns {Array} Returns the new mapped array.
*/
function arrayMap(array, iteratee) {
var index = -1,
length = array == null ? 0 : array.length,
result = Array(length);
while (++index < length) {
result[index] = iteratee(array[index], index, array);
}
return result;
}
module.exports = arrayMap;