mapSpec
mapSpec<
T>(source,fn,description?):MapSpec<T>
Defined in: extract/spec.ts:477
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
Parameters
Section titled “Parameters”source
Section titled “source”T
(value) => unknown
description?
Section titled “description?”string
Returns
Section titled “Returns”MapSpec<T>
Example
Section titled “Example”mapSpec( row.colWhere(header, cell.equals('Amount')).string(), v => parseFloat(v as string), 'parseFloat')