@socketsecurity/cli-with-sentry 0.14.134 → 0.14.136

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.
@@ -30,7 +30,7 @@ const relConstantsPath = './constants'
30
30
  Sentry.setTag(
31
31
  'version',
32
32
  // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION_HASH']".
33
- '0.14.134:c664da6:7e80f505:pub'
33
+ '0.14.136:113c579:70b9ca75:pub'
34
34
  )
35
35
  const constants = require(relConstantsPath)
36
36
  if (constants.ENV.SOCKET_CLI_DEBUG) {
@@ -45,5 +45,5 @@ const relConstantsPath = './constants'
45
45
  } = constants
46
46
  setSentry(Sentry)
47
47
  }
48
- //# debugId=f4ea1bb5-ee15-4115-b62f-342021fa364a
48
+ //# debugId=539c1f71-3119-4172-9a80-62d22fb2c66f
49
49
  //# sourceMappingURL=instrument-with-sentry.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"instrument-with-sentry.js","sources":["../src/instrument-with-sentry.ts"],"sourcesContent":["// This should ONLY be included in the special Sentry build!\n// Otherwise the Sentry dependency won't even be present in the manifest.\n\nimport { logger } from '@socketsecurity/registry/lib/logger'\n\n// Require constants with require(relConstantsPath) instead of require('./constants')\n// so Rollup doesn't generate a constants2.js chunk.\nconst relConstantsPath = './constants'\n// The '@rollup/plugin-replace' will replace \"process.env['INLINED_SOCKET_CLI_SENTRY_BUILD']\".\nif (process.env['INLINED_SOCKET_CLI_SENTRY_BUILD']) {\n const Sentry = require('@sentry/node')\n Sentry.init({\n onFatalError(error: Error) {\n // Defer module loads until after Sentry.init is called.\n if (require(relConstantsPath).ENV.SOCKET_CLI_DEBUG) {\n logger.fail('[DEBUG] [Sentry onFatalError]:', error)\n }\n },\n dsn: 'https://66736701db8e4ffac046bd09fa6aaced@o555220.ingest.us.sentry.io/4508846967619585',\n enabled: true,\n integrations: []\n })\n Sentry.setTag(\n 'environment',\n // The '@rollup/plugin-replace' will replace \"process.env['INLINED_SOCKET_CLI_PUBLISHED_BUILD']\".\n process.env['INLINED_SOCKET_CLI_PUBLISHED_BUILD']\n ? 'pub'\n : // The NODE_ENV convention is used by apps to define the runtime environment.\n // https://nodejs.org/en/learn/getting-started/nodejs-the-difference-between-development-and-production\n process.env['NODE_ENV']\n )\n Sentry.setTag(\n 'version',\n // The '@rollup/plugin-replace' will replace \"process.env['INLINED_SOCKET_CLI_VERSION_HASH']\".\n process.env['INLINED_SOCKET_CLI_VERSION_HASH']\n )\n const constants = require(relConstantsPath)\n if (constants.ENV.SOCKET_CLI_DEBUG) {\n Sentry.setTag('debugging', true)\n logger.log('[DEBUG] Set up Sentry.')\n } else {\n Sentry.setTag('debugging', false)\n }\n const {\n kInternalsSymbol,\n [kInternalsSymbol as unknown as 'Symbol(kInternalsSymbol)']: { setSentry }\n } = constants\n setSentry(Sentry)\n} else if (require(relConstantsPath).ENV.SOCKET_CLI_DEBUG) {\n logger.log('[DEBUG] Sentry disabled explicitly.')\n}\n"],"names":["logger","dsn","enabled","integrations","process","Sentry","setSentry"],"mappings":";;;;AAAA;AACA;;;AAIA;AACA;AACA;AACA;AACoD;AAClD;;;AAGI;;AAEEA;AACF;;AAEFC;AACAC;AACAC;AACF;;AAGE;AACAC;;AAQA;AACAA;AAEF;AACA;AACEC;AACAL;AACF;AACEK;AACF;;;AAGE;AAA+DC;AAAU;AAC3E;;AAEF","debugId":"f4ea1bb5-ee15-4115-b62f-342021fa364a"}
1
+ {"version":3,"file":"instrument-with-sentry.js","sources":["../src/instrument-with-sentry.ts"],"sourcesContent":["// This should ONLY be included in the special Sentry build!\n// Otherwise the Sentry dependency won't even be present in the manifest.\n\nimport { logger } from '@socketsecurity/registry/lib/logger'\n\n// Require constants with require(relConstantsPath) instead of require('./constants')\n// so Rollup doesn't generate a constants2.js chunk.\nconst relConstantsPath = './constants'\n// The '@rollup/plugin-replace' will replace \"process.env['INLINED_SOCKET_CLI_SENTRY_BUILD']\".\nif (process.env['INLINED_SOCKET_CLI_SENTRY_BUILD']) {\n const Sentry = require('@sentry/node')\n Sentry.init({\n onFatalError(error: Error) {\n // Defer module loads until after Sentry.init is called.\n if (require(relConstantsPath).ENV.SOCKET_CLI_DEBUG) {\n logger.fail('[DEBUG] [Sentry onFatalError]:', error)\n }\n },\n dsn: 'https://66736701db8e4ffac046bd09fa6aaced@o555220.ingest.us.sentry.io/4508846967619585',\n enabled: true,\n integrations: []\n })\n Sentry.setTag(\n 'environment',\n // The '@rollup/plugin-replace' will replace \"process.env['INLINED_SOCKET_CLI_PUBLISHED_BUILD']\".\n process.env['INLINED_SOCKET_CLI_PUBLISHED_BUILD']\n ? 'pub'\n : // The NODE_ENV convention is used by apps to define the runtime environment.\n // https://nodejs.org/en/learn/getting-started/nodejs-the-difference-between-development-and-production\n process.env['NODE_ENV']\n )\n Sentry.setTag(\n 'version',\n // The '@rollup/plugin-replace' will replace \"process.env['INLINED_SOCKET_CLI_VERSION_HASH']\".\n process.env['INLINED_SOCKET_CLI_VERSION_HASH']\n )\n const constants = require(relConstantsPath)\n if (constants.ENV.SOCKET_CLI_DEBUG) {\n Sentry.setTag('debugging', true)\n logger.log('[DEBUG] Set up Sentry.')\n } else {\n Sentry.setTag('debugging', false)\n }\n const {\n kInternalsSymbol,\n [kInternalsSymbol as unknown as 'Symbol(kInternalsSymbol)']: { setSentry }\n } = constants\n setSentry(Sentry)\n} else if (require(relConstantsPath).ENV.SOCKET_CLI_DEBUG) {\n logger.log('[DEBUG] Sentry disabled explicitly.')\n}\n"],"names":["logger","dsn","enabled","integrations","process","Sentry","setSentry"],"mappings":";;;;AAAA;AACA;;;AAIA;AACA;AACA;AACA;AACoD;AAClD;;;AAGI;;AAEEA;AACF;;AAEFC;AACAC;AACAC;AACF;;AAGE;AACAC;;AAQA;AACAA;AAEF;AACA;AACEC;AACAL;AACF;AACEK;AACF;;;AAGE;AAA+DC;AAAU;AAC3E;;AAEF","debugId":"539c1f71-3119-4172-9a80-62d22fb2c66f"}
@@ -8,57 +8,6 @@ const path = require('node:path')
8
8
  const vendor = require('./vendor.js')
9
9
  const shadowNpmPaths = require('./shadow-npm-paths.js')
10
10
  const constants = require('./constants.js')
11
- require('node:fs')
12
- require('node:os')
13
- require('node:fs/promises')
14
- require('node:buffer')
15
- require('node:util')
16
- require('node:path')
17
- require('node:fs')
18
- require('node:tty')
19
- require('node:https')
20
- require('node:http')
21
- require('node:url')
22
- require('node:process')
23
- require('node:events')
24
- require('node:http')
25
- require('node:https')
26
- require('node:readline')
27
- require('@socketsecurity/registry/lib/constants/abort-signal')
28
- require('node:util')
29
- require('node:url')
30
- require('node:fs/promises')
31
- require('node:child_process')
32
- require('node:os')
33
- require('node:tty')
34
- require('node:crypto')
35
- require('node:constants')
36
- require('node:stream')
37
- require('node:assert')
38
- require('node:stream')
39
- require('node:string_decoder')
40
- require('node:path/win32')
41
- require('node:module')
42
- require('node:events')
43
- require('node:buffer')
44
- require('node:string_decoder')
45
- require('node:child_process')
46
- require('node:module')
47
- require('@socketsecurity/registry/lib/logger')
48
- require('@socketsecurity/registry/lib/path')
49
- require('@socketsecurity/registry/lib/words')
50
- require('./shadow-npm-inject.js')
51
- require('@socketsecurity/registry/lib/arrays')
52
- require('@socketsecurity/registry')
53
- require('@socketsecurity/registry/lib/objects')
54
- require('@socketsecurity/registry/lib/constants')
55
- require('@socketsecurity/registry/lib/prompts')
56
- require('@socketsecurity/registry/lib/strings')
57
- require('@socketsecurity/registry/lib/fs')
58
- require('@socketsecurity/registry/lib/packages')
59
- require('node:timers/promises')
60
- require('@socketsecurity/registry/lib/sorts')
61
- require('@socketsecurity/registry/lib/env')
62
11
 
63
12
  const { CLI, NPX } = constants
64
13
  async function installLinks(realBinPath, binName) {
@@ -157,5 +106,5 @@ async function shadowBin(binName, args = process.argv.slice(2)) {
157
106
  }
158
107
 
159
108
  module.exports = shadowBin
160
- //# debugId=61305e42-84d7-4c37-8d89-64d659ab9d56
109
+ //# debugId=a3ff14de-2729-4213-91d1-6f1ab7249f1d
161
110
  //# sourceMappingURL=shadow-bin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"shadow-bin.js","sources":["../src/shadow/npm/link.ts","../src/shadow/npm/bin.ts"],"sourcesContent":["import path from 'node:path'\nimport process from 'node:process'\n\nimport cmdShim from 'cmd-shim'\n\nimport {\n getNpmBinPath,\n getNpxBinPath,\n isNpmBinPathShadowed,\n isNpxBinPathShadowed\n} from './paths'\nimport constants from '../../constants'\n\nconst { CLI, NPX } = constants\n\nexport async function installLinks(\n realBinPath: string,\n binName: 'npm' | 'npx'\n): Promise<string> {\n const isNpx = binName === NPX\n // Find package manager being shadowed by this process.\n const binPath = isNpx ? getNpxBinPath() : getNpmBinPath()\n // Lazily access constants.WIN32.\n const { WIN32 } = constants\n // TODO: Is this early exit needed?\n if (WIN32 && binPath) {\n return binPath\n }\n const shadowed = isNpx ? isNpxBinPathShadowed() : isNpmBinPathShadowed()\n // Move our bin directory to front of PATH so its found first.\n if (!shadowed) {\n if (WIN32) {\n await cmdShim(\n // Lazily access constants.rootDistPath.\n path.join(constants.rootDistPath, `${binName}-${CLI}.js`),\n path.join(realBinPath, binName)\n )\n }\n const { env } = process\n env['PATH'] = `${realBinPath}${path.delimiter}${env['PATH']}`\n }\n return binPath\n}\n","import process from 'node:process'\n\nimport { isDebug } from '@socketsecurity/registry/lib/debug'\nimport {\n isLoglevelFlag,\n isProgressFlag\n} from '@socketsecurity/registry/lib/npm'\nimport { spawn } from '@socketsecurity/registry/lib/spawn'\n\nimport { installLinks } from './link'\nimport constants from '../../constants'\n\nconst { SOCKET_CLI_SAFE_BIN, SOCKET_CLI_SAFE_PROGRESS, SOCKET_IPC_HANDSHAKE } =\n constants\n\nexport default async function shadowBin(\n binName: 'npm' | 'npx',\n args = process.argv.slice(2)\n) {\n process.exitCode = 1\n const useDebug = isDebug()\n const terminatorPos = args.indexOf('--')\n const rawBinArgs = terminatorPos === -1 ? args : args.slice(0, terminatorPos)\n const progressArg = rawBinArgs.findLast(isProgressFlag) !== '--no-progress'\n const binArgs = rawBinArgs.filter(a => !isProgressFlag(a))\n const otherArgs = terminatorPos === -1 ? [] : args.slice(terminatorPos)\n const isSilent = !useDebug && !binArgs.some(isLoglevelFlag)\n // The default value of loglevel is \"notice\". We default to \"error\" which is\n // two levels quieter.\n const logLevelArgs = isSilent ? ['--loglevel', 'error'] : []\n const spawnPromise = spawn(\n // Lazily access constants.execPath.\n constants.execPath,\n [\n // Lazily access constants.nodeHardenFlags.\n ...constants.nodeHardenFlags,\n // Lazily access constants.nodeNoWarningsFlags.\n ...constants.nodeNoWarningsFlags,\n // Lazily access process.env['INLINED_SOCKET_CLI_SENTRY_BUILD'].\n ...(process.env['INLINED_SOCKET_CLI_SENTRY_BUILD']\n ? [\n '--require',\n // Lazily access constants.distInstrumentWithSentryPath.\n constants.distInstrumentWithSentryPath\n ]\n : []),\n '--require',\n // Lazily access constants.distShadowNpmInjectPath.\n constants.distShadowNpmInjectPath,\n // Lazily access constants.shadowBinPath.\n await installLinks(constants.shadowBinPath, binName),\n // Add '--no-progress' to fix input being swallowed by the npm spinner.\n '--no-progress',\n // Add '--loglevel=error' if a loglevel flag is not provided and the\n // SOCKET_CLI_DEBUG environment variable is not truthy.\n ...logLevelArgs,\n ...binArgs,\n ...otherArgs\n ],\n {\n // 'inherit' + 'ipc'\n stdio: [0, 1, 2, 'ipc']\n }\n )\n // See https://nodejs.org/api/all.html#all_child_process_event-exit.\n spawnPromise.process.on('exit', (code, signalName) => {\n if (signalName) {\n process.kill(process.pid, signalName)\n } else if (code !== null) {\n // eslint-disable-next-line n/no-process-exit\n process.exit(code)\n }\n })\n spawnPromise.process.send({\n [SOCKET_IPC_HANDSHAKE]: {\n [SOCKET_CLI_SAFE_BIN]: binName,\n [SOCKET_CLI_SAFE_PROGRESS]: progressArg\n }\n })\n await spawnPromise\n}\n"],"names":["NPX","WIN32","env","SOCKET_IPC_HANDSHAKE","constants","process","spawnPromise"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAaA;;AAAaA;AAAI;AAEV;AAIL;AACA;;AAEA;;AACQC;AAAM;AACd;;AAEE;AACF;;AAEA;;AAEE;AACE;AACE;;AAIJ;;AACQC;AAAI;AACZA;AACF;AACA;AACF;;AC9BA;;;AAAuDC;AAAqB;AAG7D;;AAKb;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;AAGE;;AAGE;;AAEA;;AAEA;;AAIM;AACAC;AAIN;AACAA;AACA;AACA;AACA;;AAEA;AACA;;AAMA;;AAEF;AAEF;;AAEE;;AAEA;AACE;AACAC;AACF;AACF;AACAC;AACE;;AAEE;AACF;AACF;AACA;AACF;;","debugId":"61305e42-84d7-4c37-8d89-64d659ab9d56"}
1
+ {"version":3,"file":"shadow-bin.js","sources":["../src/shadow/npm/link.ts","../src/shadow/npm/bin.ts"],"sourcesContent":["import path from 'node:path'\nimport process from 'node:process'\n\nimport cmdShim from 'cmd-shim'\n\nimport {\n getNpmBinPath,\n getNpxBinPath,\n isNpmBinPathShadowed,\n isNpxBinPathShadowed\n} from './paths'\nimport constants from '../../constants'\n\nconst { CLI, NPX } = constants\n\nexport async function installLinks(\n realBinPath: string,\n binName: 'npm' | 'npx'\n): Promise<string> {\n const isNpx = binName === NPX\n // Find package manager being shadowed by this process.\n const binPath = isNpx ? getNpxBinPath() : getNpmBinPath()\n // Lazily access constants.WIN32.\n const { WIN32 } = constants\n // TODO: Is this early exit needed?\n if (WIN32 && binPath) {\n return binPath\n }\n const shadowed = isNpx ? isNpxBinPathShadowed() : isNpmBinPathShadowed()\n // Move our bin directory to front of PATH so its found first.\n if (!shadowed) {\n if (WIN32) {\n await cmdShim(\n // Lazily access constants.rootDistPath.\n path.join(constants.rootDistPath, `${binName}-${CLI}.js`),\n path.join(realBinPath, binName)\n )\n }\n const { env } = process\n env['PATH'] = `${realBinPath}${path.delimiter}${env['PATH']}`\n }\n return binPath\n}\n","import process from 'node:process'\n\nimport { isDebug } from '@socketsecurity/registry/lib/debug'\nimport {\n isLoglevelFlag,\n isProgressFlag\n} from '@socketsecurity/registry/lib/npm'\nimport { spawn } from '@socketsecurity/registry/lib/spawn'\n\nimport { installLinks } from './link'\nimport constants from '../../constants'\n\nconst { SOCKET_CLI_SAFE_BIN, SOCKET_CLI_SAFE_PROGRESS, SOCKET_IPC_HANDSHAKE } =\n constants\n\nexport default async function shadowBin(\n binName: 'npm' | 'npx',\n args = process.argv.slice(2)\n) {\n process.exitCode = 1\n const useDebug = isDebug()\n const terminatorPos = args.indexOf('--')\n const rawBinArgs = terminatorPos === -1 ? args : args.slice(0, terminatorPos)\n const progressArg = rawBinArgs.findLast(isProgressFlag) !== '--no-progress'\n const binArgs = rawBinArgs.filter(a => !isProgressFlag(a))\n const otherArgs = terminatorPos === -1 ? [] : args.slice(terminatorPos)\n const isSilent = !useDebug && !binArgs.some(isLoglevelFlag)\n // The default value of loglevel is \"notice\". We default to \"error\" which is\n // two levels quieter.\n const logLevelArgs = isSilent ? ['--loglevel', 'error'] : []\n const spawnPromise = spawn(\n // Lazily access constants.execPath.\n constants.execPath,\n [\n // Lazily access constants.nodeHardenFlags.\n ...constants.nodeHardenFlags,\n // Lazily access constants.nodeNoWarningsFlags.\n ...constants.nodeNoWarningsFlags,\n // Lazily access process.env['INLINED_SOCKET_CLI_SENTRY_BUILD'].\n ...(process.env['INLINED_SOCKET_CLI_SENTRY_BUILD']\n ? [\n '--require',\n // Lazily access constants.distInstrumentWithSentryPath.\n constants.distInstrumentWithSentryPath\n ]\n : []),\n '--require',\n // Lazily access constants.distShadowNpmInjectPath.\n constants.distShadowNpmInjectPath,\n // Lazily access constants.shadowBinPath.\n await installLinks(constants.shadowBinPath, binName),\n // Add '--no-progress' to fix input being swallowed by the npm spinner.\n '--no-progress',\n // Add '--loglevel=error' if a loglevel flag is not provided and the\n // SOCKET_CLI_DEBUG environment variable is not truthy.\n ...logLevelArgs,\n ...binArgs,\n ...otherArgs\n ],\n {\n // 'inherit' + 'ipc'\n stdio: [0, 1, 2, 'ipc']\n }\n )\n // See https://nodejs.org/api/all.html#all_child_process_event-exit.\n spawnPromise.process.on('exit', (code, signalName) => {\n if (signalName) {\n process.kill(process.pid, signalName)\n } else if (code !== null) {\n // eslint-disable-next-line n/no-process-exit\n process.exit(code)\n }\n })\n spawnPromise.process.send({\n [SOCKET_IPC_HANDSHAKE]: {\n [SOCKET_CLI_SAFE_BIN]: binName,\n [SOCKET_CLI_SAFE_PROGRESS]: progressArg\n }\n })\n await spawnPromise\n}\n"],"names":["NPX","WIN32","env","SOCKET_IPC_HANDSHAKE","constants","process","spawnPromise"],"mappings":";;;;;;;;;;;AAaA;;AAAaA;AAAI;AAEV;AAIL;AACA;;AAEA;;AACQC;AAAM;AACd;;AAEE;AACF;;AAEA;;AAEE;AACE;AACE;;AAIJ;;AACQC;AAAI;AACZA;AACF;AACA;AACF;;AC9BA;;;AAAuDC;AAAqB;AAG7D;;AAKb;AACA;AACA;;AAEA;AACA;;AAEA;AACA;;;AAGE;;AAGE;;AAEA;;AAEA;;AAIM;AACAC;AAIN;AACAA;AACA;AACA;AACA;;AAEA;AACA;;AAMA;;AAEF;AAEF;;AAEE;;AAEA;AACE;AACAC;AACF;AACF;AACAC;AACE;;AAEE;AACF;AACF;AACA;AACF;;","debugId":"a3ff14de-2729-4213-91d1-6f1ab7249f1d"}
@@ -6,6 +6,7 @@ const vendor = require('./vendor.js')
6
6
  const logger = require('@socketsecurity/registry/lib/logger')
7
7
  const constants = require('./constants.js')
8
8
  const arrays = require('@socketsecurity/registry/lib/arrays')
9
+ const packages = require('@socketsecurity/registry/lib/packages')
9
10
  const registry = require('@socketsecurity/registry')
10
11
  const objects = require('@socketsecurity/registry/lib/objects')
11
12
  const debug = require('@socketsecurity/registry/lib/debug')
@@ -16,48 +17,8 @@ const fs = require('node:fs')
16
17
  const os = require('node:os')
17
18
  const path = require('node:path')
18
19
  const fs$1 = require('@socketsecurity/registry/lib/fs')
19
- const packages = require('@socketsecurity/registry/lib/packages')
20
20
  const promises = require('node:timers/promises')
21
21
  const sorts = require('@socketsecurity/registry/lib/sorts')
22
- require('node:module')
23
- require('@socketsecurity/registry/lib/path')
24
- require('@socketsecurity/registry/lib/npm')
25
- require('@socketsecurity/registry/lib/words')
26
- require('./shadow-npm-inject.js')
27
- require('node:fs/promises')
28
- require('node:buffer')
29
- require('node:util')
30
- require('node:path')
31
- require('node:fs')
32
- require('node:tty')
33
- require('node:https')
34
- require('node:http')
35
- require('node:url')
36
- require('node:process')
37
- require('node:events')
38
- require('node:http')
39
- require('node:https')
40
- require('node:readline')
41
- require('@socketsecurity/registry/lib/constants/abort-signal')
42
- require('node:util')
43
- require('node:url')
44
- require('node:fs/promises')
45
- require('node:child_process')
46
- require('node:os')
47
- require('node:tty')
48
- require('node:crypto')
49
- require('node:constants')
50
- require('node:stream')
51
- require('node:assert')
52
- require('node:stream')
53
- require('node:string_decoder')
54
- require('node:path/win32')
55
- require('node:module')
56
- require('node:events')
57
- require('node:buffer')
58
- require('node:string_decoder')
59
- require('node:child_process')
60
- require('@socketsecurity/registry/lib/env')
61
22
 
62
23
  const { NPM: NPM$3, PNPM } = constants
63
24
  const PNPM_WORKSPACE = `${PNPM}-workspace`
@@ -662,7 +623,7 @@ async function setupSdk(
662
623
  // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_NAME']".
663
624
  name: '@socketsecurity/cli',
664
625
  // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_VERSION']".
665
- version: '0.14.134',
626
+ version: '0.14.136',
666
627
  // The '@rollup/plugin-replace' will replace "process.env['INLINED_SOCKET_CLI_HOMEPAGE']".
667
628
  homepage: 'https://github.com/SocketDev/socket-cli'
668
629
  })
@@ -2365,10 +2326,11 @@ async function getAlertsMapFromPnpmLockfile(lockfile, options_) {
2365
2326
  }
2366
2327
  const depTypes = vendor.libExports$1.detectDepTypes(lockfile)
2367
2328
  const purls = Object.keys(depTypes).map(id => {
2368
- const lastAtSignIndex = id.lastIndexOf('@')
2369
- const name = id.slice(0, lastAtSignIndex)
2370
- const version = id.slice(lastAtSignIndex + 1)
2371
- return `pkg:npm/${name}@${vendor.semverExports.coerce(version)}`
2329
+ const purlObj = vendor.packageurlJsExports.PackageURL.fromString(
2330
+ `pkg:npm/${id}`
2331
+ )
2332
+ const name = packages.resolvePackageName(purlObj)
2333
+ return `pkg:npm/${name}@${vendor.semverExports.coerce(purlObj.version)}`
2372
2334
  })
2373
2335
  return await getAlertsMapFromPurls(purls, {
2374
2336
  overrides: lockfile.overrides,
@@ -2646,5 +2608,5 @@ exports.supportedConfigKeys = supportedConfigKeys
2646
2608
  exports.updateConfigValue = updateConfigValue
2647
2609
  exports.updateNode = updateNode
2648
2610
  exports.updatePackageJsonFromNode = updatePackageJsonFromNode
2649
- //# debugId=e0148269-7fb3-4bfb-96b4-79b980d11acd
2611
+ //# debugId=878c5317-f475-4291-9d19-41d7bb98de62
2650
2612
  //# sourceMappingURL=shadow-npm-inject.js.map