mirror of
https://github.com/goreleaser/goreleaser-action.git
synced 2026-05-14 14:50:32 +00:00
10 lines
320 B
JavaScript
10 lines
320 B
JavaScript
'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);
|
|
};
|