Skip to content
This repository has been archived by the owner on Jul 21, 2023. It is now read-only.

Commit

Permalink
fix!: update deps (#5)
Browse files Browse the repository at this point in the history
BREAKING CHANGE: uses new peer-id interface
  • Loading branch information
achingbrain authored Jun 28, 2022
1 parent 46bff3f commit 89e975a
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 22 deletions.
38 changes: 21 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,32 @@
# libp2p-peer-connections <!-- omit in toc -->
# @libp2p/peer-collections <!-- omit in toc -->

[![test & maybe release](https://github.com/libp2p/js-libp2p-peer-collections/actions/workflows/js-test-and-release.yml/badge.svg)](https://github.com/libp2p/js-libp2p-peer-collections/actions/workflows/js-test-and-release.yml)
[![libp2p.io](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/)
[![IRC](https://img.shields.io/badge/freenode-%23libp2p-yellow.svg?style=flat-square)](http://webchat.freenode.net/?channels=%23libp2p)
[![Discuss](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg?style=flat-square)](https://discuss.libp2p.io)
[![codecov](https://img.shields.io/codecov/c/github/libp2p/js-libp2p-peer-collections.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p-peer-collections)
[![CI](https://img.shields.io/github/workflow/status/libp2p/js-libp2p-interfaces/test%20&%20maybe%20release/master?style=flat-square)](https://github.com/libp2p/js-libp2p-peer-collections/actions/workflows/js-test-and-release.yml)

> store values against peer ids
> Stores values against a peer id
## Table of Contents <!-- omit in toc -->
## Table of contents <!-- omit in toc -->

- [Install](#install)
- [Description](#description)
- [Example](#example)
- [Installation](#installation)
- [License](#license)
- [Contribution](#contribution)
- [Contribution](#contribution)

## Install

```console
$ npm i @libp2p/peer-collections
```

## Description

We can't use PeerIds as collection keys because collection keys are compared using same-value-zero equality, so this is just a group of collections that stringifies PeerIds before storing them.
We can't use PeerIds as collection keys because collection keys are compared using same-value-zero equality, so this is just a group of collections that stringifies PeerIds before storing them.

PeerIds cache stringified versions of themselves so this should be a cheap operation.
PeerIds cache stringified versions of themselves so this should be a cheap operation.

## Example

Expand All @@ -33,19 +43,13 @@ const list = peerList()
list.push(peerId)
```

## Installation

```console
$ npm i @libp2p/peer-collections
```

## License

Licensed under either of

* Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / http://www.apache.org/licenses/LICENSE-2.0)
* MIT ([LICENSE-MIT](LICENSE-MIT) / http://opensource.org/licenses/MIT)
- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)

### Contribution
## Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@
],
"exports": {
".": {
"types": "./dist/src/index.d.ts",
"import": "./dist/src/index.js"
}
},
Expand Down Expand Up @@ -133,7 +134,7 @@
"release": "aegir release"
},
"dependencies": {
"@libp2p/interfaces": "^2.0.0",
"@libp2p/interface-peer-id": "^1.0.4",
"@libp2p/peer-id": "^1.1.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/list.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { PeerId } from '@libp2p/interfaces/peer-id'
import type { PeerId } from '@libp2p/interface-peer-id'
import { peerIdFromString } from '@libp2p/peer-id'
import { mapIterable } from './util.js'

Expand Down
2 changes: 1 addition & 1 deletion src/map.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { PeerId } from '@libp2p/interfaces/peer-id'
import type { PeerId } from '@libp2p/interface-peer-id'
import { peerIdFromString } from '@libp2p/peer-id'
import { mapIterable } from './util.js'

Expand Down
2 changes: 1 addition & 1 deletion src/set.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { PeerId } from '@libp2p/interfaces/peer-id'
import type { PeerId } from '@libp2p/interface-peer-id'
import { peerIdFromString } from '@libp2p/peer-id'
import { mapIterable } from './util.js'

Expand Down
2 changes: 1 addition & 1 deletion test/set.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { expect } from 'aegir/chai'
import { PeerSet } from '../src/index.js'
import { createEd25519PeerId } from '@libp2p/peer-id-factory'
import { peerIdFromBytes } from '@libp2p/peer-id'
import type { PeerId } from '@libp2p/interfaces/peer-id'
import type { PeerId } from '@libp2p/interface-peer-id'

describe('peer-set', () => {
it('should return a set', async () => {
Expand Down

0 comments on commit 89e975a

Please sign in to comment.