0.1.3 • Published 6 years ago

string-mapreplaceprefix v0.1.3

Weekly downloads
4
License
MIT
Repository
github
Last release
6 years ago

string-mapreplaceprefix

NOTE: string-mapreplaceprefix was renamed to @extra-string/map-replace-prefix. NPM

Replace prefix of string using map.

const mapReplacePrefix = require('string-mapreplaceprefix');
// mapReplacePrefix(<string>, <map>, [max prefix length])

mapReplacePrefix('dishonoured', new Map([['dis', ''], ['un', ''], ['in', '']]));
// 'honoured'
mapReplacePrefix('dishonoured', new Map([['honour', 'respect'], ['flatter', 'mock']]));
// 'dishonoured' (only prefix)
mapReplacePrefix('dishonoured', new Map([['dis', 'redis'], ['redis', 'super']]), 5);
// 'redishonoured' (only once)
0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.7

6 years ago

0.0.6

6 years ago

0.0.5

6 years ago

0.0.4

6 years ago

0.0.3

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago