'use strict';varescapeStringRegexp=require('escape-string-regexp');module.exports=function(str,target){if(typeofstr!=='string'||typeoftarget!=='string'){thrownewTypeError('Expected a string');}returnstr.replace(newRegExp('(?:'+escapeStringRegexp(target)+'){2,}','g'),target);};