optional
optional<
S,E>(spec,defaultValue?):FormatSpec<S,E>
Defined in: extract/spec.ts:412
Make any extraction spec optional. Failures return the default value
(or undefined if none provided) instead of failing.
Works universally across all formats and all failure kinds.
Type Parameters
Section titled “Type Parameters”S
E
Parameters
Section titled “Parameters”FormatSpec<S, E>
defaultValue?
Section titled “defaultValue?”unknown
Returns
Section titled “Returns”FormatSpec<S, E>
Example
Section titled “Example”optional(row.colWhere(header, cell.equals('Ownership')).number(), null)