index.js
function _mapSubmitHashesRespToProofHandles(respArray) {
  if (!_isArray(respArray) && !respArray.length)
    throw new Error('_mapSubmitHashesRespToProofHandles arg must be an Array')

  let proofHandles = []
  let groupIdList = []
  if (respArray[0] && respArray[0].hashes) {
    _forEach(respArray[0].hashes, () => {
      groupIdList.push(uuidv1())
    })
  }

  _forEach(respArray, resp => {
    _forEach(resp.hashes, (hash, idx) => {
      let handle = {}

      handle.uri = resp.meta.submitted_to
      handle.hash = hash.hash
      handle.hashIdNode = hash.hash_id_node
      handle.groupId = groupIdList[idx]
      proofHandles.push(handle)
    })
  })

  return proofHandles
}
function _mapSubmitHashesRespToProofHandles(respArray) {
  if (!_isArray(respArray) && !respArray.length)
    throw new Error('_mapSubmitHashesRespToProofHandles arg must be an Array')

  let proofHandles = []
  let groupIdList = []
  if (respArray[0] && respArray[0].hashes) {
    _forEach(respArray[0].hashes, () => {
      groupIdList.push(uuidv1())
    })
  }

  _forEach(respArray, resp => {
    _forEach(resp.hashes, (hash, idx) => {
      let handle = {}

      handle.uri = resp.meta.submitted_to
      handle.hash = hash.hash
      handle.hashIdNode = hash.hash_id_node
      handle.groupId = groupIdList[idx]
      proofHandles.push(handle)
    })
  })

  return proofHandles
}
function _mapSubmitHashesRespToProofHandles ( respArray ) { if ( ! _isArray ( respArray ) && ! respArray . length ) throw new Error ( '_mapSubmitHashesRespToProofHandles arg must be an Array' ) let proofHandles = [ ] let groupIdList = [ ] if ( respArray [ 0 ] && respArray [ 0 ] . hashes ) { _forEach ( respArray [ 0 ] . hashes , ( ) => { groupIdList . push ( uuidv1 ( ) ) } ) } _forEach ( respArray , resp => { _forEach ( resp . hashes , ( hash , idx ) => { let handle = { } handle . uri = resp . meta . submitted_to handle . hash = hash . hash handle . hashIdNode = hash . hash_id_node handle . groupId = groupIdList [ idx ] proofHandles . push ( handle ) } ) } ) return proofHandles }
Map the JSON API response from submitting a hash to a Node to a
more accessible form that can also be used as the input arg to
getProofs function.

@param {Array} respArray - An Array of responses, one for each Node submitted to
@returns {Array<{uri: String, hash: String, hashIdNode: String}>} An Array of proofHandles
Map the JSON API response from submitting a hash to a Node to a more accessible form that can also be used as the input arg to getProofs function .