You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
542 B
18 lines
542 B
|
4 months ago
|
"use strict";
|
||
|
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||
|
|
var tslib_1 = require("tslib");
|
||
|
|
var is_array_like_1 = tslib_1.__importDefault(require("./is-array-like"));
|
||
|
|
var map = function (arr, func) {
|
||
|
|
if (!(0, is_array_like_1.default)(arr)) {
|
||
|
|
// @ts-ignore
|
||
|
|
return arr;
|
||
|
|
}
|
||
|
|
var result = [];
|
||
|
|
for (var index = 0; index < arr.length; index++) {
|
||
|
|
var value = arr[index];
|
||
|
|
result.push(func(value, index));
|
||
|
|
}
|
||
|
|
return result;
|
||
|
|
};
|
||
|
|
exports.default = map;
|
||
|
|
//# sourceMappingURL=map.js.map
|