cross-spawn-cb 1.3.0 → 1.3.1

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.
@@ -3,6 +3,7 @@
3
3
  var require$$0 = require('buffer');
4
4
  var require$$0$2 = require('path');
5
5
  var require$$0$3 = require('child_process');
6
+ var require$$6 = require('function-exec-sync');
6
7
  var require$$0$1 = require('fs');
7
8
 
8
9
  var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
@@ -2140,7 +2141,7 @@ function requireBufferV6Polyfill() {
2140
2141
  return bufferV6Polyfill;
2141
2142
  }
2142
2143
 
2143
- var crossSpawn = {
2144
+ var crossSpawn6_0_5 = {
2144
2145
  exports: {}
2145
2146
  };
2146
2147
 
@@ -2440,11 +2441,9 @@ function requireResolveCommand() {
2440
2441
  function resolveCommandAttempt(parsed, withoutPathExt) {
2441
2442
  var cwd = process.cwd();
2442
2443
  var hasCustomCwd = parsed.options.cwd != null;
2443
- // Worker threads do not have process.chdir()
2444
- var shouldSwitchCwd = hasCustomCwd && process.chdir !== undefined;
2445
2444
  // If a custom `cwd` was specified, we need to change the process cwd
2446
2445
  // because `which` will do stat calls but does not support a custom cwd
2447
- if (shouldSwitchCwd) {
2446
+ if (hasCustomCwd) {
2448
2447
  try {
2449
2448
  process.chdir(parsed.options.cwd);
2450
2449
  } catch (err) {
@@ -2458,9 +2457,7 @@ function requireResolveCommand() {
2458
2457
  });
2459
2458
  } catch (e) {
2460
2459
  /* Empty */ } finally{
2461
- if (shouldSwitchCwd) {
2462
- process.chdir(cwd);
2463
- }
2460
+ process.chdir(cwd);
2464
2461
  }
2465
2462
  // If we successfully resolved, ensure that an absolute path is returned
2466
2463
  // Note that when a custom `cwd` was used, we need to resolve to an absolute path based on it
@@ -2493,15 +2490,13 @@ function require_escape() {
2493
2490
  // Convert to string
2494
2491
  arg = "".concat(arg);
2495
2492
  // Algorithm below is based on https://qntm.org/cmd
2496
- // It's slightly altered to disable JS backtracking to avoid hanging on specially crafted input
2497
- // Please see https://github.com/moxystudio/node-cross-spawn/pull/160 for more information
2498
2493
  // Sequence of backslashes followed by a double quote:
2499
2494
  // double up all the backslashes and escape the double quote
2500
- arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"');
2495
+ arg = arg.replace(/(\\*)"/g, '$1$1\\"');
2501
2496
  // Sequence of backslashes followed by the end of the string
2502
2497
  // (which will become a double quote later):
2503
2498
  // double up all the backslashes
2504
- arg = arg.replace(/(?=(\\+?)?)\1$/, '$1$1');
2499
+ arg = arg.replace(/(\\*)$/, '$1$1');
2505
2500
  // All other backslashes occur literally
2506
2501
  // Quote the whole thing:
2507
2502
  arg = '"'.concat(arg, '"');
@@ -4019,10 +4014,10 @@ function requireEnoent() {
4019
4014
  return enoent;
4020
4015
  }
4021
4016
 
4022
- var hasRequiredCrossSpawn;
4023
- function requireCrossSpawn() {
4024
- if (hasRequiredCrossSpawn) return crossSpawn.exports;
4025
- hasRequiredCrossSpawn = 1;
4017
+ var hasRequiredCrossSpawn6_0_5;
4018
+ function requireCrossSpawn6_0_5() {
4019
+ if (hasRequiredCrossSpawn6_0_5) return crossSpawn6_0_5.exports;
4020
+ hasRequiredCrossSpawn6_0_5 = 1;
4026
4021
  var cp = require$$0$3;
4027
4022
  var parse = requireParse();
4028
4023
  var enoent = requireEnoent();
@@ -4045,12 +4040,12 @@ function requireCrossSpawn() {
4045
4040
  result.error = result.error || enoent.verifyENOENTSync(result.status, parsed);
4046
4041
  return result;
4047
4042
  }
4048
- crossSpawn.exports = spawn;
4049
- crossSpawn.exports.spawn = spawn;
4050
- crossSpawn.exports.sync = spawnSync;
4051
- crossSpawn.exports._parse = parse;
4052
- crossSpawn.exports._enoent = enoent;
4053
- return crossSpawn.exports;
4043
+ crossSpawn6_0_5.exports = spawn;
4044
+ crossSpawn6_0_5.exports.spawn = spawn;
4045
+ crossSpawn6_0_5.exports.sync = spawnSync;
4046
+ crossSpawn6_0_5.exports._parse = parse;
4047
+ crossSpawn6_0_5.exports._enoent = enoent;
4048
+ return crossSpawn6_0_5.exports;
4054
4049
  }
4055
4050
 
4056
4051
  var src;
@@ -4067,7 +4062,20 @@ function requireSrc() {
4067
4062
  var isWindows = process.platform === 'win32' || /^(msys|cygwin)$/.test(process.env.OSTYPE);
4068
4063
  path.delimiter = isWindows ? ';' : ':';
4069
4064
  }
4070
- src = requireCrossSpawn();
4065
+ // early node is missing spawnSync
4066
+ var cp = require$$0$3;
4067
+ if (!cp.spawnSync) {
4068
+ var path1 = require$$0$2;
4069
+ var spawnCallback = path1.join(__dirname, '..', 'dist', 'cjs', 'spawnCallback.js');
4070
+ var functionExec = null; // break dependencies
4071
+ cp.spawnSync = function spawnSyncPolyfill(cmd, args, options) {
4072
+ if (!functionExec) functionExec = require$$6;
4073
+ return functionExec({
4074
+ callbacks: true
4075
+ }, spawnCallback, cmd, args, options || {});
4076
+ };
4077
+ }
4078
+ src = requireCrossSpawn6_0_5();
4071
4079
  return src;
4072
4080
  }
4073
4081
 
@@ -0,0 +1 @@
1
+ {"type":"commonjs"}
package/dist/cjs/index.js CHANGED
@@ -1,4 +1,3 @@
1
- // early node is missing spawnSync
2
1
  "use strict";
3
2
  Object.defineProperty(exports, "__esModule", {
4
3
  value: true
@@ -28,17 +27,5 @@ function _interop_require_default(obj) {
28
27
  default: obj
29
28
  };
30
29
  }
31
- var cp = require('child_process');
32
- if (!cp.spawnSync) {
33
- var path = require('path');
34
- var _$spawnCallback = path.join(__dirname, 'spawnCallback.js');
35
- var functionExec = null; // break dependencies
36
- cp.spawnSync = function spawnSyncPolyfill(cmd, args, options) {
37
- if (!functionExec) functionExec = require('function-exec-sync');
38
- return functionExec({
39
- callbacks: true
40
- }, _$spawnCallback, cmd, args, options || {});
41
- };
42
- }
43
30
  var _default = _spawnCallback.default;
44
31
  /* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) { exports.default[key] = exports[key]; } } catch (_) {}; module.exports = exports.default; }
@@ -1 +1 @@
1
- {"version":3,"sources":["index.mjs"],"sourcesContent":["// early node is missing spawnSync\nconst cp = require('child_process');\nif (!cp.spawnSync) {\n const path = require('path');\n const spawnCallback = path.join(__dirname, 'spawnCallback.js');\n\n let functionExec = null; // break dependencies\n cp.spawnSync = function spawnSyncPolyfill(cmd, args, options) {\n if (!functionExec) functionExec = require('function-exec-sync');\n return functionExec({ callbacks: true }, spawnCallback, cmd, args, options || {});\n };\n}\n\nimport spawnCallback from './spawnCallback';\nexport default spawnCallback;\nexport { default as spawn } from './spawn';\nexport { default as sync } from './spawnCallbackSync';\n"],"names":["spawn","sync","cp","require","spawnSync","path","spawnCallback","join","__dirname","functionExec","spawnSyncPolyfill","cmd","args","options","callbacks"],"mappings":"AAAA,kCAAkC;;;;;;;;;;;;IAclC,OAA6B;eAA7B;;IACoBA,KAAK;eAALA,cAAK;;IACLC,IAAI;eAAJA,0BAAI;;;oEAHE;4DAEO;wEACD;;;;;;AAfhC,IAAMC,KAAKC,QAAQ;AACnB,IAAI,CAACD,GAAGE,SAAS,EAAE;IACjB,IAAMC,OAAOF,QAAQ;IACrB,IAAMG,kBAAgBD,KAAKE,IAAI,CAACC,WAAW;IAE3C,IAAIC,eAAe,MAAM,qBAAqB;IAC9CP,GAAGE,SAAS,GAAG,SAASM,kBAAkBC,GAAG,EAAEC,IAAI,EAAEC,OAAO;QAC1D,IAAI,CAACJ,cAAcA,eAAeN,QAAQ;QAC1C,OAAOM,aAAa;YAAEK,WAAW;QAAK,GAAGR,iBAAeK,KAAKC,MAAMC,WAAW,CAAC;IACjF;AACF;IAGA,WAAeP,sBAAa"}
1
+ {"version":3,"sources":["index.mjs"],"sourcesContent":["import spawnCallback from './spawnCallback';\nexport default spawnCallback;\nexport { default as spawn } from './spawn';\nexport { default as sync } from './spawnCallbackSync';\n"],"names":["spawn","sync","spawnCallback"],"mappings":";;;;;;;;;;;IACA,OAA6B;eAA7B;;IACoBA,KAAK;eAALA,cAAK;;IACLC,IAAI;eAAJA,0BAAI;;;oEAHE;4DAEO;wEACD;;;;;;IAFhC,WAAeC,sBAAa"}
package/dist/cjs/spawn.js CHANGED
@@ -1,6 +1,5 @@
1
1
  "use strict";
2
2
  var major = +process.versions.node.split('.')[0];
3
- // TODO: fix transform file extensions for cjs
4
- var spawn = major <= 7 ? require('../../assets/cross-spawn-6.0.5.' + 'cjs').spawn : require('cross-spawn').spawn;
3
+ var spawn = major <= 7 ? require('../../assets/cross-spawn-6.0.5.js').spawn : require('cross-spawn').spawn;
5
4
  module.exports = spawn;
6
5
  /* CJS INTEROP */ if (exports.__esModule && exports.default) { try { Object.defineProperty(exports.default, '__esModule', { value: true }); for (var key in exports) { exports.default[key] = exports[key]; } } catch (_) {}; module.exports = exports.default; }
@@ -1 +1 @@
1
- {"version":3,"sources":["spawn.js"],"sourcesContent":["const major = +process.versions.node.split('.')[0];\n// TODO: fix transform file extensions for cjs\nconst spawn = major <= 7 ? require('../../assets/cross-spawn-6.0.5.' + 'cjs').spawn : require('cross-spawn').spawn;\n\nmodule.exports = spawn;\n"],"names":["major","process","versions","node","split","spawn","require","module","exports"],"mappings":";AAAA,IAAMA,QAAQ,CAACC,QAAQC,QAAQ,CAACC,IAAI,CAACC,KAAK,CAAC,IAAI,CAAC,EAAE;AAClD,8CAA8C;AAC9C,IAAMC,QAAQL,SAAS,IAAIM,QAAQ,oCAAoC,OAAOD,KAAK,GAAGC,QAAQ,eAAeD,KAAK;AAElHE,OAAOC,OAAO,GAAGH"}
1
+ {"version":3,"sources":["spawn.js"],"sourcesContent":["const major = +process.versions.node.split('.')[0];\nconst spawn = major <= 7 ? require('../../assets/cross-spawn-6.0.5.js').spawn : require('cross-spawn').spawn;\nmodule.exports = spawn;\n"],"names":["major","process","versions","node","split","spawn","require","module","exports"],"mappings":";AAAA,IAAMA,QAAQ,CAACC,QAAQC,QAAQ,CAACC,IAAI,CAACC,KAAK,CAAC,IAAI,CAAC,EAAE;AAClD,IAAMC,QAAQL,SAAS,IAAIM,QAAQ,qCAAqCD,KAAK,GAAGC,QAAQ,eAAeD,KAAK;AAC5GE,OAAOC,OAAO,GAAGH"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cross-spawn-cb",
3
- "version": "1.3.0",
3
+ "version": "1.3.1",
4
4
  "description": "Cross spawn with a completion callback",
5
5
  "keywords": [
6
6
  "cross-spawn",
@@ -29,7 +29,7 @@
29
29
  "dependencies": {
30
30
  "call-once-fn": "^1.0.1",
31
31
  "cross-spawn": "^7.0.6",
32
- "function-exec-sync": "^1.1.1",
32
+ "function-exec-sync": "^1.1.2",
33
33
  "next-tick": "^1.1.0"
34
34
  },
35
35
  "devDependencies": {
@@ -40,10 +40,11 @@
40
40
  "depcheck": "^1.4.7",
41
41
  "is-version": "^0.2.1",
42
42
  "mocha-compat": "^3.6.2",
43
- "node-install-release": "^1.4.4",
44
- "node-resolve-versions": "^1.0.0",
45
- "node-version-utils": "^1.0.2",
46
- "ts-dev-stack": "^1.5.2"
43
+ "node-install-release": "^1.4.6",
44
+ "node-resolve-versions": "^1.0.1",
45
+ "node-version-utils": "^1.0.3",
46
+ "rimraf2": "^2.8.2",
47
+ "ts-dev-stack": "^1.5.4"
47
48
  },
48
49
  "packageManager": "npm@11.0.0+sha512.11dff29565d2297c74e7c594a9762581bde969f0aa5cbe6f5b3644bf008a16c065ece61094d9ffbb81125be38df8e1ba43eb8244b3d30c61eb797e9a2440e3ec",
49
50
  "engines": {