UNPKG

serverless-offline

Version:

Emulate AWS λ and API Gateway locally when developing your Serverless project

14 lines (11 loc) 299 B
import { JSONPath } from "jsonpath-plus" export default function jsonPath(json, path) { // NOTE: JSONPath returns undefined if 'json' is e.g. null, undefined, string, // number (anything other than JSON) const [result] = JSONPath({ json, path, }) || [] return result }