0.1.3 • Published 7 years ago

string-mapreplacesuffix v0.1.3

Weekly downloads
5
License
MIT
Repository
github
Last release
7 years ago

string-mapreplacesuffix

NOTE: string-mapreplacesuffix was renamed to @extra-string/map-replace-suffix. NPM

Replace suffix of string using map.

const mapReplaceSuffix = require('string-mapreplacesuffix');
// mapReplaceSuffix(<string>, <map>, [max suffix length])

mapReplaceSuffix('ender', new Map([['er', ''], ['ing', ''], ['ed', '']]));
// 'end
mapReplaceSuffix('ender', new Map([['end', 'right'], ['start', 'left']]));
// 'ender' (only suffix)
mapReplaceSuffix('ender', new Map([['er', ' game'], ['game', 'play']]), 4);
// 'end game' (only once)
0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

8 years ago

0.1.0

8 years ago

0.0.7

8 years ago

0.0.6

8 years ago

0.0.5

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago