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

Function create

tests/MagicString/replace.test.ts:358–358  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

356
357 it('skips a match over the rest of an overwritten range when the replacement is left out or gone', () => {
358 const create = () => new MagicString('abc').appendLeft(1, '').update(0, 3, 'Q')
359
360 // the match leaves out the first chunk, so the replacement would be doubled
361 assert.strictEqual(create().replace('bc', 'P').toString(), 'Q')

Callers 1

replace.test.tsFile · 0.70

Calls 2

updateMethod · 0.45
appendLeftMethod · 0.45

Tested by

no test coverage detected