Skip to content

Commit a3bd72c

Browse files
committed
-> 0.10.0
1 parent 83c83ed commit a3bd72c

3 files changed

Lines changed: 9 additions & 5 deletions

File tree

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
# changelog
22

3+
## 0.10.0
4+
5+
* Complete rewrite, resulting in ~40x speed increase ([#30](https://github.com/Rich-Harris/magic-string/pull/30))
6+
* Breaking – `magicString.locate` and `locateOrigin` are deprecated
7+
* More forgiving rules about contiguous patches, and which ranges are valid with `magicString.slice(...)`
8+
39
## 0.9.1
410

511
* Update deps

README.md

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,6 @@ var s = new MagicString( 'problems = 99' );
5252

5353
s.overwrite( 0, 8, 'answer' );
5454
s.toString(); // 'answer = 99'
55-
s.locate( 9 ); // 7 - the character originally at index 9 ('=') is now at index 7
56-
s.locateOrigin( 7 ); // 9
5755

5856
s.overwrite( 11, 13, '42' ); // character indices always refer to the original string
5957
s.toString(); // 'answer = 42'
@@ -126,11 +124,11 @@ Inserts the specified `content` at the `index` in the original string. Returns `
126124

127125
### s.locate( index )
128126

129-
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.
127+
**DEPRECATED** since 0.10 – see [#30](https://github.com/Rich-Harris/magic-string/pull/30)
130128

131129
### s.locateOrigin( index )
132130

133-
The opposite of `s.locate()`. Returns `null` if the character in question was inserted with `s.append()`, `s.prepend()` or `s.overwrite()`.
131+
**DEPRECATED** since 0.10 – see [#30](https://github.com/Rich-Harris/magic-string/pull/30)
134132

135133
### s.overwrite( start, end, content[, storeName] )
136134

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"name": "magic-string",
33
"description": "Modify strings, generate sourcemaps",
44
"author": "Rich Harris",
5-
"version": "0.9.1",
5+
"version": "0.10.0",
66
"repository": "https://github.com/rich-harris/magic-string",
77
"main": "dist/magic-string.cjs.js",
88
"jsnext:main": "dist/magic-string.es6.js",

0 commit comments

Comments
 (0)