@node-core/utils 7.0.3 → 7.2.0

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.
Files changed (55) hide show
  1. package/components/git/metadata.js +2 -2
  2. package/components/metadata.js +2 -1
  3. package/lib/pr_checker.js +5 -11
  4. package/lib/prepare_security.js +20 -21
  5. package/lib/queries/PR.gql +5 -4
  6. package/lib/request.js +4 -3
  7. package/lib/run.js +9 -2
  8. package/lib/utils.js +4 -2
  9. package/package.json +1 -5
  10. package/node_modules/isexe/LICENSE.md +0 -55
  11. package/node_modules/isexe/README.md +0 -80
  12. package/node_modules/isexe/dist/commonjs/index.d.ts +0 -14
  13. package/node_modules/isexe/dist/commonjs/index.d.ts.map +0 -1
  14. package/node_modules/isexe/dist/commonjs/index.js +0 -56
  15. package/node_modules/isexe/dist/commonjs/index.js.map +0 -1
  16. package/node_modules/isexe/dist/commonjs/index.min.js +0 -2
  17. package/node_modules/isexe/dist/commonjs/index.min.js.map +0 -7
  18. package/node_modules/isexe/dist/commonjs/options.d.ts +0 -32
  19. package/node_modules/isexe/dist/commonjs/options.d.ts.map +0 -1
  20. package/node_modules/isexe/dist/commonjs/options.js +0 -3
  21. package/node_modules/isexe/dist/commonjs/options.js.map +0 -1
  22. package/node_modules/isexe/dist/commonjs/package.json +0 -3
  23. package/node_modules/isexe/dist/commonjs/posix.d.ts +0 -18
  24. package/node_modules/isexe/dist/commonjs/posix.d.ts.map +0 -1
  25. package/node_modules/isexe/dist/commonjs/posix.js +0 -67
  26. package/node_modules/isexe/dist/commonjs/posix.js.map +0 -1
  27. package/node_modules/isexe/dist/commonjs/win32.d.ts +0 -18
  28. package/node_modules/isexe/dist/commonjs/win32.d.ts.map +0 -1
  29. package/node_modules/isexe/dist/commonjs/win32.js +0 -63
  30. package/node_modules/isexe/dist/commonjs/win32.js.map +0 -1
  31. package/node_modules/isexe/dist/esm/index.d.ts +0 -14
  32. package/node_modules/isexe/dist/esm/index.d.ts.map +0 -1
  33. package/node_modules/isexe/dist/esm/index.js +0 -16
  34. package/node_modules/isexe/dist/esm/index.js.map +0 -1
  35. package/node_modules/isexe/dist/esm/index.min.js +0 -2
  36. package/node_modules/isexe/dist/esm/index.min.js.map +0 -7
  37. package/node_modules/isexe/dist/esm/options.d.ts +0 -32
  38. package/node_modules/isexe/dist/esm/options.d.ts.map +0 -1
  39. package/node_modules/isexe/dist/esm/options.js +0 -2
  40. package/node_modules/isexe/dist/esm/options.js.map +0 -1
  41. package/node_modules/isexe/dist/esm/package.json +0 -3
  42. package/node_modules/isexe/dist/esm/posix.d.ts +0 -18
  43. package/node_modules/isexe/dist/esm/posix.d.ts.map +0 -1
  44. package/node_modules/isexe/dist/esm/posix.js +0 -62
  45. package/node_modules/isexe/dist/esm/posix.js.map +0 -1
  46. package/node_modules/isexe/dist/esm/win32.d.ts +0 -18
  47. package/node_modules/isexe/dist/esm/win32.d.ts.map +0 -1
  48. package/node_modules/isexe/dist/esm/win32.js +0 -58
  49. package/node_modules/isexe/dist/esm/win32.js.map +0 -1
  50. package/node_modules/isexe/package.json +0 -78
  51. package/node_modules/which/LICENSE +0 -15
  52. package/node_modules/which/README.md +0 -51
  53. package/node_modules/which/bin/which.js +0 -52
  54. package/node_modules/which/lib/index.js +0 -111
  55. package/node_modules/which/package.json +0 -52
@@ -1,111 +0,0 @@
1
- const { isexe, sync: isexeSync } = require('isexe')
2
- const { join, delimiter, sep, posix } = require('path')
3
-
4
- const isWindows = process.platform === 'win32'
5
-
6
- // used to check for slashed in commands passed in. always checks for the posix
7
- // seperator on all platforms, and checks for the current separator when not on
8
- // a posix platform. don't use the isWindows check for this since that is mocked
9
- // in tests but we still need the code to actually work when called. that is also
10
- // why it is ignored from coverage.
11
- /* istanbul ignore next */
12
- const rSlash = new RegExp(`[${posix.sep}${sep === posix.sep ? '' : sep}]`.replace(/(\\)/g, '\\$1'))
13
- const rRel = new RegExp(`^\\.${rSlash.source}`)
14
-
15
- const getNotFoundError = (cmd) =>
16
- Object.assign(new Error(`not found: ${cmd}`), { code: 'ENOENT' })
17
-
18
- const getPathInfo = (cmd, {
19
- path: optPath = process.env.PATH,
20
- pathExt: optPathExt = process.env.PATHEXT,
21
- delimiter: optDelimiter = delimiter,
22
- }) => {
23
- // If it has a slash, then we don't bother searching the pathenv.
24
- // just check the file itself, and that's it.
25
- const pathEnv = cmd.match(rSlash) ? [''] : [
26
- // windows always checks the cwd first
27
- ...(isWindows ? [process.cwd()] : []),
28
- ...(optPath || /* istanbul ignore next: very unusual */ '').split(optDelimiter),
29
- ]
30
-
31
- if (isWindows) {
32
- const pathExtExe = optPathExt ||
33
- ['.EXE', '.CMD', '.BAT', '.COM'].join(optDelimiter)
34
- const pathExt = pathExtExe.split(optDelimiter).flatMap((item) => [item, item.toLowerCase()])
35
- if (cmd.includes('.') && pathExt[0] !== '') {
36
- pathExt.unshift('')
37
- }
38
- return { pathEnv, pathExt, pathExtExe }
39
- }
40
-
41
- return { pathEnv, pathExt: [''] }
42
- }
43
-
44
- const getPathPart = (raw, cmd) => {
45
- const pathPart = /^".*"$/.test(raw) ? raw.slice(1, -1) : raw
46
- const prefix = !pathPart && rRel.test(cmd) ? cmd.slice(0, 2) : ''
47
- return prefix + join(pathPart, cmd)
48
- }
49
-
50
- const which = async (cmd, opt = {}) => {
51
- const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)
52
- const found = []
53
-
54
- for (const envPart of pathEnv) {
55
- const p = getPathPart(envPart, cmd)
56
-
57
- for (const ext of pathExt) {
58
- const withExt = p + ext
59
- const is = await isexe(withExt, { pathExt: pathExtExe, ignoreErrors: true })
60
- if (is) {
61
- if (!opt.all) {
62
- return withExt
63
- }
64
- found.push(withExt)
65
- }
66
- }
67
- }
68
-
69
- if (opt.all && found.length) {
70
- return found
71
- }
72
-
73
- if (opt.nothrow) {
74
- return null
75
- }
76
-
77
- throw getNotFoundError(cmd)
78
- }
79
-
80
- const whichSync = (cmd, opt = {}) => {
81
- const { pathEnv, pathExt, pathExtExe } = getPathInfo(cmd, opt)
82
- const found = []
83
-
84
- for (const pathEnvPart of pathEnv) {
85
- const p = getPathPart(pathEnvPart, cmd)
86
-
87
- for (const ext of pathExt) {
88
- const withExt = p + ext
89
- const is = isexeSync(withExt, { pathExt: pathExtExe, ignoreErrors: true })
90
- if (is) {
91
- if (!opt.all) {
92
- return withExt
93
- }
94
- found.push(withExt)
95
- }
96
- }
97
- }
98
-
99
- if (opt.all && found.length) {
100
- return found
101
- }
102
-
103
- if (opt.nothrow) {
104
- return null
105
- }
106
-
107
- throw getNotFoundError(cmd)
108
- }
109
-
110
- module.exports = which
111
- which.sync = whichSync
@@ -1,52 +0,0 @@
1
- {
2
- "author": "GitHub Inc.",
3
- "name": "which",
4
- "description": "Like which(1) unix command. Find the first instance of an executable in the PATH.",
5
- "version": "7.0.0",
6
- "repository": {
7
- "type": "git",
8
- "url": "git+https://github.com/npm/node-which.git"
9
- },
10
- "main": "lib/index.js",
11
- "bin": {
12
- "node-which": "./bin/which.js"
13
- },
14
- "license": "ISC",
15
- "dependencies": {
16
- "isexe": "^4.0.0"
17
- },
18
- "devDependencies": {
19
- "@npmcli/eslint-config": "^6.0.0",
20
- "@npmcli/template-oss": "5.0.0",
21
- "tap": "^16.3.0"
22
- },
23
- "scripts": {
24
- "test": "tap",
25
- "lint": "npm run eslint",
26
- "postlint": "template-oss-check",
27
- "template-oss-apply": "template-oss-apply --force",
28
- "lintfix": "npm run eslint -- --fix",
29
- "snap": "tap",
30
- "posttest": "npm run lint",
31
- "eslint": "eslint \"**/*.{js,cjs,ts,mjs,jsx,tsx}\""
32
- },
33
- "files": [
34
- "bin/",
35
- "lib/"
36
- ],
37
- "tap": {
38
- "check-coverage": true,
39
- "nyc-arg": [
40
- "--exclude",
41
- "tap-snapshots/**"
42
- ]
43
- },
44
- "engines": {
45
- "node": "^22.22.2 || ^24.15.0 || >=26.0.0"
46
- },
47
- "templateOSS": {
48
- "//@npmcli/template-oss": "This file is partially managed by @npmcli/template-oss. Edits may be overwritten.",
49
- "version": "5.0.0",
50
- "publish": "true"
51
- }
52
- }