liquid-data-handler
Version:
Transform plate layouts according to liquid handling instructions
26 lines • 948 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
function* getGeneratorOfTransferInstructions(instructions) {
let instructionChunk = [];
const instructionChunks = [];
let curDest = instructions[0]["Destination Plate"];
let curSrc = instructions[0]["Source Plate"];
instructions.forEach((cur) => {
if (curDest === cur["Destination Plate"] &&
curSrc === cur["Source Plate"]) {
instructionChunk.push(cur);
}
else {
instructionChunks.push(instructionChunk);
curDest = cur["Destination Plate"];
curSrc = cur["Source Plate"];
instructionChunk = [cur];
}
});
instructionChunks.push(instructionChunk);
while (instructionChunks.length) {
yield instructionChunks.shift();
}
}
exports.default = getGeneratorOfTransferInstructions;
//# sourceMappingURL=getNextPlateInstructions.js.map