MCPcopy Create free account
hub / github.com/alefore/knit / Mark

Method Mark

src/cable_pattern_factory.ts:139–146  ·  view source on GitHub ↗
(cable: number, position: number)

Source from the content-addressed store, hash-verified

137 renderRowCables(row: number): number[] {
138 const output: number[] = Array(this.rowsWidth).fill(-1);
139 const Mark = (cable: number, position: number) => {
140 if (position < 0 || position >= output.length) return; // Prevent out-of-bounds access
141 if (output[position] !== -1)
142 throw new Error(
143 'Unable to render row cables: ' + cable + ' ' + output[position] +
144 ' at row ' + row + ' position ' + position);
145 output[position] = cable;
146 };
147
148 for (let cable = 0; cable < this.cables; cable++) {
149 const cablePositions = this.positions[row % this.positions.length];

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected