Socket
Socket
Sign inDemoInstall

rollup-plugin-visualizer

Package Overview
Dependencies
Maintainers
1
Versions
105
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

rollup-plugin-visualizer - npm Package Compare versions

Comparing version 3.0.4 to 3.0.5

4

package.json
{
"name": "rollup-plugin-visualizer",
"version": "3.0.4",
"version": "3.0.5",
"main": "plugin/index.js",

@@ -26,3 +26,3 @@ "author": "Denis Bardadym <bardadymchik@gmail.com>",

"prepare": "yarn run build",
"test": "node build.js --all"
"test": "node build.js --all --e2e"
},

@@ -29,0 +29,0 @@ "dependencies": {

@@ -136,10 +136,16 @@ "use strict";

const removeCommonPrefix = nodeIds => {
const moduleIds = Object.keys(nodeIds);
let commonPrefix = moduleIds[0];
const skipModule = (id, node) => id.startsWith(PLUGIN_PREFIX) || node.isExternal;
for (const moduleId of moduleIds) {
if (!moduleId.startsWith(PLUGIN_PREFIX)) {
for (let i = 0; i < commonPrefix.length && i < moduleId.length; i++) {
if (commonPrefix[i] !== moduleId[i]) {
const removeCommonPrefix = (nodes, nodeIds) => {
let commonPrefix = null;
for (const [id, uid] of Object.entries(nodeIds)) {
const node = nodes[uid];
if (commonPrefix == null) {
commonPrefix = id;
}
if (!skipModule(id, node)) {
for (let i = 0; i < commonPrefix.length && i < id.length; i++) {
if (commonPrefix[i] !== id[i]) {
commonPrefix = commonPrefix.slice(0, i);

@@ -153,8 +159,9 @@ break;

const commonPrefixLength = commonPrefix.length;
for (const moduleId of moduleIds) {
if (!moduleId.startsWith(PLUGIN_PREFIX)) {
const newModuleId = moduleId.slice(commonPrefixLength);
const value = nodeIds[moduleId];
delete nodeIds[moduleId];
nodeIds[newModuleId] = value;
for (const [id, uid] of Object.entries(nodeIds)) {
const node = nodes[uid];
if (!skipModule(id, node)) {
const newId = id.slice(commonPrefixLength);
const value = nodeIds[id];
delete nodeIds[id];
nodeIds[newId] = value;
}

@@ -161,0 +168,0 @@ }

@@ -96,3 +96,3 @@ "use strict";

const { nodes, nodeIds } = mapper;
removeCommonPrefix(nodeIds);
removeCommonPrefix(nodes, nodeIds);

@@ -99,0 +99,0 @@ for (const [id, uid] of Object.entries(nodeIds)) {

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