Optional
customFunctions?: FunctionsThe custom functions to use.
By default, the interpreter uses the standard JMESPath functions available in the JMESPath specification.
import { search } from '@aws-lambda-powertools/jmespath';
import { PowertoolsFunctions } from '@aws-lambda-powertools/jmespath/functions';
const expression = 'powertools_json(@)';
const result = search(expression, "{\n \"a\": 1\n}", {
customFunctions: new PowertoolsFunctions(),
});
console.log(result); // { a: 1 }
Options for parsing.
You can use this type to customize the parsing of JMESPath expressions.
For example, you can use this type to provide custom functions to the parser.