laif-ds
Version:
Design System di Laif con componenti React basati su principi di Atomic Design
37 lines (36 loc) • 1.08 kB
JavaScript
"use client";
import g from "./array.js";
import u from "./constant.js";
import y from "./offset/none.js";
import p from "./order/none.js";
function k(o, e) {
return o[e];
}
function h(o) {
const e = [];
return e.key = o, e;
}
function z() {
var o = u([]), e = p, a = y, s = k;
function n(r) {
var f = Array.from(o.apply(this, arguments), h), t, m = f.length, c = -1, i;
for (const l of r)
for (t = 0, ++c; t < m; ++t)
(f[t][c] = [0, +s(l, f[t].key, c, r)]).data = l;
for (t = 0, i = g(e(f)); t < m; ++t)
f[i[t]].index = t;
return a(f, i), f;
}
return n.keys = function(r) {
return arguments.length ? (o = typeof r == "function" ? r : u(Array.from(r)), n) : o;
}, n.value = function(r) {
return arguments.length ? (s = typeof r == "function" ? r : u(+r), n) : s;
}, n.order = function(r) {
return arguments.length ? (e = r == null ? p : typeof r == "function" ? r : u(Array.from(r)), n) : e;
}, n.offset = function(r) {
return arguments.length ? (a = r ?? y, n) : a;
}, n;
}
export {
z as default
};