Skip to content
Myr

Simplify `cancel()` method (#226)

Before adoption: this commit came in with the history the project adopted, so no landing records it.

authored by ehmicky · committed by Sindre Sorhus · parent 659f444 · Browse files · 1 file+1 added−5 removed
This commit

State

Before adoption: this commit came in with the history the project adopted, so no landing records it.

Diff stats

1 file+1 added−5 removed

  • other:+1 added−5 removed

1 file+1 added−5 removed

modified:index.js+1 added-5 removed
356 unmodified lines
357 result.stdout = results[1];358 result.stderr = results[2];359 result.all = results[3];360361 if (result.error || result.code !== 0 || result.signal !== null || isCanceled) {361 if (result.error || result.code !== 0 || result.signal !== null) {362 const error = makeError(result, {363 joinedCommand,364 parsed,365 timedOut,
40 unmodified lines
406 // eslint-disable-next-line promise/prefer-await-to-then407 spawned.then = (onFulfilled, onRejected) => handlePromise().then(onFulfilled, onRejected);408 spawned.catch = onRejected => handlePromise().catch(onRejected);409 spawned.cancel = () => {410 if (spawned.killed) {411 return;412 }413410 if (spawned.kill()) {411 isCanceled = true;412 }413 };
58 unmodified lines