socket 0.14.110 → 0.14.112

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.
@@ -917,7 +917,7 @@ function emitBanner(name) {
917
917
  logger.logger.error(getAsciiHeader(name))
918
918
  }
919
919
  function getAsciiHeader(command) {
920
- const cliVersion = '0.14.110:bce799e:225683fa:pub' // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION_HASH']".
920
+ const cliVersion = '0.14.112:79a6e07:ff4ba09b:pub' // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION_HASH']".
921
921
  const nodeVersion = process$1.version
922
922
  const apiToken = shadowNpmInject.getDefaultToken()
923
923
  const defaultOrg = shadowNpmInject.getConfigValue('defaultOrg')
@@ -3728,7 +3728,10 @@ const cmdDiffScan = {
3728
3728
 
3729
3729
  const { GITHUB_REF_NAME } = constants
3730
3730
  function formatBranchName(str) {
3731
- return str.replace(/[-_.]+/g, '-').replace(/[^-a-zA-Z0-9]+/g, '') ?? ''
3731
+ return str
3732
+ .replace(/[-_.\\/]+/g, '-')
3733
+ .replace(/[^-a-zA-Z0-9]+/g, '')
3734
+ .replace(/^-+|-+$/g, '')
3732
3735
  }
3733
3736
  function getPkgNameFromPurlObj(purlObj) {
3734
3737
  return `${purlObj.namespace ? `${purlObj.namespace}/` : ''}${purlObj.name}`
@@ -4094,28 +4097,28 @@ async function npmFix(
4094
4097
  firstPatchedVersionIdentifier,
4095
4098
  vulnerableVersionRange
4096
4099
  } of infos) {
4097
- const revertTree = arb.idealTree
4098
- arb.idealTree = null
4099
- // eslint-disable-next-line no-await-in-loop
4100
- await arb.buildIdealTree()
4101
- const node = shadowNpmInject.findPackageNode(
4102
- arb.idealTree,
4103
- name,
4104
- oldVersion
4105
- )
4106
- if (!node) {
4107
- continue
4108
- }
4109
- if (
4110
- !shadowNpmInject.updateNode(node, packument, vulnerableVersionRange)
4111
- ) {
4112
- if (!unavailableSpecs.has(oldSpec)) {
4113
- unavailableSpecs.add(oldSpec)
4114
- spinner?.fail(`No update available for ${oldSpec}`)
4115
- }
4116
- continue
4117
- }
4118
4100
  for (const pkgJsonPath of pkgJsonPaths) {
4101
+ const revertTree = arb.idealTree
4102
+ arb.idealTree = null
4103
+ // eslint-disable-next-line no-await-in-loop
4104
+ await arb.buildIdealTree()
4105
+ const node = shadowNpmInject.findPackageNode(
4106
+ arb.idealTree,
4107
+ name,
4108
+ oldVersion
4109
+ )
4110
+ if (!node) {
4111
+ continue
4112
+ }
4113
+ if (
4114
+ !shadowNpmInject.updateNode(node, packument, vulnerableVersionRange)
4115
+ ) {
4116
+ if (!unavailableSpecs.has(oldSpec)) {
4117
+ unavailableSpecs.add(oldSpec)
4118
+ spinner?.fail(`No update available for ${oldSpec}`)
4119
+ }
4120
+ continue
4121
+ }
4119
4122
  const isWorkspaceRoot =
4120
4123
  pkgJsonPath === pkgEnvDetails.editablePkgJson.filename
4121
4124
  const workspaceName = isWorkspaceRoot
@@ -4509,32 +4512,32 @@ async function pnpmFix(
4509
4512
  firstPatchedVersionIdentifier,
4510
4513
  vulnerableVersionRange
4511
4514
  } of infos) {
4512
- const node = shadowNpmInject.findPackageNode(
4513
- actualTree,
4514
- name,
4515
- oldVersion
4516
- )
4517
- if (!node) {
4518
- continue
4519
- }
4520
- const availableVersions = Object.keys(packument.versions)
4521
- const newVersion = shadowNpmInject.findBestPatchVersion(
4522
- node,
4523
- availableVersions,
4524
- vulnerableVersionRange
4525
- )
4526
- const newVersionPackument = newVersion
4527
- ? packument.versions[newVersion]
4528
- : undefined
4529
- if (!(newVersion && newVersionPackument)) {
4530
- if (!unavailableSpecs.has(oldSpec)) {
4531
- unavailableSpecs.add(oldSpec)
4532
- spinner?.fail(`No update available for ${oldSpec}`)
4533
- }
4534
- continue
4535
- }
4536
4515
  debug.debugLog('pkgJsonPaths', pkgJsonPaths)
4537
4516
  for (const pkgJsonPath of pkgJsonPaths) {
4517
+ const node = shadowNpmInject.findPackageNode(
4518
+ actualTree,
4519
+ name,
4520
+ oldVersion
4521
+ )
4522
+ if (!node) {
4523
+ continue
4524
+ }
4525
+ const availableVersions = Object.keys(packument.versions)
4526
+ const newVersion = shadowNpmInject.findBestPatchVersion(
4527
+ node,
4528
+ availableVersions,
4529
+ vulnerableVersionRange
4530
+ )
4531
+ const newVersionPackument = newVersion
4532
+ ? packument.versions[newVersion]
4533
+ : undefined
4534
+ if (!(newVersion && newVersionPackument)) {
4535
+ if (!unavailableSpecs.has(oldSpec)) {
4536
+ unavailableSpecs.add(oldSpec)
4537
+ spinner?.fail(`No update available for ${oldSpec}`)
4538
+ }
4539
+ continue
4540
+ }
4538
4541
  const isWorkspaceRoot =
4539
4542
  pkgJsonPath === pkgEnvDetails.editablePkgJson.filename
4540
4543
  const workspaceName = isWorkspaceRoot
@@ -12305,7 +12308,7 @@ void (async () => {
12305
12308
  await vendor.updater({
12306
12309
  name: SOCKET_CLI_BIN_NAME,
12307
12310
  // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION']".
12308
- version: '0.14.110',
12311
+ version: '0.14.112',
12309
12312
  ttl: 86_400_000 /* 24 hours in milliseconds */
12310
12313
  })
12311
12314
  try {
@@ -12373,5 +12376,5 @@ void (async () => {
12373
12376
  await shadowNpmInject.captureException(e)
12374
12377
  }
12375
12378
  })()
12376
- //# debugId=32797e31-23f9-493d-96c8-d575d3123a7a
12379
+ //# debugId=16f4376c-2c4a-4fe4-9650-b48c4a2c995e
12377
12380
  //# sourceMappingURL=cli.js.map