Skip to content

Commit

Permalink
fix: remove need for unsafe-eval
Browse files Browse the repository at this point in the history
As we are still using `commonjs` in our `tsconfig.json` this commit uses
`#paths` to overwrite the import path for the types only.

The types are the same now, but could theoretically drift in the future.
  • Loading branch information
jonasgloning committed May 11, 2024
1 parent d2aff36 commit 3fb31b3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/dataconnection/StreamConnection/Cbor.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import type { Peer } from "../../peer.js";
import { Decoder, Encoder } from "cbor-x";
import { Decoder, Encoder } from "cbor-x/index-no-eval";
import { StreamConnection } from "./StreamConnection.js";

const NullValue = Symbol.for(null);
Expand Down
5 changes: 4 additions & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,10 @@
"skipLibCheck": true,
"isolatedModules": true,
"resolveJsonModule": true,
"lib": ["es2020", "dom"]
"lib": ["es2020", "dom"],
"paths": {
"cbor-x/index-no-eval": ["./node_modules/cbor-x"]
}
},
"exclude": ["node_modules", "dist", "e2e"]
}

0 comments on commit 3fb31b3

Please sign in to comment.