mirror of
https://github.com/cloudflare/wrangler-action.git
synced 2024-11-25 11:24:46 +01:00
20 lines
388 B
JavaScript
20 lines
388 B
JavaScript
'use strict';
|
|
const EventEmitter = require('events');
|
|
|
|
class ChildProcessPromise extends Promise {
|
|
constructor(executer) {
|
|
let resolve;
|
|
let reject;
|
|
|
|
super((res, rej) => {
|
|
resolve = res;
|
|
reject = rej;
|
|
});
|
|
|
|
executer(resolve, reject, this);
|
|
}
|
|
}
|
|
|
|
Object.assign(ChildProcessPromise.prototype, EventEmitter.prototype);
|
|
|
|
module.exports = ChildProcessPromise;
|