*Update dist

This commit is contained in:
Derrick Hammer 2023-04-08 22:32:14 -04:00
parent 1028fc1bb0
commit 99f7fe9976
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
3 changed files with 12 additions and 9 deletions

2
lib/index.d.ts vendored
View File

@ -1,3 +1,3 @@
import type { IBls } from "./types.js";
declare let bls: IBls;
export declare const bls: () => Promise<IBls>;
export default bls;

View File

@ -1,6 +1,7 @@
import { getImplementation } from "./getImplementation.js";
// Thanks https://github.com/iliakan/detect-node/blob/master/index.esm.js
const isNode = Object.prototype.toString.call(typeof process !== "undefined" ? process : 0) === "[object process]";
export const bls = async () => {
let bls;
try {
bls = await getImplementation(isNode ? "blst-native" : "herumi");
@ -8,4 +9,6 @@ try {
catch (e) {
bls = await getImplementation("herumi");
}
return bls;
};
export default bls;

File diff suppressed because one or more lines are too long