Skip to content

gaslamp


Type Alias: FlameFrameOptions

FlameFrameOptions = object

Options for controlling validation behavior in FlameFrame factory methods.

Pass this as the third argument to FlameFrame.from. By default, all errors are collected into the failed frame. Set strict: true to throw a TypeError on the first error instead.

Example

TypeScript
const schema = { name: FlameGuards.isString, age: FlameGuards.isNumber };

const df = BareFrame.fromColumns({ name: ["Alice", 123], age: [25, 30] });

// Default: collect all errors
const { passed, failed } = FlameFrame.from(df, schema);
Logger.log(failed.length > 0); // true

// Strict: throw on first error
try {
  FlameFrame.from(df, schema, { strict: true });
} catch (e) {
  Logger.log(e.message);
  // "FlameFrame validation failed | row 0 | field "name" | got number"
}

Since

0.39.0

Properties

strict?

optional strict?: boolean

When true, throws a TypeError on the first validation error instead of collecting errors into the failed frame. Default: false.