cross-spawn-cb 1.1.3 → 1.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.
package/dist/cjs/index.js CHANGED
@@ -1,3 +1,4 @@
1
+ // early node is missing spawnSync
1
2
  "use strict";
2
3
  Object.defineProperty(exports, "__esModule", {
3
4
  value: true
@@ -19,7 +20,6 @@ _export(exports, {
19
20
  return _spawnCallbackSync.default;
20
21
  }
21
22
  });
22
- require("./polyfills.js");
23
23
  var _spawnCallback = /*#__PURE__*/ _interop_require_default(require("./spawnCallback"));
24
24
  var _spawn = /*#__PURE__*/ _interop_require_default(require("./spawn"));
25
25
  var _spawnCallbackSync = /*#__PURE__*/ _interop_require_default(require("./spawnCallbackSync"));
@@ -28,5 +28,16 @@ function _interop_require_default(obj) {
28
28
  default: obj
29
29
  };
30
30
  }
31
+ var cp = require('child_process');
32
+ if (!cp.spawnSync) {
33
+ var _$spawnCallback = path.join(__dirname, 'spawnCallback.js');
34
+ var functionExec = null; // break dependencies
35
+ cp.spawnSync = function spawnSyncPolyfill(cmd, args, options) {
36
+ if (!functionExec) functionExec = require('function-exec-sync');
37
+ return functionExec({
38
+ callbacks: true
39
+ }, _$spawnCallback, cmd, args, options || {});
40
+ };
41
+ }
31
42
  var _default = _spawnCallback.default;
32
43
  /* 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":["import './polyfills.cjs';\n\nimport spawnCallback from './spawnCallback';\n\nexport default spawnCallback;\nexport { default as spawn } from './spawn';\nexport { default as sync } from './spawnCallbackSync';\n"],"names":["spawn","sync","spawnCallback"],"mappings":";;;;;;;;;;;IAIA,OAA6B;eAA7B;;IACoBA,KAAK;eAALA,cAAK;;IACLC,IAAI;eAAJA,0BAAI;;;QANjB;oEAEmB;4DAGO;wEACD;;;;;;IAFhC,WAAeC,sBAAa"}
1
+ {"version":3,"sources":["index.mjs"],"sourcesContent":["// early node is missing spawnSync\nconst cp = require('child_process');\nif (!cp.spawnSync) {\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","spawnCallback","path","join","__dirname","functionExec","spawnSyncPolyfill","cmd","args","options","callbacks"],"mappings":"AAAA,kCAAkC;;;;;;;;;;;;IAalC,OAA6B;eAA7B;;IACoBA,KAAK;eAALA,cAAK;;IACLC,IAAI;eAAJA,0BAAI;;;oEAHE;4DAEO;wEACD;;;;;;AAdhC,IAAMC,KAAKC,QAAQ;AACnB,IAAI,CAACD,GAAGE,SAAS,EAAE;IACjB,IAAMC,kBAAgBC,KAAKC,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,GAAGT,iBAAeM,KAAKC,MAAMC,WAAW,CAAC;IACjF;AACF;IAGA,WAAeR,sBAAa"}
package/dist/cjs/spawn.js CHANGED
@@ -1,5 +1,6 @@
1
1
  "use strict";
2
2
  var major = +process.versions.node.split('.')[0];
3
- var spawn = major <= 7 ? require('../../assets/cross-spawn-6.0.5.js').spawn : require('cross-spawn').spawn;
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;
4
5
  module.exports = spawn;
5
6
  /* 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];\nconst spawn = major <= 7 ? require('../../assets/cross-spawn-6.0.5.js').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,IAAMC,QAAQL,SAAS,IAAIM,QAAQ,qCAAqCD,KAAK,GAAGC,QAAQ,eAAeD,KAAK;AAE5GE,OAAOC,OAAO,GAAGH"}
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,5 +1,4 @@
1
1
  "use strict";
2
- require('./polyfills.js');
3
2
  var once = require('call-once-fn');
4
3
  var nextTick = require('next-tick');
5
4
  var constants = require('./constants');
@@ -1 +1 @@
1
- {"version":3,"sources":["spawnCallback.js"],"sourcesContent":["require('./polyfills.cjs');\nconst once = require('call-once-fn');\nconst nextTick = require('next-tick');\nconst constants = require('./constants');\nconst spawn = require('./spawn');\n\nfunction normalize(cp, options, callback) {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n callback = once(callback);\n\n // collect output\n const res = { stdout: null, stderr: null };\n if (options.encoding) {\n if (cp.stdout) {\n res.stdout = [];\n cp.stdout.on('data', res.stdout.push.bind(res.stdout));\n }\n if (cp.stderr) {\n res.stderr = [];\n cp.stderr.on('data', res.stderr.push.bind(res.stderr));\n }\n }\n\n // some versions of node emit both an error and close\n cp.on('error', function error(err) {\n err.code === 'OK' || callback(err);\n });\n\n // done\n cp.on('close', (status, signal) => {\n nextTick(function closeNextTick() {\n // prepare result\n res.pid = cp.pid;\n res.status = status;\n res.signal = signal;\n if (res.stdout) {\n res.stdout = Buffer.concat(res.stdout);\n if (options.encoding !== 'buffer') res.stdout = res.stdout.toString(options.encoding);\n }\n if (res.stderr) {\n res.stderr = Buffer.concat(res.stderr);\n if (options.encoding !== 'buffer') res.stderr = res.stderr.toString(options.encoding);\n }\n res.output = [null, res.stdout, res.stderr];\n\n // patch: early node on windows could return null\n if (res.status === null) res.status = 0;\n\n // process errors\n const err = res.status !== 0 ? new Error(`Non-zero exit code: ${res.status}`) : null;\n if (err) {\n for (const key in res) {\n if (constants.spawnKeys.indexOf(key) < 0) continue;\n err[key] = Buffer.isBuffer(res[key]) ? res[key].toString('utf8') : res[key];\n }\n }\n err ? callback(err) : callback(null, res);\n });\n });\n\n // pipe input\n if (options.input && (typeof options.input === 'string' || Buffer.isBuffer(options.input))) {\n cp.stdin.end(options.input);\n }\n}\n\nfunction spawnCallback(command, args, options, callback) {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n callback = once(callback);\n const cp = spawn(command, args, options);\n return normalize(cp, options, callback);\n}\n\nmodule.exports = spawnCallback;\nmodule.exports.normalize = normalize;\n"],"names":["require","once","nextTick","constants","spawn","normalize","cp","options","callback","res","stdout","stderr","encoding","on","push","bind","error","err","code","status","signal","closeNextTick","pid","Buffer","concat","toString","output","Error","key","spawnKeys","indexOf","isBuffer","input","stdin","end","spawnCallback","command","args","module","exports"],"mappings":";AAAAA,QAAQ;AACR,IAAMC,OAAOD,QAAQ;AACrB,IAAME,WAAWF,QAAQ;AACzB,IAAMG,YAAYH,QAAQ;AAC1B,IAAMI,QAAQJ,QAAQ;AAEtB,SAASK,UAAUC,EAAE,EAAEC,OAAO,EAAEC,QAAQ;IACtC,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU,CAAC;IACb;IACAA,UAAUA,WAAW,CAAC;IACtBC,WAAWP,KAAKO;IAEhB,iBAAiB;IACjB,IAAMC,MAAM;QAAEC,QAAQ;QAAMC,QAAQ;IAAK;IACzC,IAAIJ,QAAQK,QAAQ,EAAE;QACpB,IAAIN,GAAGI,MAAM,EAAE;YACbD,IAAIC,MAAM,GAAG,EAAE;YACfJ,GAAGI,MAAM,CAACG,EAAE,CAAC,QAAQJ,IAAIC,MAAM,CAACI,IAAI,CAACC,IAAI,CAACN,IAAIC,MAAM;QACtD;QACA,IAAIJ,GAAGK,MAAM,EAAE;YACbF,IAAIE,MAAM,GAAG,EAAE;YACfL,GAAGK,MAAM,CAACE,EAAE,CAAC,QAAQJ,IAAIE,MAAM,CAACG,IAAI,CAACC,IAAI,CAACN,IAAIE,MAAM;QACtD;IACF;IAEA,qDAAqD;IACrDL,GAAGO,EAAE,CAAC,SAAS,SAASG,MAAMC,GAAG;QAC/BA,IAAIC,IAAI,KAAK,QAAQV,SAASS;IAChC;IAEA,OAAO;IACPX,GAAGO,EAAE,CAAC,SAAS,SAACM,QAAQC;QACtBlB,SAAS,SAASmB;YAChB,iBAAiB;YACjBZ,IAAIa,GAAG,GAAGhB,GAAGgB,GAAG;YAChBb,IAAIU,MAAM,GAAGA;YACbV,IAAIW,MAAM,GAAGA;YACb,IAAIX,IAAIC,MAAM,EAAE;gBACdD,IAAIC,MAAM,GAAGa,OAAOC,MAAM,CAACf,IAAIC,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,YAAY;QACjCC,WAAWD;QACXA,UAAU,CAAC;IACb;IACAA,UAAUA,WAAW,CAAC;IACtBC,WAAWP,KAAKO;IAChB,IAAMF,KAAKF,MAAMgC,SAASC,MAAM9B;IAChC,OAAOF,UAAUC,IAAIC,SAASC;AAChC;AAEA8B,OAAOC,OAAO,GAAGJ;AACjBG,OAAOC,OAAO,CAAClC,SAAS,GAAGA"}
1
+ {"version":3,"sources":["spawnCallback.js"],"sourcesContent":["const once = require('call-once-fn');\nconst nextTick = require('next-tick');\nconst constants = require('./constants');\nconst spawn = require('./spawn');\n\nfunction normalize(cp, options, callback) {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n callback = once(callback);\n\n // collect output\n const res = { stdout: null, stderr: null };\n if (options.encoding) {\n if (cp.stdout) {\n res.stdout = [];\n cp.stdout.on('data', res.stdout.push.bind(res.stdout));\n }\n if (cp.stderr) {\n res.stderr = [];\n cp.stderr.on('data', res.stderr.push.bind(res.stderr));\n }\n }\n\n // some versions of node emit both an error and close\n cp.on('error', function error(err) {\n err.code === 'OK' || callback(err);\n });\n\n // done\n cp.on('close', (status, signal) => {\n nextTick(function closeNextTick() {\n // prepare result\n res.pid = cp.pid;\n res.status = status;\n res.signal = signal;\n if (res.stdout) {\n res.stdout = Buffer.concat(res.stdout);\n if (options.encoding !== 'buffer') res.stdout = res.stdout.toString(options.encoding);\n }\n if (res.stderr) {\n res.stderr = Buffer.concat(res.stderr);\n if (options.encoding !== 'buffer') res.stderr = res.stderr.toString(options.encoding);\n }\n res.output = [null, res.stdout, res.stderr];\n\n // patch: early node on windows could return null\n if (res.status === null) res.status = 0;\n\n // process errors\n const err = res.status !== 0 ? new Error(`Non-zero exit code: ${res.status}`) : null;\n if (err) {\n for (const key in res) {\n if (constants.spawnKeys.indexOf(key) < 0) continue;\n err[key] = Buffer.isBuffer(res[key]) ? res[key].toString('utf8') : res[key];\n }\n }\n err ? callback(err) : callback(null, res);\n });\n });\n\n // pipe input\n if (options.input && (typeof options.input === 'string' || Buffer.isBuffer(options.input))) {\n cp.stdin.end(options.input);\n }\n}\n\nfunction spawnCallback(command, args, options, callback) {\n if (typeof options === 'function') {\n callback = options;\n options = {};\n }\n options = options || {};\n callback = once(callback);\n const cp = spawn(command, args, options);\n return normalize(cp, options, callback);\n}\n\nmodule.exports = spawnCallback;\nmodule.exports.normalize = normalize;\n"],"names":["once","require","nextTick","constants","spawn","normalize","cp","options","callback","res","stdout","stderr","encoding","on","push","bind","error","err","code","status","signal","closeNextTick","pid","Buffer","concat","toString","output","Error","key","spawnKeys","indexOf","isBuffer","input","stdin","end","spawnCallback","command","args","module","exports"],"mappings":";AAAA,IAAMA,OAAOC,QAAQ;AACrB,IAAMC,WAAWD,QAAQ;AACzB,IAAME,YAAYF,QAAQ;AAC1B,IAAMG,QAAQH,QAAQ;AAEtB,SAASI,UAAUC,EAAE,EAAEC,OAAO,EAAEC,QAAQ;IACtC,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU,CAAC;IACb;IACAA,UAAUA,WAAW,CAAC;IACtBC,WAAWR,KAAKQ;IAEhB,iBAAiB;IACjB,IAAMC,MAAM;QAAEC,QAAQ;QAAMC,QAAQ;IAAK;IACzC,IAAIJ,QAAQK,QAAQ,EAAE;QACpB,IAAIN,GAAGI,MAAM,EAAE;YACbD,IAAIC,MAAM,GAAG,EAAE;YACfJ,GAAGI,MAAM,CAACG,EAAE,CAAC,QAAQJ,IAAIC,MAAM,CAACI,IAAI,CAACC,IAAI,CAACN,IAAIC,MAAM;QACtD;QACA,IAAIJ,GAAGK,MAAM,EAAE;YACbF,IAAIE,MAAM,GAAG,EAAE;YACfL,GAAGK,MAAM,CAACE,EAAE,CAAC,QAAQJ,IAAIE,MAAM,CAACG,IAAI,CAACC,IAAI,CAACN,IAAIE,MAAM;QACtD;IACF;IAEA,qDAAqD;IACrDL,GAAGO,EAAE,CAAC,SAAS,SAASG,MAAMC,GAAG;QAC/BA,IAAIC,IAAI,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ACF;IAEA,aAAa;IACb,IAAIF,QAAQyB,KAAK,IAAK,CAAA,OAAOzB,QAAQyB,KAAK,KAAK,YAAYT,OAAOQ,QAAQ,CAACxB,QAAQyB,KAAK,CAAA,GAAI;QAC1F1B,GAAG2B,KAAK,CAACC,GAAG,CAAC3B,QAAQyB,KAAK;IAC5B;AACF;AAEA,SAASG,cAAcC,OAAO,EAAEC,IAAI,EAAE9B,OAAO,EAAEC,QAAQ;IACrD,IAAI,OAAOD,YAAY,YAAY;QACjCC,WAAWD;QACXA,UAAU,CAAC;IACb;IACAA,UAAUA,WAAW,CAAC;IACtBC,WAAWR,KAAKQ;IAChB,IAAMF,KAAKF,MAAMgC,SAASC,MAAM9B;IAChC,OAAOF,UAAUC,IAAIC,SAASC;AAChC;AAEA8B,OAAOC,OAAO,GAAGJ;AACjBG,OAAOC,OAAO,CAAClC,SAAS,GAAGA"}
@@ -1,4 +1,56 @@
1
1
  "use strict";
2
+ function _define_property(obj, key, value) {
3
+ if (key in obj) {
4
+ Object.defineProperty(obj, key, {
5
+ value: value,
6
+ enumerable: true,
7
+ configurable: true,
8
+ writable: true
9
+ });
10
+ } else {
11
+ obj[key] = value;
12
+ }
13
+ return obj;
14
+ }
15
+ function _object_spread(target) {
16
+ for(var i = 1; i < arguments.length; i++){
17
+ var source = arguments[i] != null ? arguments[i] : {};
18
+ var ownKeys = Object.keys(source);
19
+ if (typeof Object.getOwnPropertySymbols === "function") {
20
+ ownKeys = ownKeys.concat(Object.getOwnPropertySymbols(source).filter(function(sym) {
21
+ return Object.getOwnPropertyDescriptor(source, sym).enumerable;
22
+ }));
23
+ }
24
+ ownKeys.forEach(function(key) {
25
+ _define_property(target, key, source[key]);
26
+ });
27
+ }
28
+ return target;
29
+ }
30
+ function ownKeys(object, enumerableOnly) {
31
+ var keys = Object.keys(object);
32
+ if (Object.getOwnPropertySymbols) {
33
+ var symbols = Object.getOwnPropertySymbols(object);
34
+ if (enumerableOnly) {
35
+ symbols = symbols.filter(function(sym) {
36
+ return Object.getOwnPropertyDescriptor(object, sym).enumerable;
37
+ });
38
+ }
39
+ keys.push.apply(keys, symbols);
40
+ }
41
+ return keys;
42
+ }
43
+ function _object_spread_props(target, source) {
44
+ source = source != null ? source : {};
45
+ if (Object.getOwnPropertyDescriptors) {
46
+ Object.defineProperties(target, Object.getOwnPropertyDescriptors(source));
47
+ } else {
48
+ ownKeys(Object(source)).forEach(function(key) {
49
+ Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
50
+ });
51
+ }
52
+ return target;
53
+ }
2
54
  var constants = require('./constants');
3
55
  var spawn = require('./spawn');
4
56
  function normalize(res, options) {
@@ -26,7 +78,7 @@ function normalize(res, options) {
26
78
  }
27
79
  function spawnCallbackSync(command, args, options) {
28
80
  options = options || {};
29
- var syncOptions = Object.assign({}, options || {}, {
81
+ var syncOptions = _object_spread_props(_object_spread({}, options), {
30
82
  env: options.env || process.env,
31
83
  stdio: 'pipe',
32
84
  encoding: 'utf8'
@@ -1 +1 @@
1
- {"version":3,"sources":["spawnCallbackSync.js"],"sourcesContent":["const constants = require('./constants');\nconst spawn = require('./spawn');\n\nfunction normalize(res, options) {\n // pipe if inherited\n if (res.stdout && (options.stdout === 'inherit' || options.stdio === 'inherit')) {\n process.stdout.write(res.stdout);\n res.stdout = null;\n }\n if (res.stderr && (options.stderr === 'inherit' || options.stdio === 'inherit')) {\n process.stderr.write(res.stderr);\n res.stderr = null;\n }\n\n // patch: early node on windows could return null\n if (res.status === null) res.status = 0;\n\n // process errors\n const err = res.status !== 0 ? new Error(`Non-zero exit code: ${res.status}`) : null;\n if (err) {\n for (const key in res) {\n if (constants.spawnKeys.indexOf(key) < 0) continue;\n err[key] = Buffer.isBuffer(res[key]) ? res[key].toString('utf8') : res[key];\n }\n }\n if (err) throw err;\n return res;\n}\n\nfunction spawnCallbackSync(command, args, options) {\n options = options || {};\n\n const syncOptions = Object.assign({}, options || {}, {\n env: options.env || process.env,\n stdio: 'pipe',\n encoding: 'utf8',\n });\n const res = spawn.sync(command, args, syncOptions);\n\n return normalize(res, options);\n}\n\nmodule.exports = spawnCallbackSync;\nmodule.exports.normalize = normalize;\n"],"names":["constants","require","spawn","normalize","res","options","stdout","stdio","process","write","stderr","status","err","Error","key","spawnKeys","indexOf","Buffer","isBuffer","toString","spawnCallbackSync","command","args","syncOptions","Object","assign","env","encoding","sync","module","exports"],"mappings":";AAAA,IAAMA,YAAYC,QAAQ;AAC1B,IAAMC,QAAQD,QAAQ;AAEtB,SAASE,UAAUC,GAAG,EAAEC,OAAO;IAC7B,oBAAoB;IACpB,IAAID,IAAIE,MAAM,IAAKD,CAAAA,QAAQC,MAAM,KAAK,aAAaD,QAAQE,KAAK,KAAK,SAAQ,GAAI;QAC/EC,QAAQF,MAAM,CAACG,KAAK,CAACL,IAAIE,MAAM;QAC/BF,IAAIE,MAAM,GAAG;IACf;IACA,IAAIF,IAAIM,MAAM,IAAKL,CAAAA,QAAQK,MAAM,KAAK,aAAaL,QAAQE,KAAK,KAAK,SAAQ,GAAI;QAC/EC,QAAQE,MAAM,CAACD,KAAK,CAACL,IAAIM,MAAM;QAC/BN,IAAIM,MAAM,GAAG;IACf;IAEA,iDAAiD;IACjD,IAAIN,IAAIO,MAAM,KAAK,MAAMP,IAAIO,MAAM,GAAG;IAEtC,iBAAiB;IACjB,IAAMC,MAAMR,IAAIO,MAAM,KAAK,IAAI,IAAIE,MAAM,AAAC,uBAAiC,OAAXT,IAAIO,MAAM,KAAM;IAChF,IAAIC,KAAK;QACP,IAAK,IAAME,OAAOV,IAAK;YACrB,IAAIJ,UAAUe,SAAS,CAACC,OAAO,CAACF,OAAO,GAAG;YAC1CF,GAAG,CAACE,IAAI,GAAGG,OAAOC,QAAQ,CAACd,GAAG,CAACU,IAAI,IAAIV,GAAG,CAACU,IAAI,CAACK,QAAQ,CAAC,UAAUf,GAAG,CAACU,IAAI;QAC7E;IACF;IACA,IAAIF,KAAK,MAAMA;IACf,OAAOR;AACT;AAEA,SAASgB,kBAAkBC,OAAO,EAAEC,IAAI,EAAEjB,OAAO;IAC/CA,UAAUA,WAAW,CAAC;IAEtB,IAAMkB,cAAcC,OAAOC,MAAM,CAAC,CAAC,GAAGpB,WAAW,CAAC,GAAG;QACnDqB,KAAKrB,QAAQqB,GAAG,IAAIlB,QAAQkB,GAAG;QAC/BnB,OAAO;QACPoB,UAAU;IACZ;IACA,IAAMvB,MAAMF,MAAM0B,IAAI,CAACP,SAASC,MAAMC;IAEtC,OAAOpB,UAAUC,KAAKC;AACxB;AAEAwB,OAAOC,OAAO,GAAGV;AACjBS,OAAOC,OAAO,CAAC3B,SAAS,GAAGA"}
1
+ {"version":3,"sources":["spawnCallbackSync.js"],"sourcesContent":["const constants = require('./constants');\nconst spawn = require('./spawn');\n\nfunction normalize(res, options) {\n // pipe if inherited\n if (res.stdout && (options.stdout === 'inherit' || options.stdio === 'inherit')) {\n process.stdout.write(res.stdout);\n res.stdout = null;\n }\n if (res.stderr && (options.stderr === 'inherit' || options.stdio === 'inherit')) {\n process.stderr.write(res.stderr);\n res.stderr = null;\n }\n\n // patch: early node on windows could return null\n if (res.status === null) res.status = 0;\n\n // process errors\n const err = res.status !== 0 ? new Error(`Non-zero exit code: ${res.status}`) : null;\n if (err) {\n for (const key in res) {\n if (constants.spawnKeys.indexOf(key) < 0) continue;\n err[key] = Buffer.isBuffer(res[key]) ? res[key].toString('utf8') : res[key];\n }\n }\n if (err) throw err;\n return res;\n}\n\nfunction spawnCallbackSync(command, args, options) {\n options = options || {};\n const syncOptions = { ...options, env: options.env || process.env, stdio: 'pipe', encoding: 'utf8' };\n const res = spawn.sync(command, args, syncOptions);\n return normalize(res, options);\n}\n\nmodule.exports = spawnCallbackSync;\nmodule.exports.normalize = normalize;\n"],"names":["constants","require","spawn","normalize","res","options","stdout","stdio","process","write","stderr","status","err","Error","key","spawnKeys","indexOf","Buffer","isBuffer","toString","spawnCallbackSync","command","args","syncOptions","env","encoding","sync","module","exports"],"mappings":";;;;;;;;;;;;;;;;;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MF,MAAMwB,IAAI,CAACL,SAASC,MAAMC;IACtC,OAAOpB,UAAUC,KAAKC;AACxB;AAEAsB,OAAOC,OAAO,GAAGR;AACjBO,OAAOC,OAAO,CAACzB,SAAS,GAAGA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cross-spawn-cb",
3
- "version": "1.1.3",
3
+ "version": "1.2.0",
4
4
  "description": "Cross spawn with a completion callback",
5
5
  "keywords": [
6
6
  "cross-spawn",
@@ -27,27 +27,25 @@
27
27
  "version": "tsds version"
28
28
  },
29
29
  "dependencies": {
30
- "buffer-v6-polyfill": "^1.0.5",
31
30
  "call-once-fn": "^1.0.1",
32
- "core-js": "^3.39.0",
33
31
  "cross-spawn": "^7.0.6",
34
- "function-exec-sync": "^1.0.3",
35
- "next-tick": "^1.1.0",
36
- "semver": "^5.7.1"
32
+ "function-exec-sync": "^1.1.1",
33
+ "next-tick": "^1.1.0"
37
34
  },
38
35
  "devDependencies": {
39
36
  "@biomejs/biome": "^1.9.4",
40
37
  "@types/mocha": "^10.0.10",
41
- "@types/node": "^14.18.63",
38
+ "@types/node": "^22.10.2",
42
39
  "cr": "^0.1.0",
43
40
  "depcheck": "^1.4.7",
44
41
  "is-version": "^0.2.1",
45
42
  "mocha-compat": "^3.6.2",
46
- "node-install-release": "^1.4.3",
43
+ "node-install-release": "^1.4.4",
47
44
  "node-resolve-versions": "^1.0.0",
48
45
  "node-version-utils": "^1.0.2",
49
- "ts-dev-stack": "^1.4.0"
46
+ "ts-dev-stack": "^1.5.2"
50
47
  },
48
+ "packageManager": "npm@11.0.0+sha512.11dff29565d2297c74e7c594a9762581bde969f0aa5cbe6f5b3644bf008a16c065ece61094d9ffbb81125be38df8e1ba43eb8244b3d30c61eb797e9a2440e3ec",
51
49
  "engines": {
52
50
  "node": ">=0.8"
53
51
  },