From 9f740a15df41c3d54d52111b6777e38cb909ad3e Mon Sep 17 00:00:00 2001 From: mpetrov Date: Wed, 12 Mar 2025 17:48:56 +0200 Subject: [PATCH] Updated default script --- .../shared/components/js-func.component.scss | 2 +- .../shared/models/ace/tbel-utils.models.ts | 26 +++++++++++++++---- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/ui-ngx/src/app/shared/components/js-func.component.scss b/ui-ngx/src/app/shared/components/js-func.component.scss index 12b1d57ccc..44aab1abbf 100644 --- a/ui-ngx/src/app/shared/components/js-func.component.scss +++ b/ui-ngx/src/app/shared/components/js-func.component.scss @@ -82,7 +82,7 @@ .ace_tb { &.ace_tbel-utils-func { - color: #0000A2; + color: rgb(49, 132, 149); } } } diff --git a/ui-ngx/src/app/shared/models/ace/tbel-utils.models.ts b/ui-ngx/src/app/shared/models/ace/tbel-utils.models.ts index 53d0ccdd15..f0a04b4762 100644 --- a/ui-ngx/src/app/shared/models/ace/tbel-utils.models.ts +++ b/ui-ngx/src/app/shared/models/ace/tbel-utils.models.ts @@ -131,7 +131,7 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({ }, { name: 'radix', - description: 'The radix for parsing (e.g., 2 for binary, 16 for hex). If omitted, it is auto-detected (e.g., 0x for hex).', + description: 'The radix for parsing (e.g., 2 for binary, 16 for hex). Defaults to auto-detected (e.g., 0x for hex).', type: 'number', optional: true } @@ -152,7 +152,7 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({ }, { name: 'radix', - description: 'The radix for parsing (e.g., 2 for binary, 16 for hex). If omitted, it is auto-detected (e.g., 0x for hex).', + description: 'The radix for parsing (e.g., 2 for binary, 16 for hex). Defaults to auto-detected (e.g., 0x for hex).', type: 'number', optional: true } @@ -768,7 +768,7 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({ }, { name: 'radix', - description: 'The radix for conversion (e.g., 2 for binary, 16 for hex). If omitted, it defaults to 10.', + description: 'The radix for conversion (e.g., 2 for binary, 16 for hex). Defaults to 10.', type: 'number', optional: true }, @@ -1229,7 +1229,22 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({ description: 'The parsed integer', type: 'number' } - } + }, + isNaN: { + meta: 'function', + description: 'Checks if the given number is NaN (Not a Number).', + args: [ + { + name: 'value', + description: 'The number to check', + type: 'number' + } + ], + return: { + description: 'True if the number is NaN, false otherwise', + type: 'boolean' + } + }, }); const tbelUtilsFuncNames = [ @@ -1292,7 +1307,8 @@ const tbelUtilsFuncNames = [ "parseByteToBinaryArray", "parseBytesToBinaryArray", "parseLongToBinaryArray", - "parseBinaryArrayToInt" + "parseBinaryArrayToInt", + "isNaN", ]; export const tbelUtilsFuncHighlightRules: Array =