v0.37.0 - Flame Validation System for v2 (2026-03-23)¶
What Changed?¶
This release introduces the complete Flame validation system for the v2 module as a single self-contained file (src/v2/flame.ts).
It consolidates FlameFactory and FlameForge statics from v1 into a unified FlameWright object, and adds GAS-scoped type guards, duck-type checks for Spreadsheet objects, and assertion/explanation helpers.
All exports are re-exported from src/v2/index.ts for public access.
What's New¶
Main Feature: src/v2/flame.ts — Unified Flame Validation¶
What it does:
Provides runtime type safety for GAS environments in a single module.
Replaces the multi-file flamewright/ structure with a streamlined, GAS-focused API.
How to use it:
TypeScript
import { FlameGuards, FlameWright, ensure, explain } from "./v2";
// Basic type guard
if (FlameGuards.isString(value)) {
Logger.log(value.toUpperCase());
}
// Schema validation
const isUser = FlameWright.fromSchema({
name: FlameGuards.isString,
age: FlameGuards.isNumber,
});
// Assertion with error context
ensure(input, FlameGuards.isString, { at: "processRow", label: "name" });
// Field-level error reporting
const errors = explain({ name: 123 }, { name: FlameGuards.isString, age: FlameGuards.isNumber });
// ["name: invalid (123)", "age: missing"]
Added¶
Flame<T>andFlameRecord<T>— core type guard signaturesFlameGuards— predefined guards for primitives (isString,isNumber,isBoolean,isNull,isUndefined), objects (isPlainObject,isArray,isMap,isValidDate), and GAS sheet values (isEmptyString,isStringOrNumber,isTable)FlameWright— unified factory and schema utilities (arrayOf,mapOf,recordOf,enumOf,instanceOf,inRange,anyOf,nullable,fromSchema,partial,extend)FlameGaslets— duck-type guards for GAS objects (isSheet,isSpreadsheet) usingtypeof obj["method"] === "function"checksFlameOptions— options interface for error messages (at,label)ensure— validates and returns a typed value, throwsTypeErroron failureassert— narrows type in-place, throwsTypeErroron failureexplain— returns field-level error messages for schema validationgetTypeOf— returns a GAS-scoped type name stringgetValuePreviewOf— returns a human-readable value preview with Map/Set support
Changed¶
FlameGaslets(wasFlameGasletinternally) — aligned naming with existingFlameGasletsinflame.gaslets.tsFlameWrightreplacesFlameFactory+FlameForgestatic methods —isprefix removed from factory methods (arrayOfinstead ofisArrayOf, etc.)recordOfdropskeyGuardargument — object keys are alwaysstringin GAS contexts
Is It Safe to Upgrade?¶
- Breaking Changes: No
- Backward Compatible: Yes
The new src/v2/flame.ts is additive. Existing v1 flamewright/ modules are unchanged.
Release Details¶
- Date: 2026-03-23
- Version: v0.37.0
- gaslamp: version 80
- pilotlamp: version 37
- Files Changed: 10
- Commits:
c2d4025docs(v2/flame): add proper docstringsa02b1d5feat(v2/index): re-export flame.ts public API760dc7bfeat(v2/flame): add simplified getTypeOf702aa2cfeat(v2/flame): export getValuePreviewOf as standalone utility418f5c1feat(v2/flame): add validation utilitiesc2f518dfeat(v2/flame): add FlameGaslets with minimal GAS duck-type guards4865fecfeat(v2/flame): add FlameWright merging FlameFactory and FlameForge statics5ae9767feat(v2/flame): add FlameGuards with GAS-scoped type guards07f1e12feat(v2): add core Flame type definitions
Known Issues¶
FlameWrightandFlameGasletsuseas const— generic methods (partial,extend) may have reduced type inference in complex TypeScript contexts, but this has no impact in GAS runtime usage.
Next Steps¶
- Add
FlameTorchguards for DataFrame/Series types as v2 DataFrame implementation progresses. - Consider adding
src/v2/flame.tsto the main bundle once v2 is stabilized.