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

Method snip

src/MagicString.ts:1110–1116  ·  view source on GitHub ↗

* Returns a clone of `s`, with all content before the `start` and `end` characters of the original string removed.

(start: number, end: number)

Source from the content-addressed store, hash-verified

1108 * Returns a clone of `s`, with all content before the `start` and `end` characters of the original string removed.
1109 */
1110 snip(start: number, end: number): this {
1111 const clone = this.clone()
1112 clone.remove(0, start)
1113 clone.remove(end, clone.original.length)
1114
1115 return clone
1116 }
1117
1118 /** @internal */
1119 _split(index: number): boolean | void {

Callers

nothing calls this directly

Calls 2

cloneMethod · 0.95
removeMethod · 0.45

Tested by

no test coverage detected