Files
SnowLuma/.pnpm-store/v11/files/88/c560fdef1b978dbb561db0e2f2ad80292b42f9b5b136eb5f0e4f145e8108b2328bdf7cb0e96d7210097f91d774a1f59fcf5ecc9a9fc7ba39fa9c354448b1ce
T
TanTan 2a69b23b47
Dev Build / cleanup (push) Waiting to run
Dev Build / typecheck (push) Waiting to run
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

35 lines
1.0 KiB
Plaintext

"use strict";
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
function createLazyMeasurementsView(count, flat, getItemKey) {
const cache = new Array(count);
return new Proxy(cache, {
get(target, prop, receiver) {
if (typeof prop === "string") {
const c = prop.charCodeAt(0);
if (c >= 48 && c <= 57) {
const i = +prop;
if (Number.isInteger(i) && i >= 0 && i < count) {
let v = target[i];
if (!v) {
const s = flat[i * 2];
v = target[i] = {
index: i,
key: getItemKey(i),
start: s,
size: flat[i * 2 + 1],
end: s + flat[i * 2 + 1],
lane: 0
};
}
return v;
}
}
if (prop === "length") return count;
}
return Reflect.get(target, prop, receiver);
}
});
}
exports.createLazyMeasurementsView = createLazyMeasurementsView;
//# sourceMappingURL=lazy-measurements.cjs.map