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

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