How to use jsonata - 2 common examples

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;
  }
};
github kristianmandrup / red-elements / packages / red-common / lib / typed-input / widget.ts View on Github external
validate: function (v) {
            try {
              jsonata(v);
              return true;
            } catch (e) {
              return false;
            }
          },
          expand: function () {

jsonata

JSON query and transformation language

MIT
Latest version published 23 days ago

Package Health Score

88 / 100
Full package analysis

Popular jsonata functions