mirror of
				https://github.com/crazy-max/ghaction-upx.git
				synced 2025-11-04 04:58:11 -07:00 
			
		
		
		
	
		
			
				
	
	
		
			11 lines
		
	
	
		
			320 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			11 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);
 | 
						|
};
 |