Skip to content

Commit

Permalink
formatting fix
Browse files Browse the repository at this point in the history
  • Loading branch information
kkmanos committed Nov 4, 2024
1 parent 382a796 commit 9037d3a
Showing 1 changed file with 15 additions and 15 deletions.
30 changes: 15 additions & 15 deletions src/lib/utils/cbor.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,27 @@
import { Encoder, Options } from "cbor-x";

const encoderDefaults: Options = {
tagUint8Array: false,
useRecords: false,
mapsAsObjects: false,
// @ts-ignore
useTag259ForMaps: false,
tagUint8Array: false,
useRecords: false,
mapsAsObjects: false,
// @ts-ignore
useTag259ForMaps: false,
};

export const cborDecode = (
input: Buffer | Uint8Array,
options: Options = encoderDefaults,
input: Buffer | Uint8Array,
options: Options = encoderDefaults,
): any => {
const params = { ...encoderDefaults, ...options };
const enc = new Encoder(params);
return enc.decode(input);
const params = { ...encoderDefaults, ...options };
const enc = new Encoder(params);
return enc.decode(input);
};

export const cborEncode = (
obj: unknown,
options: Options = encoderDefaults,
obj: unknown,
options: Options = encoderDefaults,
): Buffer => {
const params = { ...encoderDefaults, ...options };
const enc = new Encoder(params);
return enc.encode(obj);
const params = { ...encoderDefaults, ...options };
const enc = new Encoder(params);
return enc.encode(obj);
};

0 comments on commit 9037d3a

Please sign in to comment.