diff --git a/CHANGELOG.md b/CHANGELOG.md index b19d478..4fb0ca4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # changelog +## 0.10.0 + +* Complete rewrite, resulting in ~40x speed increase ([#30](https://github.com/Rich-Harris/magic-string/pull/30)) +* Breaking – `magicString.locate` and `locateOrigin` are deprecated +* More forgiving rules about contiguous patches, and which ranges are valid with `magicString.slice(...)` + ## 0.9.1 * Update deps diff --git a/README.md b/README.md index 7fad524..ef6eadd 100644 --- a/README.md +++ b/README.md @@ -52,8 +52,6 @@ var s = new MagicString( 'problems = 99' ); s.overwrite( 0, 8, 'answer' ); s.toString(); // 'answer = 99' -s.locate( 9 ); // 7 - the character originally at index 9 ('=') is now at index 7 -s.locateOrigin( 7 ); // 9 s.overwrite( 11, 13, '42' ); // character indices always refer to the original string s.toString(); // 'answer = 42' @@ -126,11 +124,11 @@ Inserts the specified `content` at the `index` in the original string. Returns ` ### s.locate( index ) -Finds the location, in the generated string, of the character at `index` in the original string. Returns `null` if the character in question has been removed or overwritten. +**DEPRECATED** since 0.10 – see [#30](https://github.com/Rich-Harris/magic-string/pull/30) ### s.locateOrigin( index ) -The opposite of `s.locate()`. Returns `null` if the character in question was inserted with `s.append()`, `s.prepend()` or `s.overwrite()`. +**DEPRECATED** since 0.10 – see [#30](https://github.com/Rich-Harris/magic-string/pull/30) ### s.overwrite( start, end, content[, storeName] ) diff --git a/package.json b/package.json index 17f2b74..4347b62 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "magic-string", "description": "Modify strings, generate sourcemaps", "author": "Rich Harris", - "version": "0.9.1", + "version": "0.10.0", "repository": "https://github.com/rich-harris/magic-string", "main": "dist/magic-string.cjs.js", "jsnext:main": "dist/magic-string.es6.js",