Press n or j to go to the next uncovered block, b, p or k for the previous block.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | 19x 424x 424x 424x 41036x 202x 202x 202x 20103x 202x | import { ArrayMaker } from "../types"; export const array: ArrayMaker = (typer, header) => ({ encode(ctx, data) { const { length } = data; header.encode(ctx, length); for (let i = 0; i < length; i++) { typer.encode(ctx, data[i]); } }, decode(ctx) { const length = header.decode(ctx); const data = []; for (let i = 0; i < length; i++) { data.push(typer.decode(ctx)); } return data; } }); |