Skip to content

Commit

Permalink
deps(dev): bump aegir from 37.12.1 to 38.1.7 (libp2p#30)
Browse files Browse the repository at this point in the history
* deps(dev): bump aegir from 37.12.1 to 38.1.7

Bumps [aegir](https://github.com/ipfs/aegir) from 37.12.1 to 38.1.7.
- [Release notes](https://github.com/ipfs/aegir/releases)
- [Changelog](https://github.com/ipfs/aegir/blob/master/CHANGELOG.md)
- [Commits](ipfs/aegir@v37.12.1...v38.1.7)

---
updated-dependencies:
- dependency-name: aegir
  dependency-type: direct:development
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

* chore: fix linting

---------

Signed-off-by: dependabot[bot] <[email protected]>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: achingbrain <[email protected]>
  • Loading branch information
dependabot[bot] and achingbrain authored Jun 15, 2023
1 parent bda0a65 commit 42a4d8b
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,8 @@
"@libp2p/interface-metrics": "^4.0.0"
},
"devDependencies": {
"aegir": "^37.0.7",
"@types/sinon": "^10.0.15",
"aegir": "^39.0.10",
"sinon": "^15.0.1",
"sinon-ts": "^1.0.0"
}
Expand Down
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,24 +17,24 @@ class TrackedMap<K, V> extends Map<K, V> {
this.updateComponentMetric()
}

set (key: K, value: V) {
set (key: K, value: V): this {
super.set(key, value)
this.updateComponentMetric()
return this
}

delete (key: K) {
delete (key: K): boolean {
const deleted = super.delete(key)
this.updateComponentMetric()
return deleted
}

clear () {
clear (): void {
super.clear()
this.updateComponentMetric()
}

private updateComponentMetric () {
private updateComponentMetric (): void {
this.metric.update(this.size)
}
}
Expand Down
4 changes: 2 additions & 2 deletions test/index.spec.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { expect } from 'aegir/chai'
import { stubInterface } from 'sinon-ts'
import { trackedMap } from '../src/index.js'
import type { SinonStubbedInstance } from 'sinon'
import type { Metric, Metrics } from '@libp2p/interface-metrics'
import { stubInterface } from 'sinon-ts'
import type { SinonStubbedInstance } from 'sinon'

describe('tracked-map', () => {
let metrics: SinonStubbedInstance<Metrics>
Expand Down

0 comments on commit 42a4d8b

Please sign in to comment.