This repository was archived by the owner on Jul 21, 2023. It is now read-only.
File tree 2 files changed +8
-7
lines changed
2 files changed +8
-7
lines changed Original file line number Diff line number Diff line change 170
170
"@libp2p/interface-dht" : " ^2.0.0" ,
171
171
"@libp2p/interfaces" : " ^3.2.0" ,
172
172
"multiformats" : " ^11.0.0" ,
173
- "protons-runtime" : " ^4 .0.1 " ,
173
+ "protons-runtime" : " ^5 .0.0 " ,
174
174
"uint8arraylist" : " ^2.1.1" ,
175
175
"uint8arrays" : " ^4.0.2"
176
176
},
177
177
"devDependencies" : {
178
178
"@libp2p/crypto" : " ^1.0.11" ,
179
179
"aegir" : " ^38.1.7" ,
180
- "protons" : " ^6 .0.0 "
180
+ "protons" : " ^7 .0.2 "
181
181
}
182
182
}
Original file line number Diff line number Diff line change 2
2
/* eslint-disable complexity */
3
3
/* eslint-disable @typescript-eslint/no-namespace */
4
4
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
5
+ /* eslint-disable @typescript-eslint/no-empty-interface */
5
6
6
7
import { encodeMessage , decodeMessage , message } from 'protons-runtime'
7
- import type { Uint8ArrayList } from 'uint8arraylist'
8
8
import type { Codec } from 'protons-runtime'
9
+ import type { Uint8ArrayList } from 'uint8arraylist'
9
10
10
11
export interface Record {
11
12
key : Uint8Array
@@ -23,17 +24,17 @@ export namespace Record {
23
24
w . fork ( )
24
25
}
25
26
26
- if ( opts . writeDefaults === true || ( obj . key != null && obj . key . byteLength > 0 ) ) {
27
+ if ( ( obj . key != null && obj . key . byteLength > 0 ) ) {
27
28
w . uint32 ( 10 )
28
29
w . bytes ( obj . key )
29
30
}
30
31
31
- if ( opts . writeDefaults === true || ( obj . value != null && obj . value . byteLength > 0 ) ) {
32
+ if ( ( obj . value != null && obj . value . byteLength > 0 ) ) {
32
33
w . uint32 ( 18 )
33
34
w . bytes ( obj . value )
34
35
}
35
36
36
- if ( opts . writeDefaults === true || obj . timeReceived !== '' ) {
37
+ if ( ( obj . timeReceived != null && obj . timeReceived !== '' ) ) {
37
38
w . uint32 ( 42 )
38
39
w . string ( obj . timeReceived )
39
40
}
@@ -76,7 +77,7 @@ export namespace Record {
76
77
return _codec
77
78
}
78
79
79
- export const encode = ( obj : Record ) : Uint8Array => {
80
+ export const encode = ( obj : Partial < Record > ) : Uint8Array => {
80
81
return encodeMessage ( obj , Record . codec ( ) )
81
82
}
82
83
You can’t perform that action at this time.
0 commit comments