jsx-transform
Advanced tools
Comparing version 2.4.0 to 2.4.1
@@ -167,9 +167,17 @@ /*! | ||
return function (filename) { | ||
return through(function (buf, enc, next) { | ||
if (!~options.extensions.indexOf(getExtension(filename))) { | ||
// We don't need to apply any transforms, just provide a simple pass-through stream | ||
return through(); | ||
} | ||
var data = ""; | ||
return through(function (chunk, enc, next) { | ||
// This function receives chunks of data and we don't want to perform any transforms on an incomplete file. | ||
// We buffer the data until the flush function is called. We can then safely perform the transforms on the full file. | ||
data += chunk.toString('utf8'); | ||
next(); | ||
}, function (next) { | ||
try { | ||
if (~options.extensions.indexOf(getExtension(filename))) { | ||
this.push(fromString(buf.toString('utf8'), options)); | ||
} else { | ||
this.push(buf.toString()); | ||
} | ||
this.push(fromString(data, options)); | ||
next(); | ||
@@ -176,0 +184,0 @@ } catch (err) { |
@@ -1,3 +0,3 @@ | ||
var Syntax = require('esprima-fb').Syntax; | ||
var utils = require('jstransform/src/utils'); | ||
var Syntax = require('jstransform').Syntax; | ||
@@ -4,0 +4,0 @@ module.exports = visitNode; |
{ | ||
"name": "jsx-transform", | ||
"version": "2.4.0", | ||
"version": "2.4.1", | ||
"description": "JSX transpiler. Desugar JSX into JavaScript. A standard and configurable implementation of JSX decoupled from React.", | ||
@@ -11,3 +11,3 @@ "files": [ | ||
"scripts": { | ||
"test": "mocha test" | ||
"test": "gulp test" | ||
}, | ||
@@ -35,3 +35,3 @@ "repository": { | ||
"esprima-fb": "^15001.1001.0-dev-harmony-fb", | ||
"jstransform": "^11.0.0", | ||
"jstransform": "^11.0.3", | ||
"through2": "^2.0.0" | ||
@@ -38,0 +38,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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
23671
514
0
Updatedjstransform@^11.0.3