Skip to content

Commit

Permalink
-> v0.20.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed May 17, 2017
1 parent ea0c431 commit 19a4404
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 3 deletions.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# magic-string changelog

## 0.20.0

* The fourth argument to `overwrite` is a `{storeName, contentOnly}` options object. `storeName: true` is equivalent to `true` before. `contentOnly` will preserve existing appends/prepends to the chunk in question

## 0.19.1

* Prevent overwrites across a split point (i.e. following a `move`)
Expand Down
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -146,9 +146,11 @@ The `options` argument can have an `exclude` property, which is an array of `[st

Moves the characters from `start` and `end` to `index`. Returns `this`.

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

Replaces the characters from `start` to `end` with `content`. The same restrictions as `s.remove()` apply. Returns `this`. If `storeName` is `true`, the original name will be stored for later inclusion in a sourcemap's `names` array.
Replaces the characters from `start` to `end` with `content`. The same restrictions as `s.remove()` apply. Returns `this`.

The fourth argument is optional. It can have a `storeName` property — if `true`, the original name will be stored for later inclusion in a sourcemap's `names` array — and a `contentOnly` property which determines whether only the content is overwritten, or anything that was appended/prepended to the range as well.

### s.prepend( content )

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "magic-string",
"description": "Modify strings, generate sourcemaps",
"author": "Rich Harris",
"version": "0.19.1",
"version": "0.20.0",
"repository": "https://github.com/rich-harris/magic-string",
"main": "dist/magic-string.cjs.js",
"module": "dist/magic-string.es.js",
Expand Down

0 comments on commit 19a4404

Please sign in to comment.