cross-spawn-esm 1.2.0 → 1.2.2

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.
package/dist/index.d.ts CHANGED
@@ -113,7 +113,7 @@ declare function hookChildProcess(cp: ChildProcess, parsed: ParsedCommand): void
113
113
  * shebangCommand("not a shebang");
114
114
  * //=> null
115
115
  */
116
- declare function shebangCommand(string: string): string | null;
116
+ declare function shebangCommand(string?: string): string | null;
117
117
  /**
118
118
  * Reads the shebang from a script file's contents.
119
119
  * Returns `null` if the file cannot be opened/read or if `shebangCommand` finds no shebang
@@ -125,7 +125,7 @@ declare function shebangCommand(string: string): string | null;
125
125
  */
126
126
  declare function readShebang(file: string): string | null;
127
127
  /**
128
- * Detects the shebang of the resolved `parsed.command` file and rewire
128
+ * Detects the shebang of the resolved `parsed.command` file and rewires
129
129
  * `parsed` to run the script through its interpreter. When the file has a shebang,
130
130
  * the script path is prepended to `parsed.args` and `parsed.command` becomes
131
131
  * the interpreter; the interpreter path is then resolved and returned.
package/dist/index.js CHANGED
@@ -9,7 +9,7 @@ const isWin = _platform === "win32";
9
9
  const shebangRegExp = /^#!(.*)/;
10
10
  const lineBreaksRegExp = /[\r\n]+/g;
11
11
  const metaCharsRegExp = /([()\][%!^"`<>&|;, *?])/g;
12
- const executableRegExp = /\.(?:exe)$/i;
12
+ const executableRegExp = /\.(?:com|exe)$/i;
13
13
  const cmdShimRegExp = /node_modules[\\/].bin[\\/][^\\/]+\.cmd$/i;
14
14
  //#endregion
15
15
  //#region src/utils/escapes.ts
@@ -133,7 +133,7 @@ function resolveCommand(parsed) {
133
133
  }
134
134
  //#endregion
135
135
  //#region src/utils/shebang.ts
136
- function shebangCommand(string) {
136
+ function shebangCommand(string = "") {
137
137
  const match = string.match(shebangRegExp);
138
138
  if (!match) return null;
139
139
  const [path, argument] = match[0].replace(/^#!\s*/, "").split(/\s+/);
@@ -180,7 +180,7 @@ function parseNonShell(parsed) {
180
180
  "/c",
181
181
  `"${[parsed.command].concat(parsed.args).join(" ")}"`
182
182
  ];
183
- parsed.command = _env.comspec ?? "cmd.exe";
183
+ parsed.command = _env.comspec || "cmd.exe";
184
184
  parsed.options.windowsVerbatimArguments = true;
185
185
  }
186
186
  return parsed;
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "cross-spawn-esm",
3
3
  "type": "module",
4
- "version": "1.2.0",
4
+ "version": "1.2.2",
5
5
  "description": "ESM version of cross-spawn package",
6
6
  "author": "Timur Bikmuhametov <tim.bic22@gmail.com>",
7
7
  "license": "MIT",
@@ -34,19 +34,19 @@
34
34
  },
35
35
  "devDependencies": {
36
36
  "@timbic/eslint-config": "1.2.2",
37
- "@timbic/prettier-config": "1.2.3",
38
- "@types/node": "26.6.4",
39
- "@vitest/coverage-v8": "5.0.3",
37
+ "@timbic/prettier-config": "1.2.4",
38
+ "@types/node": "26.6.5",
39
+ "@vitest/coverage-v8": "5.0.5",
40
40
  "bumpp": "12.3.0",
41
- "eslint": "10.12.0",
41
+ "eslint": "10.13.0",
42
42
  "husky": "9.1.7",
43
43
  "lint-staged": "17.6.0",
44
44
  "mkdirp": "3.0.1",
45
- "prettier": "3.9.9",
45
+ "prettier": "3.9.10",
46
46
  "rimraf": "6.1.3",
47
- "tsdown": "0.23.0",
47
+ "tsdown": "0.23.1",
48
48
  "typescript": "6.0.3",
49
- "vitest": "5.0.3"
49
+ "vitest": "5.0.5"
50
50
  },
51
51
  "lint-staged": {
52
52
  "*/**/*.{js,ts,md,json}": [