From 29cae9975ec27a8b4f2e84a3556ce287e507fdf9 Mon Sep 17 00:00:00 2001 From: Jeston Tigchon Date: Thu, 7 Sep 2017 13:58:29 -0700 Subject: [PATCH] Upgrade JSONata to v1.3.0 (#1386) --- editor/vendor/jsonata/formatter.js | 2 ++ package.json | 2 +- red/api/locales/en-US/jsonata.json | 8 ++++++++ 3 files changed, 11 insertions(+), 1 deletion(-) diff --git a/editor/vendor/jsonata/formatter.js b/editor/vendor/jsonata/formatter.js index 0a31594b9..be008cca7 100644 --- a/editor/vendor/jsonata/formatter.js +++ b/editor/vendor/jsonata/formatter.js @@ -128,6 +128,8 @@ '$map':{ args:[ 'array', 'function' ]}, '$match':{ args:[ 'str', 'pattern', 'limit' ]}, '$max':{ args:[ 'array' ]}, + '$merge':{ args:[ 'array' ]}, + '$millis':{ args:[ ]}, '$min':{ args:[ 'array' ]}, '$not':{ args:[ 'arg' ]}, '$now':{ args:[ ]}, diff --git a/package.json b/package.json index a5c97fe0b..456af9821 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "is-utf8":"0.2.1", "js-yaml": "3.8.4", "json-stringify-safe":"5.0.1", - "jsonata":"1.2.6", + "jsonata":"1.3.0", "media-typer": "0.3.0", "mqtt": "2.9.0", "multer": "1.3.0", diff --git a/red/api/locales/en-US/jsonata.json b/red/api/locales/en-US/jsonata.json index 2836b3dfa..3b93e43cc 100644 --- a/red/api/locales/en-US/jsonata.json +++ b/red/api/locales/en-US/jsonata.json @@ -95,6 +95,10 @@ "args":"", "desc":"Returns a pseudo random number greater than or equal to zero and less than one." }, + "$millis": { + "args":"", + "desc":"Returns the number of milliseconds since the Unix Epoch (1 January, 1970 UTC) as a number. All invocations of `$millis()` within an evaluation of an expression will all return the same value." + }, "$sum": { "args": "array", "desc": "Returns the arithmetic sum of an `array` of numbers. It is an error if the input `array` contains an item which isn't a number." @@ -160,6 +164,10 @@ "args": "object", "desc": "Splits an object containing key/value pairs into an array of objects, each of which has a single key/value pair from the input object. If the parameter is an array of objects, then the resultant array contains an object for every key/value pair in every object in the supplied array." }, + "$merge": { + "args": "array<object>", + "desc": "Merges an array of `objects` into a single `object` containing all the key/value pairs from each of the objects in the input array. If any of the input objects contain the same key, then the returned `object` will contain the value of the last one in the array. It is an error if the input array contains an item that is not an object." + }, "$sift": { "args":"object, function", "desc":"Returns an object that contains only the key/value pairs from the `object` parameter that satisfy the predicate `function` passed in as the second parameter.\n\nThe `function` that is supplied as the second parameter must have the following signature:\n\n`function(value [, key [, object]])`"