@adyen/adyen-platform-experience-web
Version:

36 lines (35 loc) • 720 B
JavaScript
import { indexedProxyGetTrap as f, mapIteratorFactory as m } from "./helpers.js";
import { truthify as o } from "../../../utils/value/bool.js";
import { isFunction as a, isNumber as c } from "../../../utils/value/is.js";
import { structFrom as d, struct as h } from "../../../utils/struct/main.js";
const l = Object.freeze(
h({
[Symbol.iterator]: {
value() {
return m.call(this);
}
},
map: {
value(t, n) {
return [...m.call(this, t, n)];
}
}
})
), u = (t, n) => a(t) ? u(
{
length: { get: t }
},
n
) : c(t) ? u(
{
length: { value: t }
},
n
) : new Proxy(d(l, t), {
get: f(n),
set: o
});
export {
u as createIndexed,
u as default
};