const s = new MagicString('foobar');
s.update(2, 3, 'od\n');
s.update(4, 5, 'a\nnd\n');
does produce wrong mappings. When the string passed to update or overwrite ends with a new line, the mappings will contain two entries for column zero. This happens because in #261 the loop does not bail if the last line is empty, filling two lines with the same mapping.
This is currently blocking Svelte language tools from bumping magic-string to the latest version.
does produce wrong mappings. When the string passed to
update
oroverwrite
ends with a new line, the mappings will contain two entries for column zero. This happens because in #261 the loop does not bail if the last line is empty, filling two lines with the same mapping. This is currently blocking Svelte language tools from bumpingmagic-string
to the latest version.