string-objectreplacesuffix
NOTE: string-objectreplacesuffix was renamed to @extra-string/object-replace-suffix.
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)