Skip to main content

Function: rowCells()

rowCells(rows, col): Cells

Defined in: src/core/int64.ts:62

Row objects' column col as Cells; a row without the key is left without it.

Parameters​

rows​

Record<string, unknown>[]

Row objects; mutated through the returned set.

col​

string

The column (object key) to expose.

Returns​

Cells

A Cells view: n = rows.length, get reads rows[i][col], set writes it only when col in rows[i] (so a missing key is never created).

Remarks​

A live view, not a copy: writes go straight to rows.

Example​

import { rowCells, idsToStrings } from "./int64.js";
const rows = [{ id: 401585607 }, { id: null }, { other: 1 }];
idsToStrings(rowCells(rows, "id")); // "strings"
rows; // [{ id: "401585607" }, { id: null }, { other: 1 }]