@socketsecurity/cli-with-sentry 0.14.115 → 0.14.117

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.
@@ -627,7 +627,7 @@ async function setupSdk(
627
627
  // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_NAME']".
628
628
  name: '@socketsecurity/cli',
629
629
  // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION']".
630
- version: '0.14.115',
630
+ version: '0.14.117',
631
631
  // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_HOMEPAGE']".
632
632
  homepage: 'https://github.com/SocketDev/socket-cli'
633
633
  })
@@ -663,6 +663,17 @@ function applyRange(refRange, version, style = 'preserve') {
663
663
  return version
664
664
  }
665
665
  }
666
+ function getMajor(version) {
667
+ const coerced = vendor.semverExports.coerce(version)
668
+ if (coerced) {
669
+ try {
670
+ return vendor.semverExports.major(coerced)
671
+ } catch (e) {
672
+ debug.debugLog(`Error parsing '${version}'`, e)
673
+ }
674
+ }
675
+ return null
676
+ }
666
677
 
667
678
  const DiffAction = /*#__PURE__*/ (function (DiffAction) {
668
679
  DiffAction['add'] = 'ADD'
@@ -1428,22 +1439,28 @@ function findBestPatchVersion(
1428
1439
  const manifestData = registry.getManifestData(NPM$2, node.name)
1429
1440
  let eligibleVersions
1430
1441
  if (manifestData && manifestData.name === manifestData.package) {
1431
- const major = vendor.semverExports.major(manifestData.version)
1432
- eligibleVersions = availableVersions.filter(
1433
- v => vendor.semverExports.major(v) === major
1434
- )
1442
+ const major = getMajor(manifestData.version)
1443
+ if (typeof major !== 'number') {
1444
+ return null
1445
+ }
1446
+ eligibleVersions = availableVersions.filter(v => getMajor(v) === major)
1435
1447
  } else {
1436
- const major = vendor.semverExports.major(node.version)
1448
+ const major = getMajor(node.version)
1449
+ if (typeof major !== 'number') {
1450
+ return null
1451
+ }
1437
1452
  eligibleVersions = availableVersions.filter(
1438
1453
  v =>
1439
1454
  // Filter for versions that are within the current major version and
1440
1455
  // are NOT in the vulnerable range.
1441
- vendor.semverExports.major(v) === major &&
1456
+ getMajor(v) === major &&
1442
1457
  (!vulnerableVersionRange ||
1443
1458
  !vendor.semverExports.satisfies(v, vulnerableVersionRange))
1444
1459
  )
1445
1460
  }
1446
- return vendor.semverExports.maxSatisfying(eligibleVersions, '*')
1461
+ return eligibleVersions
1462
+ ? vendor.semverExports.maxSatisfying(eligibleVersions, '*')
1463
+ : null
1447
1464
  }
1448
1465
  function findPackageNode(tree, name, version) {
1449
1466
  const queue = [tree]
@@ -2595,5 +2612,5 @@ exports.supportedConfigKeys = supportedConfigKeys
2595
2612
  exports.updateConfigValue = updateConfigValue
2596
2613
  exports.updateNode = updateNode
2597
2614
  exports.updatePackageJsonFromNode = updatePackageJsonFromNode
2598
- //# debugId=c60480dd-5d67-4120-8205-1ffbb6b16f91
2615
+ //# debugId=c33a5f3f-cb68-45a8-970f-41e2f2463ce9
2599
2616
  //# sourceMappingURL=shadow-npm-inject.js.map