@opentiny/vue-renderless
Version:
An enterprise-class UI component library, support both Vue.js 2 and Vue.js 3, as well as PC and mobile.
25 lines (24 loc) • 589 B
JavaScript
import "../../../chunk-G2ADBYYC.js";
import each from "../base/each";
import isFunction from "../base/isFunction";
import property from "../function/property";
const map = function(obj, iterate, context) {
let result = [];
if (obj && arguments.length > 1) {
if (!isFunction(iterate)) {
iterate = property(iterate);
}
if (obj.map) {
return obj.map(iterate, context);
} else {
each(obj, (...args) => {
result.push(iterate.apply(context, args));
});
}
}
return result;
};
var map_default = map;
export {
map_default as default
};