Socket
Socket
Sign inDemoInstall

jscs

Package Overview
Dependencies
195
Maintainers
1
Versions
95
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.0.1 to 0.0.2

4

lib/js-file.js

@@ -10,6 +10,8 @@ var treeIterator = require('./tree-iterator');

var index = this._index = {};
this.iterate(function(node) {
this.iterate(function(node, parentNode, parentCollection) {
if (node) {
var type = node.type;
if (type) {
node.parentNode = parentNode;
node.parentCollection = parentCollection;
(index[type] || (index[type] = [])).push(node);

@@ -16,0 +18,0 @@ }

@@ -34,3 +34,3 @@ var assert = require('assert');

) {
errors.add('Implicit binary conversion', node.loc.start);
errors.add('Implicit boolean conversion', node.loc.start);
}

@@ -37,0 +37,0 @@ });

@@ -53,12 +53,16 @@ module.exports = {

function iterate(node, cb) {
var nodesToIterate = [node];
var currentNode;
while (!!(currentNode = nodesToIterate.shift())) {
cb(currentNode);
for (var i in currentNode) {
if (iterableProperties[i]) {
var contents = currentNode[i];
function iterate(node, cb, parentNode, parentCollection) {
cb(node, parentNode, parentCollection);
for (var propName in node) {
if (node.hasOwnProperty(propName)) {
if (iterableProperties[propName]) {
var contents = node[propName];
if (typeof contents === 'object') {
nodesToIterate = nodesToIterate.concat(contents);
if (Array.isArray(contents)) {
for (var i = 0, l = contents.length; i < l; i++) {
iterate(contents[i], cb, node, contents);
}
} else {
iterate(contents, cb, node, [ contents ]);
}
}

@@ -65,0 +69,0 @@ }

@@ -5,3 +5,3 @@ {

"name" : "jscs",
"version" : "0.0.1",
"version" : "0.0.2",
"repository" : "https://github.com/mdevils/jscs",

@@ -8,0 +8,0 @@ "contributors" : [

@@ -31,3 +31,3 @@ node-jscs

```
```javascript
{

@@ -34,0 +34,0 @@ /*

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc