Files
SnowLuma/.pnpm-store/v11/files/19/a75095a292bff32e9286c9a97d7a1879b39c1fe3bf7c1b71018210df330d8c87cc4bf179ff35d94a54b1dd25be9fd60dfb820f91bac335ca5b70650fd21c79
TanTan 2a69b23b47
Dev Build / cleanup (push) Canceled after 0s
Dev Build / typecheck (push) Canceled after 0s
Dev Build / build (linux-arm64, ubuntu-24.04-arm, linux-arm64) (push) Canceled after 0s
Dev Build / build (linux-x64, ubuntu-latest, linux-x64) (push) Canceled after 0s
Dev Build / build (win-x64, windows-latest, win32-x64) (push) Canceled after 0s
Dev Build / dispatch-dev-docker (push) Skipped
docs: 仓库链接指向本镜像仓库
2026-11-13 09:27:07 +08:00

35 lines
950 B
Plaintext

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);
}
});
}
export {
createLazyMeasurementsView
};
//# sourceMappingURL=lazy-measurements.js.map