Skip to content

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.

T extends Spec

Out = unknown

T

(value) => Out

string

Record<string, unknown>

MapSpec<T, Out>

mapSpec(
row.colWhere(header, cell.equals('Amount')).string(),
v => parseFloat(v as string),
'parseFloat'
)