UNPKG

@aws-lambda-powertools/jmespath

Version:

A type safe and modern jmespath module to parse and extract data from JSON documents using JMESPath

34 lines 1.18 kB
import type { JSONValue } from '@aws-lambda-powertools/commons/types'; import { Functions } from './Functions.js'; /** * Custom functions for the Powertools for AWS Lambda JMESPath module. * * Built-in JMESPath functions include: `powertools_json`, `powertools_base64`, `powertools_base64_gzip` * * You can use these functions to decode and/or deserialize JSON objects when using the {@link search | `search`} function. * * @example * ```typescript * import { search } from '@aws-lambda-powertools/jmespath'; * import { PowertoolsFunctions } from '@aws-lambda-powertools/jmespath/functions'; * * const data = { * body: "{\"foo\": \"bar\"}" * }; * * const result = search( * 'powertools_json(body)', * data, * { customFunctions: new PowertoolsFunctions() } * ); * console.log(result); // { foo: 'bar' } * ``` */ declare class PowertoolsFunctions extends Functions { funcPowertoolsBase64(value: string): string; funcPowertoolsBase64Gzip(value: string): string; funcPowertoolsJson(value: string): JSONValue; } export { Functions } from './Functions.js'; export { PowertoolsFunctions }; //# sourceMappingURL=PowertoolsFunctions.d.ts.map