Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: use the same noop everywhere #511

Merged
merged 2 commits into from
Mar 25, 2024
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: 1 addition & 3 deletions src/datatype/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { validate } from '@mapeo/schema'
import { getTableConfig } from 'drizzle-orm/sqlite-core'
import { eq, inArray, placeholder } from 'drizzle-orm'
import { randomBytes } from 'node:crypto'
import { deNullify } from '../utils.js'
import { noop, deNullify } from '../utils.js'
import crypto from 'hypercore-crypto'
import { TypedEmitter } from 'tiny-typed-emitter'

Expand Down Expand Up @@ -291,5 +291,3 @@ export class DataType extends TypedEmitter {
this.emit('updated-docs', updatedDocs)
}
}

function noop() {}
3 changes: 1 addition & 2 deletions src/discovery/local-discovery.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { TypedEmitter } from 'tiny-typed-emitter'
import net from 'node:net'
import NoiseSecretStream from '@hyperswarm/secret-stream'
import { once } from 'node:events'
import { noop } from '../utils.js'
import { DnsSd } from './dns-sd.js'
import { isPrivate } from 'bogon'
import StartStopStateMachine from 'start-stop-state-machine'
Expand Down Expand Up @@ -299,5 +300,3 @@ function getAddress(server) {
}
return addr
}

function noop() {}
4 changes: 1 addition & 3 deletions src/local-peers.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// @ts-check
import { TypedEmitter } from 'tiny-typed-emitter'
import Protomux from 'protomux'
import { assert, ExhaustivenessError, keyToId } from './utils.js'
import { assert, ExhaustivenessError, keyToId, noop } from './utils.js'
import { isBlank } from './lib/string.js'
import cenc from 'compact-encoding'
import {
Expand Down Expand Up @@ -626,8 +626,6 @@ function parseProjectJoinDetails(data) {
return result
}

function noop() {}

/**
* We can temporarily have more than 1 peer for a device while connections are
* deduplicating. We don't expose these duplicate connections until only one
Expand Down
Loading