orbitdb/test/test-utils.js
haad 8f990e0ccc Immutable ipfs-log
Use immutable ipfs-log.
Simplify internals.
Remove obsolete dependencies.
Update dependencies.
Use @dignifiedquire's mapSeries for Promises.
Split tests to individual stores.
Improve tests.
Fix build process.
Build size down to 121kb.
Fix benchmarks and examples.
Move Cache to Stores (and to its own module).
2017-03-21 18:13:58 +01:00

19 lines
350 B
JavaScript

'use strict'
// Helper functions
exports.hasIpfsApiWithPubsub = (ipfs) => {
return ipfs.object.get !== undefined
&& ipfs.object.put !== undefined
&& ipfs.pubsub.publish !== undefined
&& ipfs.pubsub.subscribe !== undefined
}
exports.first = (arr) => {
return arr[0]
}
exports.last = (arr) => {
return arr[arr.length - 1]
}