🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

@aragon/apm

Package Overview
Dependencies
Maintainers
8
Versions
32
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@aragon/apm - npm Package Compare versions

Comparing version

to
3.1.1

4

package.json
{
"name": "@aragon/apm",
"version": "3.1.0",
"version": "3.1.1",
"description": "JavaScript library for the Aragon Package Manager",

@@ -30,5 +30,5 @@ "main": "src/index.js",

"ethjs-ens": "^2.0.1",
"ipfs-api": "^26.1.2",
"ipfs-http-client": "^39.0.2",
"semver": "^5.5.0"
}
}

@@ -1,2 +0,2 @@

const ipfsAPI = require('ipfs-api')
const ipfsAPI = require('ipfs-http-client')
const httpProvider = require('./http')()

@@ -31,3 +31,3 @@

return ipfs.files.cat(`${hash}/${path}`)
return ipfs.cat(`${hash}/${path}`)
.then((file) => file.toString('utf8'))

@@ -52,3 +52,3 @@ },

return ipfs.files.catReadableStream(`${hash}/${path}`)
return ipfs.catReadableStream(`${hash}/${path}`)
},

@@ -67,3 +67,3 @@

const hashes = await ipfs.util.addFromFs(path, { recursive: true })
const hashes = await ipfs.addFromFs(path, { recursive: true })
const { hash } = hashes.pop()

@@ -70,0 +70,0 @@

// https://italonascimento.github.io/applying-a-timeout-to-your-promises/
module.exports = function(promise, ms) {
// Create a promise that rejects in <ms> milliseconds
let timeoutInstance;
const timeout = new Promise((resolve, reject) => {
const id = setTimeout(() => {
reject('Timed out in '+ ms + 'ms.')
}, ms)
})
timeoutInstance = setTimeout(() => {
reject(Error("Timed out in " + ms + "ms."));
}, ms);
});
// Returns a race between our timeout and the passed in promise
return Promise.race([
promise,
timeout
])
}
return Promise.race([promise, timeout]).then(res => {
clearTimeout(timeoutInstance);
return res;
}).catch(e => {
clearTimeout(timeoutInstance);
throw e
})
};