Skip to content

Bug: Incorrect error message on negative start position for remove #260

@rschristian

Description

@rschristian
import MagicString from 'https://esm.sh/magic-string';

const s = new MagicString('problems = 99');

s.remove(-1, 5);

Uncaught Error: end must be greater than start

Lead me on a bit of a wild goose chase before I realized the issue was with the start position, not that the end was somehow less than the start.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions