@libp2p/utils 3.0.12-f427cfc9 → 3.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -2,8 +2,8 @@
2
2
 
3
3
  [![libp2p.io](https://img.shields.io/badge/project-libp2p-yellow.svg?style=flat-square)](http://libp2p.io/)
4
4
  [![Discuss](https://img.shields.io/discourse/https/discuss.libp2p.io/posts.svg?style=flat-square)](https://discuss.libp2p.io)
5
- [![codecov](https://img.shields.io/codecov/c/github/libp2p/js-libp2p.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p)
6
- [![CI](https://img.shields.io/github/actions/workflow/status/libp2p/js-libp2p/main.yml?branch=master\&style=flat-square)](https://github.com/libp2p/js-libp2p/actions/workflows/main.yml?query=branch%3Amaster)
5
+ [![codecov](https://img.shields.io/codecov/c/github/libp2p/js-libp2p-utils.svg?style=flat-square)](https://codecov.io/gh/libp2p/js-libp2p-utils)
6
+ [![CI](https://img.shields.io/github/actions/workflow/status/libp2p/js-libp2p-utils/js-test-and-release.yml?branch=master\&style=flat-square)](https://github.com/libp2p/js-libp2p-utils/actions/workflows/js-test-and-release.yml?query=branch%3Amaster)
7
7
 
8
8
  > Package to aggregate shared logic and dependencies for the libp2p ecosystem
9
9
 
@@ -51,7 +51,7 @@ You can check the [API docs](https://libp2p.github.io/js-libp2p-utils).
51
51
 
52
52
  ## API Docs
53
53
 
54
- - <https://libp2p.github.io/js-libp2p/modules/_libp2p_utils.html>
54
+ - <https://libp2p.github.io/js-libp2p-utils>
55
55
 
56
56
  ## License
57
57
 
@@ -19,7 +19,7 @@
19
19
  * // ['/ip4/82.41.53.1/tcp/9000', '/ip4/127.0.0.1/tcp/9000']
20
20
  * ```
21
21
  */
22
- import type { Address } from '@libp2p/interface/peer-store';
22
+ import type { Address } from '@libp2p/interface-peer-store';
23
23
  /**
24
24
  * Compare function for array.sort().
25
25
  * This sort aims to move the private addresses to the end of the array.
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAA"}
@@ -1,5 +1,5 @@
1
1
  import { Address4, Address6 } from '@achingbrain/ip-address';
2
- import { CodeError } from '@libp2p/interface/errors';
2
+ import { CodeError } from '@libp2p/interfaces/errors';
3
3
  import { logger } from '@libp2p/logger';
4
4
  import { multiaddr } from '@multiformats/multiaddr';
5
5
  const log = logger('libp2p:ip-port-to-multiaddr');
@@ -1 +1 @@
1
- {"version":3,"file":"ip-port-to-multiaddr.js","sourceRoot":"","sources":["../../src/ip-port-to-multiaddr.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,QAAQ,EAAE,MAAM,yBAAyB,CAAA;AAC5D,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAA;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,gBAAgB,CAAA;AACvC,OAAO,EAAkB,SAAS,EAAE,MAAM,yBAAyB,CAAA;AAEnE,MAAM,GAAG,GAAG,MAAM,CAAC,6BAA6B,CAAC,CAAA;AAEjD,MAAM,CAAC,MAAM,MAAM,GAAG;IACpB,wBAAwB,EAAE,0BAA0B;IACpD,0BAA0B,EAAE,4BAA4B;IACxD,cAAc,EAAE,gBAAgB;CACjC,CAAA;AAED;;GAEG;AACH,MAAM,UAAU,iBAAiB,CAAE,EAAU,EAAE,IAAqB;IAClE,IAAI,OAAO,EAAE,KAAK,QAAQ,EAAE;QAC1B,MAAM,IAAI,SAAS,CAAC,wBAAwB,EAAE,EAAE,EAAE,MAAM,CAAC,wBAAwB,CAAC,CAAA,CAAC,uEAAuE;KAC3J;IAED,IAAI,OAAO,IAAI,KAAK,QAAQ,EAAE;QAC5B,IAAI,GAAG,QAAQ,CAAC,IAAI,CAAC,CAAA;KACtB;IAED,IAAI,KAAK,CAAC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AAA;KACnD;AACH,CAAC"}
@@ -1,4 +1,4 @@
1
- import type { MultiaddrConnection } from '@libp2p/interface/connection';
1
+ import type { MultiaddrConnection } from '@libp2p/interface-connection';
2
2
  import type { Multiaddr } from '@multiformats/multiaddr';
3
3
  import type { Duplex, Source } from 'it-stream-types';
4
4
  import type { Uint8ArrayList } from 'uint8arraylist';
@@ -0,0 +1,13 @@
1
+ {
2
+ "publicAddressesFirst": "https://libp2p.github.io/js-libp2p-utils/functions/address_sort.publicAddressesFirst.html",
3
+ "something": "https://libp2p.github.io/js-libp2p-utils/functions/address_sort.something.html",
4
+ "arrayEquals": "https://libp2p.github.io/js-libp2p-utils/functions/array_equals.arrayEquals.html",
5
+ "Errors": "https://libp2p.github.io/js-libp2p-utils/variables/ip_port_to_multiaddr.Errors.html",
6
+ "ipPortToMultiaddr": "https://libp2p.github.io/js-libp2p-utils/functions/ip_port_to_multiaddr.ipPortToMultiaddr.html",
7
+ "isLoopback": "https://libp2p.github.io/js-libp2p-utils/functions/multiaddr_is_loopback.isLoopback.html",
8
+ "isPrivate": "https://libp2p.github.io/js-libp2p-utils/functions/multiaddr_is_private.isPrivate.html",
9
+ "StreamOptions": "https://libp2p.github.io/js-libp2p-utils/interfaces/stream_to_ma_conn.StreamOptions.html",
10
+ "StreamProperties": "https://libp2p.github.io/js-libp2p-utils/interfaces/stream_to_ma_conn.StreamProperties.html",
11
+ "Timeline": "https://libp2p.github.io/js-libp2p-utils/interfaces/stream_to_ma_conn.Timeline.html",
12
+ "streamToMaConnection": "https://libp2p.github.io/js-libp2p-utils/functions/stream_to_ma_conn.streamToMaConnection.html"
13
+ }
package/package.json CHANGED
@@ -1,15 +1,19 @@
1
1
  {
2
2
  "name": "@libp2p/utils",
3
- "version": "3.0.12-f427cfc9",
3
+ "version": "3.0.13",
4
4
  "description": "Package to aggregate shared logic and dependencies for the libp2p ecosystem",
5
5
  "license": "Apache-2.0 OR MIT",
6
- "homepage": "https://github.com/libp2p/js-libp2p/tree/master/packages/utils#readme",
6
+ "homepage": "https://github.com/libp2p/js-libp2p-utils#readme",
7
7
  "repository": {
8
8
  "type": "git",
9
- "url": "git+https://github.com/libp2p/js-libp2p.git"
9
+ "url": "git+https://github.com/libp2p/js-libp2p-utils.git"
10
10
  },
11
11
  "bugs": {
12
- "url": "https://github.com/libp2p/js-libp2p/issues"
12
+ "url": "https://github.com/libp2p/js-libp2p-utils/issues"
13
+ },
14
+ "engines": {
15
+ "node": ">=16.0.0",
16
+ "npm": ">=7.0.0"
13
17
  },
14
18
  "type": "module",
15
19
  "types": "./dist/src/index.d.ts",
@@ -71,38 +75,124 @@
71
75
  "sourceType": "module"
72
76
  }
73
77
  },
78
+ "release": {
79
+ "branches": [
80
+ "master"
81
+ ],
82
+ "plugins": [
83
+ [
84
+ "@semantic-release/commit-analyzer",
85
+ {
86
+ "preset": "conventionalcommits",
87
+ "releaseRules": [
88
+ {
89
+ "breaking": true,
90
+ "release": "major"
91
+ },
92
+ {
93
+ "revert": true,
94
+ "release": "patch"
95
+ },
96
+ {
97
+ "type": "feat",
98
+ "release": "minor"
99
+ },
100
+ {
101
+ "type": "fix",
102
+ "release": "patch"
103
+ },
104
+ {
105
+ "type": "docs",
106
+ "release": "patch"
107
+ },
108
+ {
109
+ "type": "test",
110
+ "release": "patch"
111
+ },
112
+ {
113
+ "type": "deps",
114
+ "release": "patch"
115
+ },
116
+ {
117
+ "scope": "no-release",
118
+ "release": false
119
+ }
120
+ ]
121
+ }
122
+ ],
123
+ [
124
+ "@semantic-release/release-notes-generator",
125
+ {
126
+ "preset": "conventionalcommits",
127
+ "presetConfig": {
128
+ "types": [
129
+ {
130
+ "type": "feat",
131
+ "section": "Features"
132
+ },
133
+ {
134
+ "type": "fix",
135
+ "section": "Bug Fixes"
136
+ },
137
+ {
138
+ "type": "chore",
139
+ "section": "Trivial Changes"
140
+ },
141
+ {
142
+ "type": "docs",
143
+ "section": "Documentation"
144
+ },
145
+ {
146
+ "type": "deps",
147
+ "section": "Dependencies"
148
+ },
149
+ {
150
+ "type": "test",
151
+ "section": "Tests"
152
+ }
153
+ ]
154
+ }
155
+ }
156
+ ],
157
+ "@semantic-release/changelog",
158
+ "@semantic-release/npm",
159
+ "@semantic-release/github",
160
+ "@semantic-release/git"
161
+ ]
162
+ },
74
163
  "scripts": {
75
164
  "clean": "aegir clean",
76
165
  "lint": "aegir lint",
77
166
  "dep-check": "aegir dep-check",
78
167
  "build": "aegir build",
168
+ "docs": "aegir docs",
79
169
  "test": "aegir test",
80
170
  "test:chrome": "aegir test -t browser --cov",
81
171
  "test:chrome-webworker": "aegir test -t webworker",
82
172
  "test:firefox": "aegir test -t browser -- --browser firefox",
83
173
  "test:firefox-webworker": "aegir test -t webworker -- --browser firefox",
84
174
  "test:node": "aegir test -t node --cov",
85
- "test:electron-main": "aegir test -t electron-main"
175
+ "test:electron-main": "aegir test -t electron-main",
176
+ "release": "aegir release"
86
177
  },
87
178
  "dependencies": {
88
179
  "@achingbrain/ip-address": "^8.1.0",
89
- "@libp2p/interface": "0.0.1-f427cfc9",
90
- "@libp2p/logger": "2.1.1-f427cfc9",
91
- "@multiformats/multiaddr": "^12.1.3",
92
- "abortable-iterator": "^5.0.1",
180
+ "@libp2p/interface-connection": "^5.0.1",
181
+ "@libp2p/interface-peer-store": "^2.0.0",
182
+ "@libp2p/interfaces": "^3.2.0",
183
+ "@libp2p/logger": "^2.0.0",
184
+ "@multiformats/multiaddr": "^12.0.0",
185
+ "abortable-iterator": "^5.0.0",
93
186
  "is-loopback-addr": "^2.0.1",
94
187
  "it-stream-types": "^2.0.1",
95
188
  "private-ip": "^3.0.0",
96
- "uint8arraylist": "^2.4.3"
189
+ "uint8arraylist": "^2.3.2"
97
190
  },
98
191
  "devDependencies": {
99
- "aegir": "^39.0.10",
192
+ "aegir": "^40.0.0",
100
193
  "it-all": "^3.0.1",
101
194
  "it-pair": "^2.0.6",
102
- "it-pipe": "^3.0.1",
103
- "uint8arrays": "^4.0.3"
104
- },
105
- "typedoc": {
106
- "entryPoint": "./src/index.ts"
195
+ "it-pipe": "^3.0.0",
196
+ "uint8arrays": "^4.0.2"
107
197
  }
108
198
  }
@@ -21,7 +21,7 @@
21
21
  */
22
22
 
23
23
  import { isPrivate } from './multiaddr/is-private.js'
24
- import type { Address } from '@libp2p/interface/peer-store'
24
+ import type { Address } from '@libp2p/interface-peer-store'
25
25
 
26
26
  /**
27
27
  * Compare function for array.sort().
@@ -1,5 +1,5 @@
1
1
  import { Address4, Address6 } from '@achingbrain/ip-address'
2
- import { CodeError } from '@libp2p/interface/errors'
2
+ import { CodeError } from '@libp2p/interfaces/errors'
3
3
  import { logger } from '@libp2p/logger'
4
4
  import { type Multiaddr, multiaddr } from '@multiformats/multiaddr'
5
5
 
@@ -1,6 +1,6 @@
1
1
  import { logger } from '@libp2p/logger'
2
2
  import { abortableSource } from 'abortable-iterator'
3
- import type { MultiaddrConnection } from '@libp2p/interface/connection'
3
+ import type { MultiaddrConnection } from '@libp2p/interface-connection'
4
4
  import type { Multiaddr } from '@multiformats/multiaddr'
5
5
  import type { Duplex, Source } from 'it-stream-types'
6
6
  import type { Uint8ArrayList } from 'uint8arraylist'