New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

assetgraph

Package Overview
Dependencies
Maintainers
1
Versions
569
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

assetgraph - npm Package Compare versions

Comparing version 0.3.19 to 0.3.21

test/JavaScript/relationsDepthFirst/bar.js

12

lib/assets/JavaScript.js

@@ -88,13 +88,11 @@ var util = require('util'),

this.parseTree[1]._parent = this.parseTree;
var queue = [this.parseTree[1]],
queueIndex = 0;
var stack = [this.parseTree[1]];
while (queueIndex < queue.length) {
var node = queue[queueIndex];
queueIndex += 1;
while (stack.length) {
var node = stack.pop();
for (var i = 0 ; i < node.length ; i++) {
for (var i = node.length - 1 ; i >= 0 ; i--) {
if (Array.isArray(node[i])) {
node[i]._parent = node;
queue.push(node[i]);
stack.push(node[i]);
}

@@ -101,0 +99,0 @@ }

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

"repository": "git://github.com/One-com/assetgraph.git",
"version": "0.3.19",
"version": "0.3.21",
"maintainers": [

@@ -8,0 +8,0 @@ {

var vows = require('vows'),
assert = require('assert'),
_ = require('underscore'),
AssetGraph = require('../lib/AssetGraph'),

@@ -9,3 +10,3 @@ transforms = AssetGraph.transforms;

topic: function () {
var assetGraph = new AssetGraph({root: __dirname + '/JavaScript/'}).queue(
new AssetGraph({root: __dirname + '/JavaScript/'}).queue(
transforms.loadAssets('parseErrorInInlineJavaScript.html')

@@ -38,3 +39,19 @@ ).run(this.callback);

}
},
'after loading test case with relations located at multiple levels in the parse tree': {
topic: function () {
new AssetGraph({root: __dirname + '/JavaScript/relationsDepthFirst/'}).queue(
transforms.loadAssets('relationsDepthFirst.js'),
transforms.populate()
).run(this.callback);
},
'the relations should be in depth-first order in the graph': function (assetGraph) {
assert.deepEqual(_.pluck(assetGraph.findRelations(), 'href'),
[
'foo.js',
'data.json',
'bar.js'
]);
}
}
})['export'](module);
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