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

Method prepend

src/MagicString.ts:660–667  ·  view source on GitHub ↗

* Prepends the string with the specified content.

(content: string)

Source from the content-addressed store, hash-verified

658 * Prepends the string with the specified content.
659 */
660 prepend(content: string): this {
661 if (typeof content !== 'string') {
662 throw new MagicStringError(`content must be a string, got ${typeof content}`)
663 }
664
665 this.intro = content + this.intro
666 return this
667 }
668
669 /**
670 * 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