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

Method prepend

src/MagicString.ts:691–698  ·  view source on GitHub ↗

* Prepends the string with the specified content.

(content: string)

Source from the content-addressed store, hash-verified

689 * Prepends the string with the specified content.
690 */
691 prepend(content: string): this {
692 if (typeof content !== 'string') {
693 throw new MagicStringError(`content must be a string, got ${typeof content}`)
694 }
695
696 this.intro = content + this.intro
697 return this
698 }
699
700 /**
701 * Same as `s.appendLeft(...)`, except that the inserted content will go *before* any previous appends or prepends at index

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected