mirror of
				https://github.com/crazy-max/ghaction-upx.git
				synced 2025-11-04 04:58:11 -07:00 
			
		
		
		
	
		
			
				
	
	
		
			12 lines
		
	
	
		
			306 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			12 lines
		
	
	
		
			306 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
'use strict';
 | 
						|
var escapeStringRegexp = require('escape-string-regexp');
 | 
						|
 | 
						|
module.exports = function (str, sub) {
 | 
						|
	if (typeof str !== 'string' || typeof sub !== 'string') {
 | 
						|
		throw new TypeError();
 | 
						|
	}
 | 
						|
 | 
						|
	sub = escapeStringRegexp(sub);
 | 
						|
	return str.replace(new RegExp('^' + sub + '|' + sub + '$', 'g'), '');
 | 
						|
};
 |