How to use the jsonata.jsonata function in jsonata

To help you get started, we’ve selected a few jsonata examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github kristianmandrup / red-elements / packages / red-runtime / src / util / index.ts View on Github external
} else if (type === 'json') {
      return JSON.parse(value);
    } else if (type === 're') {
      return new RegExp(value);
    } else if (type === 'date') {
      return Date.now();
    } else if (type === 'msg' && msg) {
      return getMessageProperty(msg, value);
    } else if (type === 'flow' && node) {
      return node.context().flow.get(value);
    } else if (type === 'global' && node) {
      return node.context().global.get(value);
    } else if (type === 'bool') {
      return /^true$/i.test(value);
    } else if (type === 'jsonata') {
      return jsonata(value).evaluate({ msg: msg });
    }
    return value;
  }
};

jsonata

JSON query and transformation language

MIT
Latest version published 6 months ago

Package Health Score

78 / 100
Full package analysis

Popular jsonata functions