Skip to content

Commit

Permalink
Use named exports to expose hashers
Browse files Browse the repository at this point in the history
  • Loading branch information
nazarhussain committed Jan 23, 2025
1 parent 57d14f1 commit b34b640
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 4 deletions.
25 changes: 23 additions & 2 deletions packages/persistent-merkle-tree/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,29 @@
"version": "0.9.1",
"description": "Merkle tree implemented as a persistent datastructure",
"type": "module",
"main": "./lib/index.js",
"types": "./lib/index.d.ts",
"exports": {
".": {
"import": "./lib/index.js"
},
"./hashtree": {
"import": "./lib/hasher/hashtree.js"
},
"./nobel": {
"import": "./lib/hasher/nobel.js"
},
"./as-sha256": {
"import": "./lib/hasher/as-sha256.js"
}
},
"typesVersions": {
"*": {
"*": [
"*",
"lib/*",
"lib/*/index"
]
}
},
"files": [
"lib"
],
Expand Down
4 changes: 2 additions & 2 deletions setHasher.mjs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Set the hasher to hashtree
// Used to run benchmarks with with visibility into hashtree performance, useful for Lodestar
import {setHasher} from "@chainsafe/persistent-merkle-tree/lib/hasher/index.js";
import {hasher} from "@chainsafe/persistent-merkle-tree/lib/hasher/hashtree.js";
import {setHasher} from "@chainsafe/persistent-merkle-tree";
import {hasher} from "@chainsafe/persistent-merkle-tree/hashtree";
setHasher(hasher);

export {};

0 comments on commit b34b640

Please sign in to comment.