babel-plugin-empower-assert
Advanced tools
Comparing version 1.1.0 to 1.2.0
@@ -0,1 +1,9 @@ | ||
## [1.2.0](https://github.com/twada/babel-plugin-empower-assert/releases/tag/v1.2.0) (2016-04-12) | ||
#### Features | ||
* support ImportDeclaration ([a8c5326f](https://github.com/twada/babel-plugin-empower-assert/commit/a8c5326f098d49d25517995346b8818b72348046)) | ||
## [1.1.0](https://github.com/twada/babel-plugin-empower-assert/releases/tag/v1.1.0) (2016-04-12) | ||
@@ -2,0 +10,0 @@ |
17
index.js
@@ -58,2 +58,19 @@ /** | ||
} | ||
}, | ||
ImportDeclaration: { | ||
enter: function (nodePath, pluginPass) { | ||
var source = nodePath.get('source'); | ||
if (!(source.equals('value', 'assert'))) { | ||
return; | ||
} | ||
var firstSpecifier = nodePath.get('specifiers')[0]; | ||
if (!firstSpecifier.isImportDefaultSpecifier()) { | ||
return; | ||
} | ||
var local = firstSpecifier.get('local'); | ||
if (!(local.equals('name', 'assert'))) { | ||
return; | ||
} | ||
source.set('value', 'power-assert'); | ||
} | ||
} | ||
@@ -60,0 +77,0 @@ } |
{ | ||
"name": "babel-plugin-empower-assert", | ||
"description": "Babel plugin to convert assert to power-assert at compile time", | ||
"version": "1.1.0", | ||
"version": "1.2.0", | ||
"author": { | ||
@@ -6,0 +6,0 @@ "name": "Takuto Wada", |
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
7495
83