text-mapping
v1.0.1
Published
Offset and range mapper for string
Readme
text-mapping
Install
npm i text-mappingUsage
const text = new Text('ab')
text.prependLeft(1, 'foo')
text.toString() // -> afoob
// find 'a' in generated string
text.generatedOffsetFor(0) // -> 0
// find 'f' in original string (cannot find 'f')
text.originalOffsetFor(1) // -> -1License
MIT © fengzilong
