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

jscmp

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jscmp - npm Package Compare versions

Comparing version 0.0.5 to 0.0.6

2

package.json
{
"name": "jscmp",
"version": "0.0.5",
"version": "0.0.6",
"description": "Compare two JSON/JS files to find the diff between their exported objects",

@@ -5,0 +5,0 @@ "author": "Ayush Gupta <AyushG3112@gmail.com>",

@@ -17,4 +17,8 @@ class DefaultHandler {

case "missing":
let missingIn = "fileA";
if (item.typeB === "undefined") {
missingIn = "fileB";
}
console.log(
`Field: ${item.field} missing.\nType in fileA: ${item.typeA}.\nType in fileB: ${item.typeB}.\n`
`Field: ${item.field} missing in ${missingIn}.`
);

@@ -24,3 +28,3 @@ break;

console.log(
`Field: ${item.field} has different types in both files.\nType in fileA: ${item.typeA}.\nType in fileB: ${item.typeB}.\n`
`\nField: ${item.field} has different types in both files.\nType in fileA: ${item.typeA}.\nType in fileB: ${item.typeB}.\n`
);

@@ -27,0 +31,0 @@ break;

@@ -11,3 +11,3 @@ import { getArrayDiff, getArrayIntersection, getType } from "../utils";

const keysB = Object.keys(dataB);
const common = getArrayIntersection(keysA, keysB)
const common = getArrayIntersection(keysA, keysB);
const aDiff = getArrayDiff(keysA, keysB);

@@ -36,6 +36,4 @@ const bDiff = getArrayDiff(keysB, keysA);

for (let key of common) {
if (
getType(dataA[key]) !==
getType(dataB[key])
) {
console.log(key);
if (getType(dataA[key]) !== getType(dataB[key])) {
outputArray.push({

@@ -49,5 +47,3 @@ type: "typeMismatch",

});
} else if (
getType(dataA[key]) == "[object Object]"
) {
} else if (getType(dataA[key]) == "object") {
comparer(

@@ -54,0 +50,0 @@ { fileA, dataA: dataA[key] },

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