first commit
This commit is contained in:
10
build/node_modules/trim-repeated/index.js
generated
vendored
Normal file
10
build/node_modules/trim-repeated/index.js
generated
vendored
Normal file
@@ -0,0 +1,10 @@
|
||||
'use strict';
|
||||
var escapeStringRegexp = require('escape-string-regexp');
|
||||
|
||||
module.exports = function (str, target) {
|
||||
if (typeof str !== 'string' || typeof target !== 'string') {
|
||||
throw new TypeError('Expected a string');
|
||||
}
|
||||
|
||||
return str.replace(new RegExp('(?:' + escapeStringRegexp(target) + '){2,}', 'g'), target);
|
||||
};
|
||||
Reference in New Issue
Block a user