1.1.3 • Published 5 years ago

@extra-string/map-replace-suffix v1.1.3

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

Replace suffix of string using map.

const mapReplaceSuffix = require('@extra-string/map-replace-suffix');
// 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)

extra-string

1.1.3

5 years ago

1.1.0

5 years ago

1.0.9

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

1.0.1

6 years ago

1.0.0

6 years ago