Interface unsafe

Hierarchy

  • unsafe

Methods

  • Cast bytes to a String without copying. This is the fastest way to get a String from a Uint8Array or ArrayBuffer.

    Only use this for ASCII strings. If there are non-ascii characters, your application may crash and/or very confusing bugs will happen such as "foo" !== "foo".

    The input buffer must not be garbage collected. That means you will need to hold on to it for the duration of the string's lifetime.

    Parameters

    • buffer: Uint8Array | ArrayBufferLike

    Returns string

  • Cast bytes to a String without copying. This is the fastest way to get a String from a Uint16Array

    The input must be a UTF-16 encoded string. This API does no validation whatsoever.

    The input buffer must not be garbage collected. That means you will need to hold on to it for the duration of the string's lifetime.

    Parameters

    • buffer: Uint16Array

    Returns string

  • Mock bun's segfault handler. You probably don't want to use this

    Returns void

Generated using TypeDoc