laif-ds
Version:
Design System di Laif con componenti React basati su principi di Atomic Design
33 lines (32 loc) • 865 B
JavaScript
"use client";
import { initRange as c } from "./init.js";
import { InternMap as a } from "../../internmap/src/index.js";
const f = Symbol("implicit");
function l() {
var r = new a(), i = [], u = [], o = f;
function n(e) {
let t = r.get(e);
if (t === void 0) {
if (o !== f) return o;
r.set(e, t = i.push(e) - 1);
}
return u[t % u.length];
}
return n.domain = function(e) {
if (!arguments.length) return i.slice();
i = [], r = new a();
for (const t of e)
r.has(t) || r.set(t, i.push(t) - 1);
return n;
}, n.range = function(e) {
return arguments.length ? (u = Array.from(e), n) : u.slice();
}, n.unknown = function(e) {
return arguments.length ? (o = e, n) : o;
}, n.copy = function() {
return l(i, u).unknown(o);
}, c.apply(n, arguments), n;
}
export {
l as default,
f as implicit
};