string-objectreplacesuffix

0.1.8 • Public • Published

string-objectreplacesuffix

NOTE: string-objectreplacesuffix was renamed to @extra-string/object-replace-suffix. NPM

Replace suffix of string using object.

const objectReplaceSuffix = require('string-objectreplacesuffix');
// objectReplaceSuffix(<string>, <object>, [max suffix length])

objectReplaceSuffix('ender', {'er': '', 'ing': '', 'ed': ''});
// 'end
objectReplaceSuffix('ender', {'end': 'right', 'start': 'left'});
// 'ender' (only suffix)
objectReplaceSuffix('ender', {'er': ' game', 'game': 'play'}, 4);
// 'end game' (only once)

Package Sidebar

Install

npm i string-objectreplacesuffix

Weekly Downloads

0

Version

0.1.8

License

MIT

Unpacked Size

2.05 kB

Total Files

3

Last publish

Collaborators

  • wolfram77