src/openpgp.js
async function convertStreams(obj, streaming, keys=[]) {
  if (Object.prototype.isPrototypeOf(obj) && !Uint8Array.prototype.isPrototypeOf(obj)) {
    await Promise.all(Object.entries(obj).map(async ([key, value]) => { // recursively search all children
      if (util.isStream(value) || keys.includes(key)) {
        obj[key] = await convertStream(value, streaming);
      } else {
        await convertStreams(obj[key], streaming);
      }
    }));
  }
  return obj;
}
async function convertStreams(obj, streaming, keys=[]) {
  if (Object.prototype.isPrototypeOf(obj) && !Uint8Array.prototype.isPrototypeOf(obj)) {
    await Promise.all(Object.entries(obj).map(async ([key, value]) => { // recursively search all children
      if (util.isStream(value) || keys.includes(key)) {
        obj[key] = await convertStream(value, streaming);
      } else {
        await convertStreams(obj[key], streaming);
      }
    }));
  }
  return obj;
}
async function convertStreams ( obj , streaming , keys = [ ] ) { if ( Object . prototype . isPrototypeOf ( obj ) && ! Uint8Array . prototype . isPrototypeOf ( obj ) ) { await Promise . all ( Object . entries ( obj ) . map ( async ( [ key , value ] ) => { // recursively search all children if ( util . isStream ( value ) || keys . includes ( key ) ) { obj [ key ] = await convertStream ( value , streaming ) ; } else { await convertStreams ( obj [ key ] , streaming ) ; } } ) ) ; } return obj ; }
Convert object properties from Stream
@param  {Object} obj                    the data to convert
@param  {'web'|'node'|false} streaming  (optional) whether to return ReadableStreams
@param  {Array<String>} keys            (optional) which keys to return as streams, if possible
@returns {Object}                       the data in the respective format
Convert object properties from Stream