normalise opts.sourceRoot path - 6to5/karma-6to5-preprocessor#5

This commit is contained in:
Sebastian McKenzie
2015-02-09 23:38:54 +11:00
parent ba0dfac53d
commit 26d4b5f2cf
2 changed files with 8 additions and 1 deletions

View File

@@ -123,7 +123,10 @@ File.prototype.normalizeOptions = function (opts) {
});
// normalize windows path separators to unix
opts.filename = opts.filename.replace(/\\/g, "/");
opts.filename = util.normalisePathSeparator(opts.filename);
if (opts.sourceRoot) {
opts.sourceRoot = util.normalisePathSeparator(opts.sourceRoot);
}
opts.basename = path.basename(opts.filename, path.extname(opts.filename));

View File

@@ -30,6 +30,10 @@ exports.canCompile = function (filename, altExts) {
exports.canCompile.EXTENSIONS = [".js", ".jsx", ".es6", ".es"];
exports.normalisePathSeparator = function (filename) {
return filename.replace(/\\/g, "/");
};
exports.isInteger = function (i) {
return isNumber(i) && i % 1 === 0;
};