string-batch-update
v0.0.7
Published
## installation ```bash # npm npm install string-batch-update
Downloads
5
Readme
string-batch-update
installation
# npm
npm install string-batch-update
# yarn
yarn install string-batch-update
usage
import {strintBatchUpdate, EDIT_TYPE} from 'string-batch-update'
let nextText = stringBatchReplace("abc",[
{
type:EDIT_TYPE.insert,
start:1,
text:"x"
},
{
type:EDIT_TYPE.delete,
start:1,
end:2
},
{
type:EDIT_TYPE.replace,
start:2,
end:3,
text:"yy"
}
])
// should output axyy
console.log(newText)