Aktueller Stand

This commit is contained in:
2026-01-23 01:33:35 +01:00
parent 082dc5e110
commit 2766dd12c5
10109 changed files with 1578841 additions and 77685 deletions

View File

@@ -0,0 +1,25 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.pathWalk = pathWalk;
function produce(producer) {
return producer();
}
function pathWalk(path, initialProducers, shrink) {
const producers = initialProducers;
const segments = path.split(':').map((text) => +text);
if (segments.length === 0) {
return producers.map(produce);
}
if (!segments.every((v) => !Number.isNaN(v))) {
throw new Error(`Unable to replay, got invalid path=${path}`);
}
let values = producers.drop(segments[0]).map(produce);
for (const s of segments.slice(1)) {
const valueToShrink = values.getNthOrLast(0);
if (valueToShrink === null) {
throw new Error(`Unable to replay, got wrong path=${path}`);
}
values = shrink(valueToShrink).drop(s);
}
return values;
}