mirror of
https://github.com/node-red/node-red.git
synced 2023-10-10 13:36:53 +02:00
Update jsonata
This commit is contained in:
parent
0c1c710afe
commit
07d131c945
4
editor/vendor/jsonata/formatter.js
vendored
4
editor/vendor/jsonata/formatter.js
vendored
@ -110,6 +110,7 @@
|
||||
'$append':{ args:['array','array'] },
|
||||
'$average':{ args:['value'] },
|
||||
'$boolean':{ args:['value'] },
|
||||
'$contains':{ args:['str','pattern']},
|
||||
'$count':{ args:['array'] },
|
||||
'$exists':{ args:['value'] },
|
||||
'$join':{ args:['array','separator'] },
|
||||
@ -117,12 +118,14 @@
|
||||
'$length':{ args:['string'] },
|
||||
'$lookup':{ args:['object','key'] },
|
||||
'$lowercase':{ args:['string'] },
|
||||
'$match':{ args:['str','pattern','limit']},
|
||||
'$map':{ args:[] },
|
||||
'$max':{ args:['array'] },
|
||||
'$min':{ args:['array'] },
|
||||
'$not':{ args:['value'] },
|
||||
'$number':{ args:['value'] },
|
||||
'$reduce':{ args:[] },
|
||||
'$replace':{ args:['str','pattern','replacement','limit']},
|
||||
'$split':{ args:['string','separator','limit'] },
|
||||
'$spread':{ args:['object'] },
|
||||
'$string':{ args:['value'] },
|
||||
@ -130,6 +133,7 @@
|
||||
'$substringAfter':{ args:['string','chars'] },
|
||||
'$substringBefore':{ args:['string','chars'] },
|
||||
'$sum':{ args:['array'] },
|
||||
'$trim': { args:['str'] },
|
||||
'$uppercase':{ args:['string'] }
|
||||
}
|
||||
jsonata.getFunctionSnippet = function(fn) {
|
||||
|
62
editor/vendor/jsonata/mode-jsonata.js
vendored
62
editor/vendor/jsonata/mode-jsonata.js
vendored
@ -18,13 +18,13 @@ define("ace/mode/jsonata",["require","exports","module","ace/lib/oop","ace/mode/
|
||||
|
||||
var keywordMapper = this.createKeywordMapper({
|
||||
"keyword.operator":
|
||||
"and|or|in",
|
||||
"and|or|in",
|
||||
"constant.language":
|
||||
"null|Infinity|NaN|undefined",
|
||||
"null|Infinity|NaN|undefined",
|
||||
"constant.language.boolean":
|
||||
"true|false",
|
||||
"true|false",
|
||||
"storage.type":
|
||||
"function"
|
||||
"function"
|
||||
}, "identifier");
|
||||
this.$rules = {
|
||||
"start" : [
|
||||
@ -47,33 +47,33 @@ define("ace/mode/jsonata",["require","exports","module","ace/lib/oop","ace/mode/
|
||||
regex : /[+-]?\d[\d_]*(?:(?:\.\d*)?(?:[eE][+-]?\d+)?)?\b/
|
||||
},
|
||||
{ token: "keyword",
|
||||
regex: /λ/
|
||||
},
|
||||
{
|
||||
token: "keyword",
|
||||
regex: jsonataFunctions
|
||||
},
|
||||
{
|
||||
token : keywordMapper,
|
||||
regex : "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"
|
||||
},
|
||||
{
|
||||
token : "punctuation.operator",
|
||||
regex : /[.](?![.])/
|
||||
},
|
||||
{
|
||||
token : "keyword.operator",
|
||||
regex : /\|\||<=|>=|\.\.|\*\*|!=|:=|[=<>`!$%&*+\-~\/^]/,
|
||||
next : "start"
|
||||
},
|
||||
{
|
||||
token : "punctuation.operator",
|
||||
regex : /[?:,;.]/,
|
||||
next : "start"
|
||||
},
|
||||
{
|
||||
token : "paren.lparen",
|
||||
regex : /[\[({]/,
|
||||
regex: /λ/
|
||||
},
|
||||
{
|
||||
token: "keyword",
|
||||
regex: jsonataFunctions
|
||||
},
|
||||
{
|
||||
token : keywordMapper,
|
||||
regex : "[a-zA-Z\\$_\u00a1-\uffff][a-zA-Z\\d\\$_\u00a1-\uffff]*"
|
||||
},
|
||||
{
|
||||
token : "punctuation.operator",
|
||||
regex : /[.](?![.])/
|
||||
},
|
||||
{
|
||||
token : "keyword.operator",
|
||||
regex : /\|\||<=|>=|\.\.|\*\*|!=|:=|[=<>`!$%&*+\-~\/^]/,
|
||||
next : "start"
|
||||
},
|
||||
{
|
||||
token : "punctuation.operator",
|
||||
regex : /[?:,;.]/,
|
||||
next : "start"
|
||||
},
|
||||
{
|
||||
token : "paren.lparen",
|
||||
regex : /[\[({]/,
|
||||
next : "start"
|
||||
},
|
||||
{
|
||||
|
16
editor/vendor/jsonata/snippets-jsonata.js
vendored
16
editor/vendor/jsonata/snippets-jsonata.js
vendored
@ -1,11 +1,11 @@
|
||||
define("ace/snippets/jsonata",["require","exports","module"], function(require, exports, module) {
|
||||
"use strict";
|
||||
var snippetText = "";
|
||||
for (var fn in jsonata.functions) {
|
||||
if (jsonata.functions.hasOwnProperty(fn)) {
|
||||
snippetText += "# "+fn+"\nsnippet "+fn+"\n\t"+jsonata.getFunctionSnippet(fn)+"\n"
|
||||
"use strict";
|
||||
var snippetText = "";
|
||||
for (var fn in jsonata.functions) {
|
||||
if (jsonata.functions.hasOwnProperty(fn)) {
|
||||
snippetText += "# "+fn+"\nsnippet "+fn+"\n\t"+jsonata.getFunctionSnippet(fn)+"\n"
|
||||
}
|
||||
}
|
||||
}
|
||||
exports.snippetText = snippetText;
|
||||
exports.scope = "jsonata";
|
||||
exports.snippetText = snippetText;
|
||||
exports.scope = "jsonata";
|
||||
});
|
||||
|
5884
editor/vendor/jsonata/worker-jsonata.js
vendored
5884
editor/vendor/jsonata/worker-jsonata.js
vendored
File diff suppressed because one or more lines are too long
@ -42,7 +42,7 @@
|
||||
"is-utf8":"0.2.1",
|
||||
"js-yaml": "3.7.0",
|
||||
"json-stringify-safe":"5.0.1",
|
||||
"jsonata":"1.0.10",
|
||||
"jsonata":"1.1.1",
|
||||
"media-typer": "0.3.0",
|
||||
"mqtt": "2.2.1",
|
||||
"multer": "1.2.1",
|
||||
|
@ -27,14 +27,30 @@
|
||||
"args": "str",
|
||||
"desc": "Returns a string with all the characters of `str` converted to lowercase."
|
||||
},
|
||||
"$trim": {
|
||||
"args": "str",
|
||||
"desc": "Normalizes and trims all whitespace characters in str by applying the following steps:\n\n - All tabs, carriage returns, and line feeds are replaced with spaces.\n- Contiguous sequences of spaces are reduced to a single space.\n- Trailing and leading spaces are removed.\n\n If `str` is not specified (i.e. this function is invoked with no arguments), then the context value is used as the value of `str`. An error is thrown if `str` is not a string."
|
||||
},
|
||||
"$contains": {
|
||||
"args": "str, pattern",
|
||||
"desc": "Returns `true` if `str` is matched by `pattern`, otherwise it returns `false`. If `str` is not specified (i.e. this function is invoked with one argument), then the context value is used as the value of `str`. The `pattern` parameter can either be a string or a regular expression."
|
||||
},
|
||||
"$split": {
|
||||
"args": "str[, separator][, limit]",
|
||||
"desc": "Splits the `str` parameter into an array of substrings. It is an error if `str` is not a string. The optional `separator` parameter specifies the characters within the `str` about which it should be split. If `separator` is not specified, then the empty string is assumed, and `str` will be split into an array of single characters. It is an error if `separator` is not a string. The optional `limit` parameter is a number that specifies the maximum number of substrings to include in the resultant array. Any additional substrings are discarded. If `limit` is not specified, then `str` is fully split with no limit to the size of the resultant array. It is an error if `limit` is not a non-negative number."
|
||||
"desc": "Splits the `str` parameter into an array of substrings. It is an error if `str` is not a string. The optional `separator` parameter specifies the characters within the `str` about which it should be split as either a string or regular expression. If `separator` is not specified, then the empty string is assumed, and `str` will be split into an array of single characters. It is an error if `separator` is not a string. The optional `limit` parameter is a number that specifies the maximum number of substrings to include in the resultant array. Any additional substrings are discarded. If `limit` is not specified, then `str` is fully split with no limit to the size of the resultant array. It is an error if `limit` is not a non-negative number."
|
||||
},
|
||||
"$join": {
|
||||
"args": "array[, separator]",
|
||||
"desc": "Joins an array of component strings into a single concatenated string with each component string separated by the optional `separator` parameter. It is an error if the input `array` contains an item which isn't a string. If `separator` is not specified, then it is assumed to be the empty string, i.e. no `separator` between the component strings. It is an error if `separator` is not a string."
|
||||
},
|
||||
"$match": {
|
||||
"args": "str, pattern [, limit]",
|
||||
"desc": "Applies the `str` string to the `pattern` regular expression and returns an array of objects, with each object containing information about each occurrence of a match withing `str`."
|
||||
},
|
||||
"$replace": {
|
||||
"args": "str, pattern, replacement [, limit]",
|
||||
"desc": "Finds occurrences of `pattern` within `str` and replaces them with `replacement`. "
|
||||
},
|
||||
|
||||
|
||||
"$number": {
|
||||
@ -57,11 +73,11 @@
|
||||
"args": "array",
|
||||
"desc": "Returns the mean value of an `array` of numbers. It is an error if the input `array` contains an item which isn't a number."
|
||||
},
|
||||
|
||||
"$boolean": {
|
||||
"args": "arg",
|
||||
"desc": "Casts the argument to a Boolean using the following rules:\n\n - `Boolean` : unchanged\n - `string`: empty : `false`\n - `string`: non-empty : `true`\n - `number`: `0` : `false`\n - `number`: non-zero : `true`\n - `null` : `false`\n - `array`: empty : `false`\n - `array`: contains a member that casts to `true` : `true`\n - `array`: all members cast to `false` : `false`\n - `object`: empty : `false`\n - `object`: non-empty : `true`\n - `function` : `false`"
|
||||
},
|
||||
|
||||
"$not": {
|
||||
"args": "arg",
|
||||
"desc": "Returns Boolean NOT on the argument. `arg` is first cast to a boolean"
|
||||
@ -70,6 +86,7 @@
|
||||
"args": "arg",
|
||||
"desc": "Returns Boolean `true` if the `arg` expression evaluates to a value, or `false` if the expression does not match anything (e.g. a path to a non-existent field reference)."
|
||||
},
|
||||
|
||||
"$count": {
|
||||
"args": "array",
|
||||
"desc": "Returns the number of items in the array"
|
||||
|
Loading…
Reference in New Issue
Block a user