Expand description
JavaScript string and number semantics that pi’s texts depend on: string
lengths and slices count UTF-16 code units, and toFixed and Math.round
round halves up.
Functions§
- byte_
index - The byte offset of UTF-16 index
unitsintext: the start of the first character at or after it, or the end of the text. - decode_
utf8_ stream TextDecoder.decode(bytes, {stream: true}): appendsbytestopendingand decodes what is complete. A character cut off at the end stays pending; invalid bytes become U+FFFD.- errno
- Node’s code and description for an I/O error of
kind, such as("ENOENT", "no such file or directory"). - len
text.length.- node_
error - The message Node gives a failed file system call, such as
ENOENT: no such file or directory, access '/a/b'. - round
Math.round(value).- slice
text.slice(start, end)with indices in UTF-16 code units, clamped to the text. A surrogate pair cut in half becomes U+FFFD.- to_
fixed value.toFixed(digits): the exact value rounded half up.- utf16_
index - The UTF-16 index of byte offset
byteintext, as JavaScript indexes strings; an offset inside a character counts from its start.