define mapping of object
a function who generate an object populate with key from schema and value from obj
Create a function who will return value
When evaluator is called, throw error
When evaluator is called, throw new ErrorClass(PV)
Generated using TypeDoc
create an extractor function.
ExtractSchema for understand how extractor will map data
import { extractValue } from '@tpoisseau/pattern-matching/evaluators'; const mapper = extractValue({ foo: true, bar: false, // for the demo but it's no use baz: value => value.toto, tata: 'foo', }); > mapper({foo: 42, bar: 'baz', baz: 'foo', toto: 'tata'}) > { foo: 42, baz: 'tata', tata: 42 }