Skip to content
This repository has been archived by the owner on Mar 10, 2020. It is now read-only.

use modular async #350

Merged
merged 1 commit into from
Aug 17, 2016
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src/add-to-dagnode-transform.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
'use strict'

const async = require('async')
const map = require('async/map')
const getDagNode = require('./get-dagnode')

// transform { Hash: '...' } objects into { path: 'string', node: DAGNode }
Expand All @@ -9,7 +9,7 @@ module.exports = function (err, res, send, done) {
return done(err)
}

async.map(res, function map (entry, next) {
map(res, function map (entry, next) {
getDagNode(send, entry.Hash, function (err, node) {
if (err) {
return next(err)
Expand Down
4 changes: 2 additions & 2 deletions src/get-dagnode.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

const DAGNode = require('ipfs-merkle-dag').DAGNode
const bl = require('bl')
const async = require('async')
const parallel = require('async/parallel')

module.exports = function (send, hash, cb) {
// Retrieve the object and its data in parallel, then produce a DAGNode
// instance using this information.
async.parallel([
parallel([
function get (done) {
send('object/get', hash, null, null, done)
},
Expand Down