MCPcopy Create free account
hub / github.com/Rich-Harris/magic-string / snip

Method snip

src/MagicString.js:653–659  ·  view source on GitHub ↗
(start, end)

Source from the content-addressed store, hash-verified

651
652 // TODO deprecate this? not really very useful
653 snip(start, end) {
654 const clone = this.clone();
655 clone.remove(0, start);
656 clone.remove(end, clone.original.length);
657
658 return clone;
659 }
660
661 _split(index) {
662 if (this.byStart[index] || this.byEnd[index]) return;

Callers

nothing calls this directly

Calls 2

cloneMethod · 0.95
removeMethod · 0.45

Tested by

no test coverage detected