babel-plugin-functional-composition
Advanced tools
Comparing version 1.0.0 to 1.0.1
@@ -0,1 +1,10 @@ | ||
# v1.0.1 (2016-09-09) | ||
--- | ||
## Bug Fixes | ||
- fix(babel-plugin-functional-composition): only add imports when a directive is present in a file [36261afa](https://github.com/TylorS/babel-plugin-functional-composition/commits/36261afae7ee057d8df64867db147801c2290305) | ||
# v1.0.0 (2016-09-09) | ||
@@ -2,0 +11,0 @@ --- |
15
index.js
@@ -19,2 +19,4 @@ const DIRECTIVE = 'use fc' | ||
let _hasDirective = false | ||
const visitor = { | ||
@@ -24,4 +26,6 @@ Program: { | ||
exit (path, { opts }) { | ||
const { name = 'pipe', as = 'pipe', from } = opts | ||
if (!_hasDirective) return | ||
const { name = 'pipe', as = 'pipe', from } = opts || {} | ||
if (!from) return | ||
@@ -38,4 +42,6 @@ | ||
exit (path, { opts }) { | ||
const { as = 'pipe' } = opts | ||
if (!hasDirective(path)) return | ||
const { as = 'pipe' } = opts || {} | ||
if (isPipeCall(as, path.node)) { | ||
@@ -56,4 +62,7 @@ const [left, right] = path.node.arguments | ||
if (!hasDirective(path)) return | ||
const { as = 'pipe' } = opts | ||
_hasDirective = true | ||
const { as = 'pipe' } = opts || {} | ||
if (isPipe(path)) { | ||
@@ -60,0 +69,0 @@ const [left, right] = side(path) |
{ | ||
"name": "babel-plugin-functional-composition", | ||
"version": "1.0.0", | ||
"version": "1.0.1", | ||
"description": "Functional Composition for JavaScript", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
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
14097
267