TypeCode specifying the type of all array elements
Array of elements matching the elementType
RelishArray value
import { Array_, U32, encode } from '@grounds/core';
// Array of unsigned 32-bit integers
const numbers = Array_(0x04, [10, 20, 30]); // TypeCode.U32 = 0x04
encode(numbers).match(
(bytes) => console.log('Array encoded:', bytes),
(error) => console.error(error)
);
Creates a homogeneous array Relish value.
The name has an underscore suffix to avoid shadowing the global Array object. All elements must be the same type specified by elementType. For primitive element types, elements are raw JS values. For composite types (Array, Map, Struct, Enum), elements are RelishValue objects.