mirror of
				https://github.com/fooflington/selfdefined.git
				synced 2025-11-03 23:29:03 +00:00 
			
		
		
		
	
		
			
				
	
	
		
			20 lines
		
	
	
		
			598 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
			
		
		
	
	
			20 lines
		
	
	
		
			598 B
		
	
	
	
		
			JavaScript
		
	
	
	
	
	
"use strict";
 | 
						|
Object.defineProperty(exports, "__esModule", { value: true });
 | 
						|
const path = require("path");
 | 
						|
const UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([*?|(){}[\]]|^!|[@+!](?=\())/g;
 | 
						|
/**
 | 
						|
 * Designed to work only with simple paths: `dir\\file`.
 | 
						|
 */
 | 
						|
function unixify(filepath) {
 | 
						|
    return filepath.replace(/\\/g, '/');
 | 
						|
}
 | 
						|
exports.unixify = unixify;
 | 
						|
function makeAbsolute(cwd, filepath) {
 | 
						|
    return path.resolve(cwd, filepath);
 | 
						|
}
 | 
						|
exports.makeAbsolute = makeAbsolute;
 | 
						|
function escape(pattern) {
 | 
						|
    return pattern.replace(UNESCAPED_GLOB_SYMBOLS_RE, '\\$2');
 | 
						|
}
 | 
						|
exports.escape = escape;
 |