jstransform
Advanced tools
Comparing version 6.0.0 to 6.0.1
{ | ||
"name": "jstransform", | ||
"version": "6.0.0", | ||
"version": "6.0.1", | ||
"description": "A simple AST visitor-based JS transformer", | ||
@@ -24,3 +24,3 @@ "contributors": [ | ||
"base62": "0.1.1", | ||
"esprima-fb": "~4001.1001.0-dev-harmony-fb", | ||
"esprima-fb": "~4001.3001.0-dev-harmony-fb", | ||
"source-map": "0.1.31" | ||
@@ -27,0 +27,0 @@ }, |
@@ -21,2 +21,3 @@ /** | ||
var leadingIndentRegexp = /(^|\n)( {2}|\t)/g; | ||
var nonWhiteRegexp = /(\S)/g; | ||
@@ -262,13 +263,21 @@ /** | ||
function replaceNonWhite(value) { | ||
return value.replace(nonWhiteRegexp, ' '); | ||
} | ||
/** | ||
* Removes all non-whitespace characters | ||
*/ | ||
var reNonWhite = /(\S)/g; | ||
function stripNonWhite(value) { | ||
return value.replace(reNonWhite, function() { | ||
return ''; | ||
}); | ||
return value.replace(nonWhiteRegexp, ''); | ||
} | ||
/** | ||
* Catches up as `catchup` but replaces non-whitespace chars with spaces. | ||
*/ | ||
function catchupWhiteOut(end, state) { | ||
catchup(end, state, replaceNonWhite); | ||
} | ||
/** | ||
* Catches up as `catchup` but removes all non-whitespace characters. | ||
@@ -579,2 +588,3 @@ */ | ||
exports.catchup = catchup; | ||
exports.catchupWhiteOut = catchupWhiteOut; | ||
exports.catchupWhiteSpace = catchupWhiteSpace; | ||
@@ -581,0 +591,0 @@ exports.catchupNewlines = catchupNewlines; |
@@ -203,5 +203,7 @@ /** | ||
utils.move(methodNode.key.range[1], state); | ||
utils.append('(', state); | ||
var params = node.params; | ||
if (params.length > 0) { | ||
utils.move(params[0].range[0], state); | ||
for (var i = 0; i < params.length; i++) { | ||
@@ -213,4 +215,2 @@ utils.catchup(node.params[i].range[0], state); | ||
} | ||
} else { | ||
utils.append('(', state); | ||
} | ||
@@ -217,0 +217,0 @@ utils.append(')', state); |
@@ -45,2 +45,9 @@ /** | ||
function visitFunctionParamsWithRestParam(traverse, node, path, state) { | ||
if (node.parametricType) { | ||
utils.catchup(node.parametricType.range[0], state); | ||
path.unshift(node); | ||
traverse(node.parametricType, path, state); | ||
path.shift(); | ||
} | ||
// Render params. | ||
@@ -47,0 +54,0 @@ if (node.params.length) { |
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
167641
4674
84
+ Addedesprima-fb@4001.3001.0-dev-harmony-fb(transitive)
- Removedesprima-fb@4001.1001.0-dev-harmony-fb(transitive)