You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add a new type & exported method to support optional input & output definitions alongside the rules that need them.
exporttypeFieldKeyMapping=Record<string,string|true>;/** * An associated set of rules & their needed input values. */exportinterfaceRuleMapping{/** * A object, array, or string describing a set of logical `Rule`'s */rules: Readonly<Rule>;/** * A map of input keys to their key paths from the input object. */inputMap?: FieldKeyMapping;/** * Values merged to the output of the rules. * * When `outputMap` is an object, the keys are the source value path and the values are the input value's keys. * ``` * { * fromKey: 'toKey.path.string[0]' * } * ``` * * When outputMap is a string, it's treated as a destination path for the entire rules output. */outputMap?: string|FieldKeyMapping;}
An input mapping of deeply nested input values to flat key/value inputs speeds up & simplifies the rule expressions.
Saves you from having to write ad-hoc data shaping code anywhere you use any given rules.
The text was updated successfully, but these errors were encountered:
Add a new type & exported method to support optional input & output definitions alongside the rules that need them.
The text was updated successfully, but these errors were encountered: