socket 0.14.32 → 0.14.33

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -43,7 +43,7 @@ var arborist = {};
43
43
  var ttyServer$1 = {};
44
44
 
45
45
  var name = "socket";
46
- var version = "0.14.32";
46
+ var version = "0.14.33";
47
47
  var description = "CLI tool for Socket.dev";
48
48
  var homepage = "http://github.com/SocketDev/socket-cli";
49
49
  var license = "MIT";
@@ -882,20 +882,16 @@ async function getPackagesAlerts(safeArb, _registry, pkgs, output) {
882
882
  });
883
883
  // Before we ask about problematic issues, check to see if they
884
884
  // already existed in the old version if they did, be quiet.
885
- const pkg = pkgs.find(p => p.pkgid === id && p.existing?.startsWith(`${name}@`));
886
- if (pkg?.existing) {
887
- // const oldArtifact: SocketArtifact =
888
- // // eslint-disable-next-line no-await-in-loop
889
- // (await batchScan([pkg.existing]).next()).value
890
- // console.log('oldArtifact', oldArtifact)
891
- // if (oldArtifact.type === 'success') {
892
- // issues = issues.filter(
893
- // ({ type }) =>
894
- // oldPkgData.value.issues.find(
895
- // oldIssue => oldIssue.type === type
896
- // ) === undefined
897
- // )
898
- // }
885
+ const existing = pkgs.find(p => p.existing?.startsWith(`${name}@`))?.existing;
886
+ if (existing) {
887
+ const oldArtifact =
888
+ // eslint-disable-next-line no-await-in-loop
889
+ (await batchScan([existing]).next()).value;
890
+ if (oldArtifact?.alerts?.length) {
891
+ alerts = alerts.filter(({
892
+ type
893
+ }) => !oldArtifact.alerts?.find(a => a.type === type));
894
+ }
899
895
  }
900
896
  }
901
897
  }
@@ -958,23 +954,31 @@ function walk(diff_, needInfoOn = []) {
958
954
  if (!diff) {
959
955
  continue;
960
956
  }
961
- if (diff.action) {
962
- const sameVersion = diff.actual?.package.version === diff.ideal?.package.version;
957
+ const {
958
+ action
959
+ } = diff;
960
+ if (action) {
961
+ const oldNode = diff.actual;
962
+ const oldPkgid = oldNode?.pkgid;
963
+ const pkgNode = diff.ideal;
964
+ const pkgid = pkgNode?.pkgid;
965
+ let existing;
963
966
  let keep = false;
964
- let existing = null;
965
- if (diff.action === 'CHANGE') {
966
- if (!sameVersion) {
967
- existing = diff.actual.pkgid;
967
+ if (action === 'CHANGE') {
968
+ if (pkgNode?.package.version !== oldNode?.package.version) {
968
969
  keep = true;
970
+ if (oldNode?.package.name && oldNode.package.name === pkgNode?.package.name) {
971
+ existing = oldPkgid;
972
+ }
969
973
  }
970
974
  } else {
971
- keep = diff.action !== 'REMOVE';
975
+ keep = action !== 'REMOVE';
972
976
  }
973
- if (keep && diff.ideal?.pkgid && diff.ideal.resolved && (!diff.actual || diff.actual.resolved)) {
977
+ if (keep && pkgid && pkgNode.resolved && (!oldNode || oldNode.resolved)) {
974
978
  needInfoOn.push({
975
979
  existing,
976
- pkgid: diff.ideal.pkgid,
977
- repository_url: toRepoUrl(diff.ideal.resolved)
980
+ pkgid,
981
+ repository_url: toRepoUrl(pkgNode.resolved)
978
982
  });
979
983
  }
980
984
  }
@@ -42,7 +42,7 @@ var arborist = {};
42
42
  var ttyServer$1 = {};
43
43
 
44
44
  var name = "socket";
45
- var version = "0.14.32";
45
+ var version = "0.14.33";
46
46
  var description = "CLI tool for Socket.dev";
47
47
  var homepage = "http://github.com/SocketDev/socket-cli";
48
48
  var license = "MIT";
@@ -881,20 +881,16 @@ async function getPackagesAlerts(safeArb, _registry, pkgs, output) {
881
881
  });
882
882
  // Before we ask about problematic issues, check to see if they
883
883
  // already existed in the old version if they did, be quiet.
884
- const pkg = pkgs.find(p => p.pkgid === id && p.existing?.startsWith(`${name}@`));
885
- if (pkg?.existing) {
886
- // const oldArtifact: SocketArtifact =
887
- // // eslint-disable-next-line no-await-in-loop
888
- // (await batchScan([pkg.existing]).next()).value
889
- // console.log('oldArtifact', oldArtifact)
890
- // if (oldArtifact.type === 'success') {
891
- // issues = issues.filter(
892
- // ({ type }) =>
893
- // oldPkgData.value.issues.find(
894
- // oldIssue => oldIssue.type === type
895
- // ) === undefined
896
- // )
897
- // }
884
+ const existing = pkgs.find(p => p.existing?.startsWith(`${name}@`))?.existing;
885
+ if (existing) {
886
+ const oldArtifact =
887
+ // eslint-disable-next-line no-await-in-loop
888
+ (await batchScan([existing]).next()).value;
889
+ if (oldArtifact?.alerts?.length) {
890
+ alerts = alerts.filter(({
891
+ type
892
+ }) => !oldArtifact.alerts?.find(a => a.type === type));
893
+ }
898
894
  }
899
895
  }
900
896
  }
@@ -957,23 +953,31 @@ function walk(diff_, needInfoOn = []) {
957
953
  if (!diff) {
958
954
  continue;
959
955
  }
960
- if (diff.action) {
961
- const sameVersion = diff.actual?.package.version === diff.ideal?.package.version;
956
+ const {
957
+ action
958
+ } = diff;
959
+ if (action) {
960
+ const oldNode = diff.actual;
961
+ const oldPkgid = oldNode?.pkgid;
962
+ const pkgNode = diff.ideal;
963
+ const pkgid = pkgNode?.pkgid;
964
+ let existing;
962
965
  let keep = false;
963
- let existing = null;
964
- if (diff.action === 'CHANGE') {
965
- if (!sameVersion) {
966
- existing = diff.actual.pkgid;
966
+ if (action === 'CHANGE') {
967
+ if (pkgNode?.package.version !== oldNode?.package.version) {
967
968
  keep = true;
969
+ if (oldNode?.package.name && oldNode.package.name === pkgNode?.package.name) {
970
+ existing = oldPkgid;
971
+ }
968
972
  }
969
973
  } else {
970
- keep = diff.action !== 'REMOVE';
974
+ keep = action !== 'REMOVE';
971
975
  }
972
- if (keep && diff.ideal?.pkgid && diff.ideal.resolved && (!diff.actual || diff.actual.resolved)) {
976
+ if (keep && pkgid && pkgNode.resolved && (!oldNode || oldNode.resolved)) {
973
977
  needInfoOn.push({
974
978
  existing,
975
- pkgid: diff.ideal.pkgid,
976
- repository_url: toRepoUrl(diff.ideal.resolved)
979
+ pkgid,
980
+ repository_url: toRepoUrl(pkgNode.resolved)
977
981
  });
978
982
  }
979
983
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "socket",
3
- "version": "0.14.32",
3
+ "version": "0.14.33",
4
4
  "description": "CLI tool for Socket.dev",
5
5
  "homepage": "http://github.com/SocketDev/socket-cli",
6
6
  "license": "MIT",