Skip to content

Commit

Permalink
fix: remove need for unsafe-eval
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasgloning committed Mar 9, 2024
1 parent 708c55c commit cf218da
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion lib/dataconnection/StreamConnection/Cbor.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@
import type { Peer } from "../../peer.js";
import { Decoder, Encoder } from "cbor-x";
import {
Decoder as DecoderNoEval,
Encoder as EncoderNoEval,
//@ts-expect-error: Cbor doesn’t provide types for the "no-eval" version
} from "cbor-x/index-no-eval";
import { StreamConnection } from "./StreamConnection.js";
import type { Decoder as DecoderT, Encoder as EncoderT } from "cbor-x";

const Decoder: DecoderT = DecoderNoEval;
const Encoder: EncoderT = EncoderNoEval;

const NullValue = Symbol.for(null);

Expand Down

0 comments on commit cf218da

Please sign in to comment.