babel-core
Advanced tools
Comparing version 6.11.4 to 6.13.0
@@ -306,17 +306,35 @@ "use strict"; | ||
return presets.map(function (val) { | ||
var options = void 0; | ||
if (Array.isArray(val)) { | ||
if (val.length > 2) { | ||
throw new Error("Unexpected extra options " + (0, _stringify2.default)(val.slice(2)) + " passed to preset."); | ||
} | ||
var _val = val; | ||
val = _val[0]; | ||
options = _val[1]; | ||
} | ||
var presetLoc = void 0; | ||
if (typeof val === "string") { | ||
var presetLoc = (0, _resolve2.default)("babel-preset-" + val, dirname) || (0, _resolve2.default)(val, dirname); | ||
if (presetLoc) { | ||
var _val = require(presetLoc); | ||
onResolve && onResolve(_val, presetLoc); | ||
return _val; | ||
} else { | ||
presetLoc = (0, _resolve2.default)("babel-preset-" + val, dirname) || (0, _resolve2.default)(val, dirname); | ||
if (!presetLoc) { | ||
throw new Error("Couldn't find preset " + (0, _stringify2.default)(val) + " relative to directory " + (0, _stringify2.default)(dirname)); | ||
} | ||
} else if ((typeof val === "undefined" ? "undefined" : (0, _typeof3.default)(val)) === "object") { | ||
onResolve && onResolve(val); | ||
return val; | ||
} else { | ||
val = require(presetLoc); | ||
} | ||
if (typeof val !== "function" && options !== undefined) { | ||
throw new Error("Options " + (0, _stringify2.default)(options) + " passed to " + (presetLoc || "a preset") + " which does not accept options."); | ||
} | ||
if (typeof val === "function") val = val(context, options); | ||
if ((typeof val === "undefined" ? "undefined" : (0, _typeof3.default)(val)) !== "object") { | ||
throw new Error("Unsupported preset format: " + val + "."); | ||
} | ||
onResolve && onResolve(val); | ||
return val; | ||
}); | ||
@@ -323,0 +341,0 @@ }; |
{ | ||
"name": "babel-core", | ||
"version": "6.11.4", | ||
"version": "6.13.0", | ||
"description": "Babel compiler core.", | ||
@@ -34,4 +34,4 @@ "author": "Sebastian McKenzie <sebmck@gmail.com>", | ||
"babel-register": "^6.9.0", | ||
"babel-traverse": "^6.11.4", | ||
"babel-types": "^6.9.1", | ||
"babel-traverse": "^6.13.0", | ||
"babel-types": "^6.13.0", | ||
"babylon": "^6.7.0", | ||
@@ -53,4 +53,4 @@ "convert-source-map": "^1.1.0", | ||
"babel-helper-transform-fixture-test-runner": "^6.9.0", | ||
"babel-polyfill": "^6.9.1" | ||
"babel-polyfill": "^6.13.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
91748
2464
Updatedbabel-traverse@^6.13.0
Updatedbabel-types@^6.13.0