Merge pull request #1 from artem-barysh-dev/tbel-formatting

TBEL formatting
This commit is contained in:
Max Petrov 2025-03-12 10:52:30 +02:00 committed by GitHub
commit 75ca5d446d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -23,7 +23,7 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
description: 'Encodes a string to Base64.', description: 'Encodes a string to Base64.',
args: [ args: [
{ {
name: 'input', name: 'str',
description: 'The string to encode', description: 'The string to encode',
type: 'string' type: 'string'
} }
@ -38,7 +38,7 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
description: 'Decodes a Base64 encoded string.', description: 'Decodes a Base64 encoded string.',
args: [ args: [
{ {
name: 'encoded', name: 'str',
description: 'The Base64 encoded string to decode', description: 'The Base64 encoded string to decode',
type: 'string' type: 'string'
} }
@ -53,9 +53,9 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
description: 'Converts a list of bytes to a string, optionally specifying the charset.', description: 'Converts a list of bytes to a string, optionally specifying the charset.',
args: [ args: [
{ {
name: 'bytesList', name: 'data',
description: 'The list of bytes to convert', description: 'The list of bytes to convert',
type: 'array' type: 'list'
}, },
{ {
name: 'charsetName', name: 'charsetName',
@ -71,12 +71,12 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
}, },
decodeToString: { decodeToString: {
meta: 'function', meta: 'function',
description: 'Converts a list of bytes to a string using the default charset.', description: 'Converts a list of bytes to a string.',
args: [ args: [
{ {
name: 'bytesList', name: 'data',
description: 'The list of bytes to convert', description: 'The list of bytes to convert',
type: 'array' type: 'list'
} }
], ],
return: { return: {
@ -89,13 +89,13 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
description: 'Parses a JSON string or converts a list of bytes to a string and parses it as JSON.', description: 'Parses a JSON string or converts a list of bytes to a string and parses it as JSON.',
args: [ args: [
{ {
name: 'input', name: 'data',
description: 'The JSON string or list of bytes to parse', description: 'The JSON string or list of bytes to parse into JSON object',
type: 'string | array' type: 'string | list'
} }
], ],
return: { return: {
description: 'The parsed JSON object (e.g., object, array, or primitive)', description: 'The parsed JSON object',
type: 'object' type: 'object'
} }
}, },
@ -117,7 +117,7 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
], ],
return: { return: {
description: 'The list of bytes representing the string', description: 'The list of bytes representing the string',
type: 'array' type: 'list'
} }
}, },
parseInt: { parseInt: {
@ -125,13 +125,13 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
description: 'Parses a string to an integer, optionally specifying the radix.', description: 'Parses a string to an integer, optionally specifying the radix.',
args: [ args: [
{ {
name: 'value', name: 'str',
description: 'The string to parse', description: 'The string to parse',
type: 'string' type: 'string'
}, },
{ {
name: 'radix', name: 'radix',
description: 'The radix for parsing (e.g., 2 for binary, 16 for hex, defaults to auto-detection if 0)', description: 'The radix for parsing (e.g., 2 for binary, 16 for hex). If omitted, it is auto-detected (e.g., 0x for hex).',
type: 'number', type: 'number',
optional: true optional: true
} }
@ -146,13 +146,13 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
description: 'Parses a string to a long integer, optionally specifying the radix.', description: 'Parses a string to a long integer, optionally specifying the radix.',
args: [ args: [
{ {
name: 'value', name: 'str',
description: 'The string to parse', description: 'The string to parse',
type: 'string' type: 'string'
}, },
{ {
name: 'radix', name: 'radix',
description: 'The radix for parsing (e.g., 2 for binary, 16 for hex, defaults to auto-detection if 0)', description: 'The radix for parsing (e.g., 2 for binary, 16 for hex). If omitted, it is auto-detected (e.g., 0x for hex).',
type: 'number', type: 'number',
optional: true optional: true
} }
@ -164,16 +164,16 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
}, },
parseFloat: { parseFloat: {
meta: 'function', meta: 'function',
description: 'Parses a string to a float. If radix is 16, interprets the string as hexadecimal IEEE 754 float bits.', description: 'Parses a string to a float, optionally specifying the radix.',
args: [ args: [
{ {
name: 'value', name: 'str',
description: 'The string to parse', description: 'The string to parse',
type: 'string' type: 'string'
}, },
{ {
name: 'radix', name: 'radix',
description: 'The radix for parsing (e.g., 16 for hex, defaults to 10 if 0)', description: 'The radix for parsing (e.g., 16 indicates a standard IEEE 754 hexadecimal float, defaults to 10 if unspecified)',
type: 'number', type: 'number',
optional: true optional: true
} }
@ -188,7 +188,7 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
description: 'Parses a hexadecimal string to a float, treating it as an integer value.', description: 'Parses a hexadecimal string to a float, treating it as an integer value.',
args: [ args: [
{ {
name: 'value', name: 'hex',
description: 'The hexadecimal string to parse (e.g., "0x0A" for 10.0)', description: 'The hexadecimal string to parse (e.g., "0x0A" for 10.0)',
type: 'string' type: 'string'
}, },
@ -205,16 +205,16 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
}, },
parseDouble: { parseDouble: {
meta: 'function', meta: 'function',
description: 'Parses a string to a double. If radix is 16, interprets the string as hexadecimal IEEE 754 double bits.', description: 'Parses a string to a double, optionally specifying the radix.',
args: [ args: [
{ {
name: 'value', name: 'str',
description: 'The string to parse', description: 'The string to parse',
type: 'string' type: 'string'
}, },
{ {
name: 'radix', name: 'radix',
description: 'The radix for parsing (e.g., 16 for hex, defaults to 10 if unspecified)', description: 'The radix for parsing (e.g., 16 indicates a standard IEEE 754 double bits, defaults to 10 if unspecified)',
type: 'number', type: 'number',
optional: true optional: true
} }
@ -259,7 +259,7 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
description: 'Parses a hexadecimal string to an integer, optionally specifying endianness.', description: 'Parses a hexadecimal string to an integer, optionally specifying endianness.',
args: [ args: [
{ {
name: 'value', name: 'hex',
description: 'The hexadecimal string to parse', description: 'The hexadecimal string to parse',
type: 'string' type: 'string'
}, },
@ -282,11 +282,11 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
{ {
name: 'data', name: 'data',
description: 'The bytes to parse', description: 'The bytes to parse',
type: 'array' type: 'list | array'
}, },
{ {
name: 'offset', name: 'offset',
description: 'The starting index in the byte array', description: 'The starting index in the byte list or array (defaults to 0)',
type: 'number', type: 'number',
optional: true optional: true
}, },
@ -343,7 +343,7 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
description: 'Parses a hexadecimal string to a long integer, optionally specifying endianness.', description: 'Parses a hexadecimal string to a long integer, optionally specifying endianness.',
args: [ args: [
{ {
name: 'value', name: 'hex',
description: 'The hexadecimal string to parse', description: 'The hexadecimal string to parse',
type: 'string' type: 'string'
}, },
@ -366,11 +366,11 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
{ {
name: 'data', name: 'data',
description: 'The bytes to parse', description: 'The bytes to parse',
type: 'array' type: 'list | array'
}, },
{ {
name: 'offset', name: 'offset',
description: 'The starting index in the byte array', description: 'The starting index in the byte list or array (defaults to 0)',
type: 'number', type: 'number',
optional: true optional: true
}, },
@ -427,7 +427,7 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
description: 'Parses a hexadecimal string to a float using IEEE 754 format, optionally specifying endianness.', description: 'Parses a hexadecimal string to a float using IEEE 754 format, optionally specifying endianness.',
args: [ args: [
{ {
name: 'value', name: 'hex',
description: 'The hexadecimal string to parse', description: 'The hexadecimal string to parse',
type: 'string' type: 'string'
}, },
@ -450,11 +450,11 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
{ {
name: 'data', name: 'data',
description: 'The bytes to parse', description: 'The bytes to parse',
type: 'array' type: 'list | array'
}, },
{ {
name: 'offset', name: 'offset',
description: 'The starting index in the byte array', description: 'The starting index in the byte list or array (defaults to 0)',
type: 'number', type: 'number',
optional: true optional: true
}, },
@ -483,11 +483,11 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
{ {
name: 'data', name: 'data',
description: 'The bytes to parse', description: 'The bytes to parse',
type: 'array' type: 'list | array'
}, },
{ {
name: 'offset', name: 'offset',
description: 'The starting index in the byte array', description: 'The starting index in the byte list or array (defaults to 0)',
type: 'number', type: 'number',
optional: true optional: true
}, },
@ -544,7 +544,7 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
description: 'Parses a hexadecimal string to a double using IEEE 754 format, optionally specifying endianness.', description: 'Parses a hexadecimal string to a double using IEEE 754 format, optionally specifying endianness.',
args: [ args: [
{ {
name: 'value', name: 'hex',
description: 'The hexadecimal string to parse', description: 'The hexadecimal string to parse',
type: 'string' type: 'string'
}, },
@ -567,11 +567,11 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
{ {
name: 'data', name: 'data',
description: 'The bytes to parse', description: 'The bytes to parse',
type: 'array' type: 'list | array'
}, },
{ {
name: 'offset', name: 'offset',
description: 'The starting index in the byte array', description: 'The starting index in the byte list or array (defaults to 0)',
type: 'number', type: 'number',
optional: true optional: true
}, },
@ -600,11 +600,11 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
{ {
name: 'data', name: 'data',
description: 'The bytes to parse', description: 'The bytes to parse',
type: 'array' type: 'list | array'
}, },
{ {
name: 'offset', name: 'offset',
description: 'The starting index in the byte array', description: 'The starting index in the byte list or array (defaults to 0)',
type: 'number', type: 'number',
optional: true optional: true
}, },
@ -628,11 +628,11 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
}, },
toFixed: { toFixed: {
meta: 'function', meta: 'function',
description: 'Rounds a number to a specified number of decimal places.', description: 'Rounds a floating-point number to a set precision using half-up rounding.',
args: [ args: [
{ {
name: 'value', name: 'value',
description: 'The number to round', description: 'The floating-point number',
type: 'number' type: 'number'
}, },
{ {
@ -642,17 +642,17 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
} }
], ],
return: { return: {
description: 'The rounded number', description: 'The rounded floating-point number.',
type: 'number' type: 'number'
} }
}, },
toInt: { toInt: {
meta: 'function', meta: 'function',
description: 'Converts a double to an integer by rounding.', description: 'Converts a floating-point number to an integer by half-up rounding.',
args: [ args: [
{ {
name: 'value', name: 'value',
description: 'The double to convert', description: 'The floating-point number to convert',
type: 'number' type: 'number'
} }
], ],
@ -666,14 +666,14 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
description: 'Converts a hexadecimal string to a list of bytes.', description: 'Converts a hexadecimal string to a list of bytes.',
args: [ args: [
{ {
name: 'value', name: 'hex',
description: 'The hexadecimal string to convert', description: 'The hexadecimal string to convert',
type: 'string' type: 'string'
} }
], ],
return: { return: {
description: 'The list of bytes', description: 'The list of bytes',
type: 'array' type: 'list'
} }
}, },
hexToBytesArray: { hexToBytesArray: {
@ -681,7 +681,7 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
description: 'Converts a hexadecimal string to an array of bytes.', description: 'Converts a hexadecimal string to an array of bytes.',
args: [ args: [
{ {
name: 'value', name: 'hex',
description: 'The hexadecimal string to convert', description: 'The hexadecimal string to convert',
type: 'string' type: 'string'
} }
@ -696,7 +696,7 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
description: 'Converts an integer to a hexadecimal string.', description: 'Converts an integer to a hexadecimal string.',
args: [ args: [
{ {
name: 'i', name: 'value',
description: 'The integer to convert', description: 'The integer to convert',
type: 'number' type: 'number'
}, },
@ -707,13 +707,13 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
optional: true optional: true
}, },
{ {
name: 'pref', name: 'prefix',
description: 'Whether to prefix with "0x" (defaults to false)', description: 'Whether to prefix with "0x" (defaults to false)',
type: 'boolean', type: 'boolean',
optional: true optional: true
}, },
{ {
name: 'len', name: 'length',
description: 'The desired length of the hex string (defaults to minimum required)', description: 'The desired length of the hex string (defaults to minimum required)',
type: 'number', type: 'number',
optional: true optional: true
@ -729,7 +729,7 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
description: 'Converts a long integer to a hexadecimal string.', description: 'Converts a long integer to a hexadecimal string.',
args: [ args: [
{ {
name: 'l', name: 'value',
description: 'The long integer to convert', description: 'The long integer to convert',
type: 'number' type: 'number'
}, },
@ -740,13 +740,13 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
optional: true optional: true
}, },
{ {
name: 'pref', name: 'prefix',
description: 'Whether to prefix with "0x" (defaults to false)', description: 'Whether to prefix with "0x" (defaults to false)',
type: 'boolean', type: 'boolean',
optional: true optional: true
}, },
{ {
name: 'len', name: 'length',
description: 'The desired length of the hex string (defaults to minimum required)', description: 'The desired length of the hex string (defaults to minimum required)',
type: 'number', type: 'number',
optional: true optional: true
@ -762,13 +762,13 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
description: 'Converts a long integer to a string in the specified radix.', description: 'Converts a long integer to a string in the specified radix.',
args: [ args: [
{ {
name: 'number', name: 'value',
description: 'The number to convert', description: 'The number to convert',
type: 'number' type: 'number'
}, },
{ {
name: 'radix', name: 'radix',
description: 'The radix for conversion (e.g., 2, 8, 10, 16, defaults to 10)', description: 'The radix for conversion (e.g., 2 for binary, 16 for hex). If omitted, it defaults to 10.',
type: 'number', type: 'number',
optional: true optional: true
}, },
@ -779,7 +779,7 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
optional: true optional: true
}, },
{ {
name: 'pref', name: 'prefix',
description: 'Whether to prefix hex with "0x" (defaults to false)', description: 'Whether to prefix hex with "0x" (defaults to false)',
type: 'boolean', type: 'boolean',
optional: true optional: true
@ -795,7 +795,7 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
description: 'Converts a float to its IEEE 754 hexadecimal representation.', description: 'Converts a float to its IEEE 754 hexadecimal representation.',
args: [ args: [
{ {
name: 'f', name: 'value',
description: 'The float to convert', description: 'The float to convert',
type: 'number' type: 'number'
}, },
@ -807,7 +807,7 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
} }
], ],
return: { return: {
description: 'The hexadecimal string (e.g., "0x41200000" for 10.0)', description: 'The hexadecimal string',
type: 'string' type: 'string'
} }
}, },
@ -816,7 +816,7 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
description: 'Converts a double to its IEEE 754 hexadecimal representation.', description: 'Converts a double to its IEEE 754 hexadecimal representation.',
args: [ args: [
{ {
name: 'd', name: 'value',
description: 'The double to convert', description: 'The double to convert',
type: 'number' type: 'number'
}, },
@ -828,7 +828,7 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
} }
], ],
return: { return: {
description: 'The hexadecimal string (e.g., "0x4024000000000000" for 10.0)', description: 'The hexadecimal string',
type: 'string' type: 'string'
} }
}, },
@ -837,14 +837,14 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
description: 'Converts a list of signed bytes to a list of unsigned integer values.', description: 'Converts a list of signed bytes to a list of unsigned integer values.',
args: [ args: [
{ {
name: 'byteArray', name: 'data',
description: 'The list of bytes to convert', description: 'The list of bytes to convert',
type: 'array' type: 'list'
} }
], ],
return: { return: {
description: 'The list of unsigned integers (0-255)', description: 'The list of unsigned integers (0-255)',
type: 'array' type: 'list'
} }
}, },
base64ToHex: { base64ToHex: {
@ -852,7 +852,7 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
description: 'Converts a Base64 string to a hexadecimal string.', description: 'Converts a Base64 string to a hexadecimal string.',
args: [ args: [
{ {
name: 'base64', name: 'str',
description: 'The Base64 string to convert', description: 'The Base64 string to convert',
type: 'string' type: 'string'
} }
@ -882,7 +882,7 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
description: 'Converts a Base64 string to an array of bytes.', description: 'Converts a Base64 string to an array of bytes.',
args: [ args: [
{ {
name: 'input', name: 'str',
description: 'The Base64 string to convert', description: 'The Base64 string to convert',
type: 'string' type: 'string'
} }
@ -897,14 +897,14 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
description: 'Converts a Base64 string to a list of bytes.', description: 'Converts a Base64 string to a list of bytes.',
args: [ args: [
{ {
name: 'input', name: 'str',
description: 'The Base64 string to convert', description: 'The Base64 string to convert',
type: 'string' type: 'string'
} }
], ],
return: { return: {
description: 'The list of bytes', description: 'The list of bytes',
type: 'array' type: 'list'
} }
}, },
bytesToBase64: { bytesToBase64: {
@ -912,7 +912,7 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
description: 'Converts an array of bytes to a Base64 string.', description: 'Converts an array of bytes to a Base64 string.',
args: [ args: [
{ {
name: 'bytes', name: 'data',
description: 'The array of bytes to convert', description: 'The array of bytes to convert',
type: 'array' type: 'array'
} }
@ -924,12 +924,12 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
}, },
bytesToHex: { bytesToHex: {
meta: 'function', meta: 'function',
description: 'Converts an array or list of bytes to a hexadecimal string.', description: 'Converts a list or array of bytes to a hexadecimal string.',
args: [ args: [
{ {
name: 'bytes', name: 'data',
description: 'The bytes to convert', description: 'The bytes to convert',
type: 'array' type: 'list | array'
} }
], ],
return: { return: {
@ -939,7 +939,7 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
}, },
toFlatMap: { toFlatMap: {
meta: 'function', meta: 'function',
description: 'Converts a nested map to a flat map, with options for key paths and exclusions.', description: 'Converts a nested map to a flat map, with customizable key paths and exclusions',
args: [ args: [
{ {
name: 'json', name: 'json',
@ -947,9 +947,9 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
type: 'object' type: 'object'
}, },
{ {
name: 'excludeList', name: 'excludeKeys',
description: 'List of keys to exclude from flattening', description: 'List of keys to exclude from flattening',
type: 'array', type: 'list',
optional: true optional: true
}, },
{ {
@ -969,7 +969,7 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
description: 'Encodes a URI string, preserving certain characters as per MDN standards.', description: 'Encodes a URI string, preserving certain characters as per MDN standards.',
args: [ args: [
{ {
name: 'uri', name: 'str',
description: 'The URI string to encode', description: 'The URI string to encode',
type: 'string' type: 'string'
} }
@ -981,10 +981,10 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
}, },
decodeURI: { decodeURI: {
meta: 'function', meta: 'function',
description: 'Decodes a URI string previously encoded with encodeURI.', description: 'Decodes a URI string previously encoded.',
args: [ args: [
{ {
name: 'uri', name: 'str',
description: 'The URI string to decode', description: 'The URI string to decode',
type: 'string' type: 'string'
} }
@ -999,7 +999,7 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
description: 'Throws an error with a custom message.', description: 'Throws an error with a custom message.',
args: [ args: [
{ {
name: 'message', name: 'str',
description: 'The error message to throw', description: 'The error message to throw',
type: 'string' type: 'string'
} }
@ -1071,17 +1071,17 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
}, },
bytesToExecutionArrayList: { bytesToExecutionArrayList: {
meta: 'function', meta: 'function',
description: 'Converts an array of bytes to an execution array list.', description: 'Converts an array of bytes to a list.',
args: [ args: [
{ {
name: 'byteArray', name: 'data',
description: 'The array of bytes to convert', description: 'The array of bytes to convert',
type: 'array' type: 'array'
} }
], ],
return: { return: {
description: 'The execution array list of bytes', description: 'The list of bytes',
type: 'array' type: 'list'
} }
}, },
padStart: { padStart: {
@ -1094,7 +1094,7 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
type: 'string' type: 'string'
}, },
{ {
name: 'targetLength', name: 'length',
description: 'The desired length of the resulting string', description: 'The desired length of the resulting string',
type: 'number' type: 'number'
}, },
@ -1119,7 +1119,7 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
type: 'string' type: 'string'
}, },
{ {
name: 'targetLength', name: 'length',
description: 'The desired length of the resulting string', description: 'The desired length of the resulting string',
type: 'number' type: 'number'
}, },
@ -1139,12 +1139,12 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
description: 'Converts a byte to a binary array.', description: 'Converts a byte to a binary array.',
args: [ args: [
{ {
name: 'byteValue', name: 'value',
description: 'The byte value to convert', description: 'The byte value to convert',
type: 'number' type: 'number'
}, },
{ {
name: 'binLength', name: 'length',
description: 'The length of the binary array (defaults to 8)', description: 'The length of the binary array (defaults to 8)',
type: 'number', type: 'number',
optional: true optional: true
@ -1157,7 +1157,7 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
} }
], ],
return: { return: {
description: 'The binary array (array of 0s and 1s)', description: 'The binary array',
type: 'array' type: 'array'
} }
}, },
@ -1166,19 +1166,19 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
description: 'Converts a list or array of bytes to a binary array.', description: 'Converts a list or array of bytes to a binary array.',
args: [ args: [
{ {
name: 'value', name: 'data',
description: 'The bytes to convert', description: 'The bytes to convert',
type: 'array' type: 'list | array'
}, },
{ {
name: 'binLength', name: 'length',
description: 'The total length of the binary array (defaults to bytes.length * 8)', description: 'The total length of the binary array (defaults to bytes.length * 8)',
type: 'number', type: 'number',
optional: true optional: true
} }
], ],
return: { return: {
description: 'The binary array (array of 0s and 1s)', description: 'The binary array',
type: 'array' type: 'array'
} }
}, },
@ -1187,34 +1187,34 @@ export const tbelUtilsAutocompletes = new TbEditorCompleter({
description: 'Converts a long integer to a binary array.', description: 'Converts a long integer to a binary array.',
args: [ args: [
{ {
name: 'longValue', name: 'value',
description: 'The long integer to convert', description: 'The long integer to convert',
type: 'number' type: 'number'
}, },
{ {
name: 'binLength', name: 'length',
description: 'The length of the binary array (defaults to 64)', description: 'The length of the binary array (defaults to 64)',
type: 'number', type: 'number',
optional: true optional: true
} }
], ],
return: { return: {
description: 'The binary array (array of 0s and 1s)', description: 'The binary array',
type: 'array' type: 'array'
} }
}, },
parseBinaryArrayToInt: { parseBinaryArrayToInt: {
meta: 'function', meta: 'function',
description: 'Converts a binary array to an integer.', description: 'Converts a binary list or array to an integer.',
args: [ args: [
{ {
name: 'value', name: 'data',
description: 'The binary array to convert (array of 0s and 1s)', description: 'The binary list or array to convert',
type: 'array' type: 'list | array'
}, },
{ {
name: 'offset', name: 'offset',
description: 'The starting index in the array (defaults to 0)', description: 'The starting index in the binary list or array (defaults to 0)',
type: 'number', type: 'number',
optional: true optional: true
}, },