Creates a string Relish value.
The name has an underscore suffix to avoid shadowing the global String object. Strings are encoded as UTF-8 with a variable-length size prefix using a tagged varint: 7 bits for lengths 0-127, or 4 bytes for larger strings.
A JavaScript string
RelishString value
import { String_, encode } from '@grounds/core';const greeting = String_('hello world');encode(greeting).match( (bytes) => console.log('String encoded:', bytes), (error) => console.error(error)); Copy
import { String_, encode } from '@grounds/core';const greeting = String_('hello world');encode(greeting).match( (bytes) => console.log('String encoded:', bytes), (error) => console.error(error));
Named String_ (with trailing underscore) to avoid shadowing the global String type.
Creates a string Relish value.
The name has an underscore suffix to avoid shadowing the global String object. Strings are encoded as UTF-8 with a variable-length size prefix using a tagged varint: 7 bits for lengths 0-127, or 4 bytes for larger strings.