cmacc-compiler
Advanced tools
Comparing version 1.0.12 to 1.0.13
{ | ||
"name": "cmacc-compiler", | ||
"version": "1.0.12", | ||
"version": "1.0.13", | ||
"description": "Cmacc Compiler", | ||
@@ -5,0 +5,0 @@ "main": "src/index.js", |
@@ -37,2 +37,3 @@ var fs = require('fs'); | ||
resolve = ref; | ||
} | ||
@@ -44,2 +45,3 @@ | ||
if (urlObj.protocol) { | ||
@@ -49,3 +51,12 @@ var dir = path.dirname(urlObj.pathname); | ||
resolve = url.format(urlObj); | ||
//TODO: Hack for file path windows | ||
if(/^win/.test(process.platform)){ | ||
resolve = resolve.replace(/(\w\w\w\w\:\/\/\w\/)(\w\:)/, "file:///" + "$2") | ||
resolve = resolve.replace(/(\w\w\w\w\:\w\:\\)(\w\:\\)/,"file:\\" + '$2') | ||
resolve = resolve.replace(/(\/(\w\:))(\/(\w\:))+/g, '$1' ) | ||
resolve = resolve.replace(/(\w\w\w\w\:\/\/\/)(\w\:\\)(\w\:\\)/,'$1' +'$3') | ||
} | ||
} else { | ||
resolve = options.path + '/' + ref; | ||
@@ -52,0 +63,0 @@ } |
@@ -11,4 +11,10 @@ var fs = require('fs'); | ||
//TODO: Hack for file path windows | ||
if(/^win/.test(process.platform) ){ | ||
file = file.replace(/(\w\w\w\w\:\/\/)(\w\:)/, 'file:///' + '$2') | ||
} | ||
var urlObj = url.parse(file); | ||
if(urlObj.protocol){ | ||
@@ -34,2 +40,7 @@ | ||
var location = decodeURI(urlObj.pathname); | ||
//TODO: Hack for file path windows | ||
if(/^win/.test(process.platform) ){ | ||
location = location.substring(1) | ||
} | ||
return fs.readFileSync(location, 'utf8'); | ||
@@ -36,0 +47,0 @@ } |
@@ -13,2 +13,3 @@ var string = require('./string'); | ||
} | ||
if ($$mrg$$) { | ||
@@ -18,2 +19,12 @@ $$src$$.$$mrg$$ = $$mrg$$; | ||
//TODO: Hack for file path windows | ||
if(/^win/.test(process.platform) ){ | ||
if($$src$$.$$text$$){ | ||
$$src$$.$$text$$ = $$src$$.$$text$$.replace(/^((\r\n)|;)*/yg,'') | ||
} | ||
if($$src$$.$$text$$ === '' || $$src$$.$$text$$ === null){ | ||
delete $$src$$.$$text$$ | ||
} | ||
} | ||
return $$src$$; | ||
@@ -20,0 +31,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
103616
1978