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

diffling

Package Overview
Dependencies
Maintainers
0
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

diffling - npm Package Compare versions

Comparing version 1.0.6 to 1.0.7

34

dist/diffling.js

@@ -13,28 +13,26 @@ "use strict";

const changes = (0, diff_1.diffChars)(original, modified);
const computedDiff = {
left: [],
right: [],
};
changes.forEach(({ added, removed, value }) => {
const diffs = { left: [], right: [] };
changes.forEach((change) => {
var _a, _b, _c, _d;
const diffInformation = {};
const { added, removed, value } = change;
const diff = {};
if (added) {
diffInformation.type = 'added';
diffInformation.value = value;
(_a = computedDiff.right) === null || _a === void 0 ? void 0 : _a.push(diffInformation);
diff.type = "added";
diff.value = value;
(_a = diffs.right) === null || _a === void 0 ? void 0 : _a.push(diff);
}
if (removed) {
diffInformation.type = 'removed';
diffInformation.value = value;
(_b = computedDiff.left) === null || _b === void 0 ? void 0 : _b.push(diffInformation);
diff.type = "removed";
diff.value = value;
(_b = diffs.left) === null || _b === void 0 ? void 0 : _b.push(diff);
}
if (!removed && !added) {
diffInformation.type = 'default';
diffInformation.value = value;
(_c = computedDiff.right) === null || _c === void 0 ? void 0 : _c.push(diffInformation);
(_d = computedDiff.left) === null || _d === void 0 ? void 0 : _d.push(diffInformation);
diff.type = "default";
diff.value = value;
(_c = diffs.right) === null || _c === void 0 ? void 0 : _c.push(diff);
(_d = diffs.left) === null || _d === void 0 ? void 0 : _d.push(diff);
}
return diffInformation;
return diff;
});
return computedDiff;
return diffs;
};

@@ -41,0 +39,0 @@ const getChanges = (original, modified) => {

{
"name": "diffling",
"version": "1.0.6",
"version": "1.0.7",
"description": "A versatile diff computation package, supporting various diff methods and line-by-line comparisons.",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

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