KC's Workspace
    Preparing search index...

    Hierarchy (View Summary)

    Index

    Constructors

    Accessors

    Methods

    • Deprecated method that throws an error directing users to use prependRight or appendLeft. This matches the original magic-string API which deprecated this method.

      Parameters

      • index: number
      • content: string

      Returns void

    • Alias for relocate to match the original magic-string API. Moves the characters from start to end to index. Returns this for method chaining.

      Parameters

      • start: number
      • end: number
      • index: number

      Returns this

    • Parameters

      • start: number
      • end: number
      • content: string

      Returns this

    • Resets the portion of the string from start to end to its original content. This undoes any modifications made to that range. Supports negative indices (counting from the end).

      Parameters

      • start: number
      • end: number

      Returns this

    • Returns the content between the specified UTF-16 code unit positions (JS string indices). Supports negative indices (counting from the end).

      When an index falls in the middle of a surrogate pair, the lone surrogate is included in the result (matching the original magic-string / JS behavior). This is done by returning a UTF-16 encoded JS string via napi_create_string_utf16.

      Parameters

      • Optionalstart: number | null
      • Optionalend: number | null

      Returns string

    • Trims whitespace or specified characters from the start and end.

      Parameters

      • OptionalcharType: string | null

      Returns this

    • Trims whitespace or specified characters from the end.

      Parameters

      • OptionalcharType: string | null

      Returns this

    • Trims whitespace or specified characters from the start.

      Parameters

      • OptionalcharType: string | null

      Returns this