diff --git a/src/hooks/Rule/RuleFunc.json b/src/hooks/Rule/RuleFunc.json index 5986e916b..961046de9 100644 --- a/src/hooks/Rule/RuleFunc.json +++ b/src/hooks/Rule/RuleFunc.json @@ -336,6 +336,16 @@ "required": true } ] + }, + { + "name": "is_empty", + "args": [ + { + "name": "Value", + "type": "any", + "required": true + } + ] } ] }, @@ -756,6 +766,16 @@ "required": true } ] + }, + { + "name": "map_size", + "args": [ + { + "name": "Map", + "type": "object", + "required": true + } + ] } ] }, diff --git a/src/i18n/RuleSyntax.js b/src/i18n/RuleSyntax.js index 7d368adab..bf93aea7b 100644 --- a/src/i18n/RuleSyntax.js +++ b/src/i18n/RuleSyntax.js @@ -1164,4 +1164,28 @@ Typical JQ programs describe simple transformations or filters for JSON data, bu zh: '返回值为执行生成生成的 JSON 对象列表。如果执行超时或者 JQ 程序抛出异常,该函数将抛出异常。', en: 'list of objects corresponding to the JSON objects generated by the given JQ program (parameter 1) when given the input provided by parameter 2. The function throws an exception if the execution did not finish before the timeout or if the jq program throws an exception.', }, + isEmptyDesc: { + zh: '判断 Map 或数组是否为空', + en: 'Return true if the map or array is empty', + }, + isEmptyParams: { + zh: '要检查的值', + en: 'Value to check', + }, + isEmptyReturns: { + zh: '布尔值,为空时返回 true', + en: 'Boolean value, true if empty', + }, + mapSizeDesc: { + zh: '获取 Map 的大小', + en: 'Return the size of a map', + }, + mapSizeParams: { + zh: 'Map 对象', + en: 'Map object', + }, + mapSizeReturns: { + zh: 'Map 的大小', + en: 'The size of the map', + }, }