Skip to content

Commit

Permalink
cellify: failOnCell option
Browse files Browse the repository at this point in the history
  • Loading branch information
hbbio committed Apr 25, 2024
1 parent 37e6b2b commit f763d18
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions src/cellify.ts
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,13 @@ export const isObject = <K extends string | number | symbol>(
export const _cellify = <T>(
proxy: SheetProxy,
v: T,
name = "cellify"
name = "cellify",
failOnCell = false
): Cellified<T> => {
if (v instanceof Cell) throw new Error("cell");
if (v instanceof Cell) {
if (failOnCell) throw new Error("cell");
return v as Cellified<T>;
}
return proxy.new(
Array.isArray(v)
? v.map((vv) => _cellify(proxy, vv), "cellify.[]")
Expand Down

0 comments on commit f763d18

Please sign in to comment.