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

assetviz

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

assetviz - npm Package Compare versions

Comparing version 0.2.4 to 0.3.0

16

index.js
/*jshint onevar:false*/
var Path = require('path'),
fs = require('fs'),
relationLabelByType = {

@@ -42,5 +41,4 @@ HtmlScript: '<script>',

function hasOutgoingRelationToNonInlineAsset(asset) {
var hasOutgoingRelations = false,
outgoingRelations = asset.outgoingRelations;
for (var i = 0 ; i < outgoingRelations.length ; i +=1 ) {
var outgoingRelations = asset.outgoingRelations;
for (var i = 0 ; i < outgoingRelations.length ; i += 1) {
var outgoingRelation = outgoingRelations[i];

@@ -71,3 +69,3 @@ if (outgoingRelation.to.isLoaded && outgoingRelation.to.url && outgoingRelation.to.isAsset) {

assetGraph.findAssets().forEach(function (asset) {
if (verbose || asset.url ||hasOutgoingRelationToNonInlineAsset(asset)) {
if (verbose || asset.url || hasOutgoingRelationToNonInlineAsset(asset)) {
asset.idx = idx;

@@ -91,3 +89,3 @@ var size = 400;

assetGraph.findRelations().forEach(function (relation) {
assetGraph.findRelations(undefined, true).forEach(function (relation) {
if (verbose || ('idx' in relation.from && 'idx' in relation.to)) {

@@ -148,5 +146,5 @@ var typeString = relationLabelByType[relation.type] || '';

.if(targetFileName !== '-')
.moveAssets({type: 'Html', isInline: false}, function (asset) {
return "file://" + Path.normalize(targetFileName);
})
.moveAssets({type: 'Html', isInline: false}, function () {
return 'file://' + Path.normalize(targetFileName);
})
.writeAssetsToDisc({url: /^file:/})

@@ -153,0 +151,0 @@ .queue(function () {

{
"name": "assetviz",
"version": "0.2.4",
"version": "0.3.0",
"description": "A graph visualization of the assets and their relations in your web app",

@@ -23,8 +23,8 @@ "main": "index.js",

"dependencies": {
"assetgraph": "~1.6.19",
"urltools": "~0.1.0",
"colors": "*",
"optimist": "*"
"assetgraph": "^1.8.0",
"chalk": "0.4.0",
"optimist": "0.6.0",
"urltools": "^0.1.1"
},
"bin": "./bin/assetviz"
}

@@ -15,6 +15,9 @@ /*global d3, assetgraph*/

assetgraph.assets[relation.source].r +
assetgraph.assets[relation.target].r +
assetgraph.assets[relation.source].outgoing * 2 +
relation.type.length * 6;
if (relation.target) {
distance += assetgraph.assets[relation.target].r;
}
relation.distance = distance;

@@ -26,3 +29,3 @@ });

.call(d3.behavior.zoom().on('zoom', function () {
graph.attr("transform", "translate(" + d3.event.translate + ")" + " scale(" + d3.event.scale + ")");
graph.attr('transform', 'translate(' + d3.event.translate + ')' + ' scale(' + d3.event.scale + ')');
}))

@@ -95,10 +98,10 @@ .append('g'),

edges.attr('d', function (d) {
return "M" + d.source.x + "," + d.source.y +
" " + d.target.x + "," + d.target.y;
return 'M' + d.source.x + ',' + d.source.y +
' ' + d.target.x + ',' + d.target.y;
});
nodes.attr("transform", function (d) {
return "translate(" + d.x + "," + d.y + ")";
nodes.attr('transform', function (d) {
return 'translate(' + d.x + ',' + d.y + ')';
});
}).start();
};

Sorry, the diff of this file is not supported yet

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