mirror of
https://github.com/orbitdb/orbitdb.git
synced 2025-03-30 15:08:28 +00:00

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).
19 lines
350 B
JavaScript
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]
|
|
}
|