UNPKG

@adyen/adyen-platform-experience-web

Version:

![Platform Experience header](https://github.com/Adyen/adyen-platform-experience-web/assets/7926613/18094965-9e01-450e-8dc9-ea84e6b22c2b)

35 lines (34 loc) 704 B
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 };