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

deps: bump protons-runtime from 4.0.2 to 5.0.0 #73

Merged
merged 5 commits into from
Mar 10, 2023
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: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -170,13 +170,13 @@
"@libp2p/interface-dht": "^2.0.0",
"@libp2p/interfaces": "^3.2.0",
"multiformats": "^11.0.0",
"protons-runtime": "^4.0.1",
"protons-runtime": "^5.0.0",
"uint8arraylist": "^2.1.1",
"uint8arrays": "^4.0.2"
},
"devDependencies": {
"@libp2p/crypto": "^1.0.11",
"aegir": "^38.1.7",
"protons": "^6.0.0"
"protons": "^7.0.2"
}
}
11 changes: 6 additions & 5 deletions src/record.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,11 @@
/* eslint-disable complexity */
/* eslint-disable @typescript-eslint/no-namespace */
/* eslint-disable @typescript-eslint/no-unnecessary-boolean-literal-compare */
/* eslint-disable @typescript-eslint/no-empty-interface */

import { encodeMessage, decodeMessage, message } from 'protons-runtime'
import type { Uint8ArrayList } from 'uint8arraylist'
import type { Codec } from 'protons-runtime'
import type { Uint8ArrayList } from 'uint8arraylist'

export interface Record {
key: Uint8Array
Expand All @@ -23,17 +24,17 @@ export namespace Record {
w.fork()
}

if (opts.writeDefaults === true || (obj.key != null && obj.key.byteLength > 0)) {
if ((obj.key != null && obj.key.byteLength > 0)) {
w.uint32(10)
w.bytes(obj.key)
}

if (opts.writeDefaults === true || (obj.value != null && obj.value.byteLength > 0)) {
if ((obj.value != null && obj.value.byteLength > 0)) {
w.uint32(18)
w.bytes(obj.value)
}

if (opts.writeDefaults === true || obj.timeReceived !== '') {
if ((obj.timeReceived != null && obj.timeReceived !== '')) {
w.uint32(42)
w.string(obj.timeReceived)
}
Expand Down Expand Up @@ -76,7 +77,7 @@ export namespace Record {
return _codec
}

export const encode = (obj: Record): Uint8Array => {
export const encode = (obj: Partial<Record>): Uint8Array => {
return encodeMessage(obj, Record.codec())
}

Expand Down