mapSpec
mapSpec<
T,Out>(source,fn,description?,schemaHint?):MapSpec<T,Out>
Defined in: extract/spec.ts:764
Apply a transform function to a successful extraction result. If the source spec fails, the failure propagates unchanged. If the transform function throws, fails with ‘format’ kind.
Type Parameters
Section titled “Type Parameters”T extends Spec
Out = unknown
Parameters
Section titled “Parameters”source
Section titled “source”T
(value) => Out
description?
Section titled “description?”string
schemaHint?
Section titled “schemaHint?”Record<string, unknown>
Returns
Section titled “Returns”MapSpec<T, Out>
Example
Section titled “Example”mapSpec( row.colWhere(header, cell.equals('Amount')).string(), v => parseFloat(v as string), 'parseFloat')