regenerator-transform
Advanced tools
Comparing version 0.10.0 to 0.10.1
@@ -5,4 +5,19 @@ "use strict"; | ||
exports.default = function () { | ||
return require("./visit"); | ||
exports.default = function (context) { | ||
var plugin = { | ||
visitor: require("./visit").visitor | ||
}; | ||
// Some presets manually call child presets, but fail to pass along the | ||
// context object. Out of an abundance of caution, we verify that it | ||
// exists first to avoid causing unnecessary breaking changes. | ||
var version = context && context.version; | ||
// The "name" property is not allowed in older versions of Babel (6.x) | ||
// and will cause the plugin validator to throw an exception. | ||
if (version && parseInt(version, 10) >= 7) { | ||
plugin.name = "regenerator-transform"; | ||
} | ||
return plugin; | ||
}; |
@@ -37,4 +37,2 @@ /** | ||
exports.name = "regenerator-transform"; | ||
exports.visitor = { | ||
@@ -41,0 +39,0 @@ Function: { |
@@ -5,3 +5,3 @@ { | ||
"description": "Explode async and generator functions into a state machine.", | ||
"version": "0.10.0", | ||
"version": "0.10.1", | ||
"main": "lib/index.js", | ||
@@ -8,0 +8,0 @@ "keywords": [ |
@@ -11,4 +11,19 @@ /** | ||
export default function () { | ||
return require("./visit"); | ||
export default function (context) { | ||
const plugin = { | ||
visitor: require("./visit").visitor, | ||
}; | ||
// Some presets manually call child presets, but fail to pass along the | ||
// context object. Out of an abundance of caution, we verify that it | ||
// exists first to avoid causing unnecessary breaking changes. | ||
const version = context && context.version; | ||
// The "name" property is not allowed in older versions of Babel (6.x) | ||
// and will cause the plugin validator to throw an exception. | ||
if (version && parseInt(version, 10) >= 7) { | ||
plugin.name = "regenerator-transform"; | ||
} | ||
return plugin; | ||
} |
@@ -20,4 +20,2 @@ /** | ||
exports.name = "regenerator-transform"; | ||
exports.visitor = { | ||
@@ -24,0 +22,0 @@ Function: { |
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
119736
3125