function maybeSendJobToMainProcess(job) {
  if (_messaging.isWorker && gatsbyWorkerMessenger) {
    const deferredWorkerPromise = (0, _pDefer.default)();
    const msg = {
      type: _types.MESSAGE_TYPES.JOB_CREATED,
      payload: job
    };
    gatsbyWorkerMessenger.sendMessage(msg); // holds on to promise

    deferredWorkerPromises.set(job.id, deferredWorkerPromise);
    return deferredWorkerPromise.promise;
  }

  return undefined;
}
/**
 * Forwards job to main process (if executed in worker context) and returns
 * a promise. Will return `undefined` if called not in worker context.
 */
Forwards job to main process (if executed in worker context) and returns
a promise. Will return `undefined` if called not in worker context.
Forwards job to main process ( if executed in worker context ) and returns a promise . Will return ` undefined ` if called not in worker context .
function maybeSendJobToMainProcess(job) {
  if (_messaging.isWorker && gatsbyWorkerMessenger) {
    const deferredWorkerPromise = (0, _pDefer.default)();
    const msg = {
      type: _types.MESSAGE_TYPES.JOB_CREATED,
      payload: job
    };
    gatsbyWorkerMessenger.sendMessage(msg); 
    deferredWorkerPromises.set(job.id, deferredWorkerPromise);
    return deferredWorkerPromise.promise;
  }
  return undefined;
}
function maybeSendJobToMainProcess ( job ) { if ( _messaging . isWorker && gatsbyWorkerMessenger ) { const deferredWorkerPromise = ( 0 , _pDefer . default ) ( ) ; const msg = { type : _types . MESSAGE_TYPES . JOB_CREATED , payload : job } ; gatsbyWorkerMessenger . sendMessage ( msg ) ; deferredWorkerPromises . set ( job . id , deferredWorkerPromise ) ; return deferredWorkerPromise . promise ; } return undefined ; }
Forwards job to main process (if executed in worker context) and returns
 a promise.
Forwards job to main process ( if executed in worker context ) and returns a promise .
// holds on to promise