You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
11 lines
353 B
TypeScript
11 lines
353 B
TypeScript
import * as wrappers from 'libsodium-wrappers-sumo';
|
|
|
|
type LibSodiumWrappers = typeof wrappers;
|
|
|
|
export async function getSodiumNode() {
|
|
// don't ask me why, but when called from node we have to do this as the types are incorrect?!
|
|
const anyWrappers = wrappers as any;
|
|
await anyWrappers.ready;
|
|
return anyWrappers.default as LibSodiumWrappers;
|
|
}
|