Socket
Socket
Sign inDemoInstall

babel-core

Package Overview
Dependencies
Maintainers
6
Versions
257
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-core - npm Package Compare versions

Comparing version 6.11.4 to 6.13.0

38

lib/transformation/file/options/option-manager.js

@@ -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"
}
}
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc