Skip to content

Commit

Permalink
feat!: use named exports to expose different hashers (#459)
Browse files Browse the repository at this point in the history
* Use named exports to expose hashers

* Add types reference for named exports
  • Loading branch information
nazarhussain authored Jan 23, 2025
1 parent 57d14f1 commit f763c8a
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
29 changes: 27 additions & 2 deletions packages/persistent-merkle-tree/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,33 @@
"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",
"types": "./lib/index.d.ts"
},
"./hashtree": {
"import": "./lib/hasher/hashtree.js",
"types": "./lib/hasher/hashtree.d.ts"
},
"./noble": {
"import": "./lib/hasher/noble.js",
"types": "./lib/hasher/noble.d.ts"
},
"./as-sha256": {
"import": "./lib/hasher/as-sha256.js",
"types": "./lib/hasher/as-sha256.d.ts"
}
},
"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 f763c8a

Please sign in to comment.