Skip to content

gaslamp


Type Alias: FlameFrameResult\<T>

FlameFrameResult\<T> = object

The result returned by FlameFrame.from.

Contains a validated FlameFrame and invalid rows as a BareFrame. passed contains only rows that passed all schema guards and retains the schema. failed is a BareFrame containing invalid rows with error messages in the invalid_message column. Use failed.length > 0 to decide whether to proceed or inspect the errors.

Example

TypeScript
const schema = { name: FlameGuards.isString, age: FlameGuards.isNumber };
const df = BareFrame.fromColumns({ name: ["Alice", 123], age: [25, 30] });
const { passed, failed } = FlameFrame.from(df, schema);

// passed contains only the row that passed: Alice / 25
Logger.log(passed.length); // 1

if (failed.length > 0) {
  Logger.log(failed.toString());
  // name | age | invalid_message
  // 123  | 25  | name: got number (123)
}

Since

0.39.0

Type Parameters

T

T extends Record\<string, Cell>

Properties

passed

passed: FlameFrame\<T>

The validated frame. A FlameFrame containing only rows that passed all schema guards.


failed

failed: BareFrame

Invalid rows with error messages. A BareFrame with the invalid_message column. Empty when all rows pass.