#transformWith
Transforms a sub-document with a registered, standalone transformer.
#transformWith(source, transformerName, parameters?)Parameters
Section titled “Parameters”| Name | Type | Description |
|---|---|---|
source |
path | value |
The sub-document to transform. |
transformerName |
string |
The name the transformer was registered under. |
parameters (optional) |
object |
Available to the called transformer as @params. |
Returns
Section titled “Returns”any — The called transformer’s output.
- Variables from the calling transformer aren’t visible in the called one; pass what it needs through
parameters. Validate()reports calls to unregistered transformers.
Examples
Section titled “Examples”Call with parameters
Section titled “Call with parameters”#transformWith($.date, 'DateFormatter', { 'format': 'MM/dd/yyyy' })