es6-module-transpiler
Advanced tools
Comparing version 0.8.2 to 0.8.3
@@ -5,3 +5,4 @@ /* jshint node:true, undef:true, unused:true */ | ||
var esprima = require('esprima-fb'); | ||
var fs = require('fs'); | ||
var realFS = require('fs'); | ||
var Path = require('path'); | ||
@@ -80,8 +81,22 @@ var proto = '__proto__'; | ||
function mkdirpSync(path) { | ||
var parts = path.split('/'); | ||
var dir = ''; | ||
/** | ||
* Create a hierarchy of directories of it does not already exist. | ||
* | ||
* @param {string} path | ||
* @param {{fs: object=}} options | ||
*/ | ||
function mkdirpSync(path, options) { | ||
var fs = options && options.fs || realFS; | ||
parts.forEach(function(part) { | ||
dir += '/' + part; | ||
var ancestors = []; | ||
var ancestor = path; | ||
while (true) { | ||
var nextAncestor = Path.dirname(ancestor); | ||
if (nextAncestor === ancestor) { break; } | ||
ancestors.unshift(ancestor); | ||
ancestor = nextAncestor; | ||
} | ||
ancestors.forEach(function(dir) { | ||
if (!fs.existsSync(dir)) { | ||
@@ -88,0 +103,0 @@ fs.mkdirSync(dir); |
{ | ||
"name": "es6-module-transpiler", | ||
"version": "0.8.2", | ||
"version": "0.8.3", | ||
"description": "es6-module-transpiler is an experimental compiler that allows you to write your JavaScript using a subset of the current ES6 module syntax, and compile it into various formats.", | ||
@@ -5,0 +5,0 @@ "homepage": "http://esnext.github.io/es6-module-transpiler", |
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
107532
3285