Socket
Socket
Sign inDemoInstall

jstransform

Package Overview
Dependencies
Maintainers
2
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jstransform - npm Package Compare versions

Comparing version 6.0.0 to 6.0.1

4

package.json
{
"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) {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc