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

@hyrious/dup

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@hyrious/dup - npm Package Compare versions

Comparing version 0.1.4 to 0.1.5

7

dist/dup.js

@@ -17,2 +17,3 @@ // src/dup.ts

function dup_packages(p) {
const isNPM = !!p[""];
const collected = [];

@@ -22,3 +23,3 @@ for (const key in p) {

let ver;
if (key.startsWith("node_modules/")) {
if (isNPM && key) {
const parts = key.split("/").slice(-2);

@@ -28,5 +29,7 @@ if (parts[0][0] === "@") {

} else {
pkg = parts[1];
pkg = parts.pop();
}
ver = p[key].version;
if (ver == null)
continue;
collected.push([pkg, ver]);

@@ -33,0 +36,0 @@ } else if (key) {

{
"name": "@hyrious/dup",
"type": "module",
"version": "0.1.4",
"version": "0.1.5",
"description": "Find duplicates in your lockfile",

@@ -6,0 +6,0 @@ "author": "hyrious <hyrious@outlook.com>",

@@ -38,2 +38,3 @@ /**

function dup_packages(p: { readonly [key: string]: unknown }) {
const isNPM = !!p[""];
const collected: [pkg: string, ver: string][] = [];

@@ -45,3 +46,3 @@ for (const key in p) {

// NPM: "node_modules/path/to/{package-name}": { "version": {version} }
if (key.startsWith("node_modules/")) {
if (isNPM && key) {
const parts = key.split("/").slice(-2);

@@ -51,5 +52,6 @@ if (parts[0][0] === "@") {

} else {
pkg = parts[1];
pkg = parts.pop()!;
}
ver = (p[key] as { version: string }).version;
if (ver == null) continue;
collected.push([pkg, ver]);

@@ -56,0 +58,0 @@ }

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