lib/client/index.js
function checkBinaryReady(uuid) {
      if (!(uuid in api._blobs && uuid in api._binaryMessages)) {
        return;
      }
      log('receive full binary message', uuid);
      var blob = api._blobs[uuid];
      var msg = api._binaryMessages[uuid];

      delete api._blobs[uuid];
      delete api._binaryMessages[uuid];

      var blobToDeliver;
      if (isBrowser) {
        blobToDeliver = blobUtil.createBlob([blob], {type: msg.contentType});
      } else {
        blobToDeliver = blob;
        blob.type = msg.contentType; // non-standard, but we do it for the tests
      }

      msg.cb(null, blobToDeliver);
    }
function checkBinaryReady(uuid) {
      if (!(uuid in api._blobs && uuid in api._binaryMessages)) {
        return;
      }
      log('receive full binary message', uuid);
      var blob = api._blobs[uuid];
      var msg = api._binaryMessages[uuid];

      delete api._blobs[uuid];
      delete api._binaryMessages[uuid];

      var blobToDeliver;
      if (isBrowser) {
        blobToDeliver = blobUtil.createBlob([blob], {type: msg.contentType});
      } else {
        blobToDeliver = blob;
        blob.type = msg.contentType; // non-standard, but we do it for the tests
      }

      msg.cb(null, blobToDeliver);
    }
function checkBinaryReady ( uuid ) { if ( ! ( uuid in api . _blobs && uuid in api . _binaryMessages ) ) { return ; } log ( 'receive full binary message' , uuid ) ; var blob = api . _blobs [ uuid ] ; var msg = api . _binaryMessages [ uuid ] ; delete api . _blobs [ uuid ] ; delete api . _binaryMessages [ uuid ] ; var blobToDeliver ; if ( isBrowser ) { blobToDeliver = blobUtil . createBlob ( [ blob ] , { type : msg . contentType } ) ; } else { blobToDeliver = blob ; blob . type = msg . contentType ; // non-standard, but we do it for the tests } msg . cb ( null , blobToDeliver ) ; }
binary messages come in two parts; wait until we've received both
binary messages come in two parts ; wait until we ve received both