docs: Formatting.

This commit is contained in:
Hayden Young
2023-06-24 23:50:44 +01:00
parent 3ceb2aac6c
commit 9befa48a7a
4 changed files with 18 additions and 9 deletions

View File

@@ -91,6 +91,15 @@ const Database = async ({ ipfs, identity, address, name, access, directory, meta
const log = await Log(identity, { logId: address, access, entryStorage, headsStorage, indexStorage })
/**
* Event emitter that emits Database changes.
* @†ype EventEmitter
* @fires update when addOperation or applyOperation completes.
* @fires close when the database is successfully closed.
* @fires drop when the database is successfully dropped.
* @memberof module:Sync~Sync
* @instance
*/
const events = new EventEmitter()
const queue = new PQueue({ concurrency: 1 })

View File

@@ -83,8 +83,8 @@ const Documents = ({ indexBy } = DefaultOptions) => async ({ ipfs, identity, add
* @function
* @param {function(Object)} findFn A function for querying for specific
* results.
*
* The findFn function's signature takes the form `function(doc)` where doc
*
* The findFn function's signature takes the form `function(doc)` where doc
* is a document's value property. The function should return true if the
* document is found, false otherwise.
* @return {Array} Found documents.

View File

@@ -81,7 +81,7 @@ const Sync = async ({ ipfs, log, events, onSynced, start, timeout }) => {
/**
* Callback function when new heads have been received from other peers.
* @callback module:Sync~onSynced
* @callback module:Sync~Sync#onSynced
* @param {PeerID} peerId PeerID of the peer who we received heads from
* @param {Entry[]} heads An array of Log entries
*/
@@ -130,12 +130,12 @@ const Sync = async ({ ipfs, log, events, onSynced, start, timeout }) => {
const peers = new Set()
/**
* Event emitter that emits updates.
* @name events
* Event emitter that emits Sync changes.
* @†ype EventEmitter
* @fires join when a peer has connected and heads were exchanged
* @fires leave when a peer disconnects
* @fires error when an error occurs
* @fires module:Sync~Sync#join when a peer has connected and heads are
* exchanged
* @fires module:Sync~Sync#leave when a peer disconnects
* @fires module:Sync~Sync#error when an error occurs
* @memberof module:Sync~Sync
* @instance
*/

View File

@@ -1,5 +1,5 @@
import { strictEqual, notStrictEqual, deepStrictEqual } from 'assert'
import { default as OrbitDBAddress, isValidAddress, parseAddress } from '../src/address.js'
import OrbitDBAddress, { isValidAddress, parseAddress } from '../src/address.js'
describe('Address', function () {
describe('Creating an address from full address string', () => {