mirror of
https://github.com/lensapp/lens.git
synced 2025-05-20 05:10:56 +00:00
Use sync version of random bytes
Signed-off-by: Juho Heikka <juho.heikka@gmail.com>
This commit is contained in:
parent
4b6bfc1232
commit
169bb1b8f6
@ -4,13 +4,12 @@
|
|||||||
*/
|
*/
|
||||||
import { getInjectable } from "@ogre-tools/injectable";
|
import { getInjectable } from "@ogre-tools/injectable";
|
||||||
import { randomBytes } from "crypto";
|
import { randomBytes } from "crypto";
|
||||||
import { promisify } from "util";
|
|
||||||
|
|
||||||
export type RandomBytes = (size: number) => Promise<Buffer>;
|
export type RandomBytes = (size: number) => Buffer;
|
||||||
|
|
||||||
const randomBytesInjectable = getInjectable({
|
const randomBytesInjectable = getInjectable({
|
||||||
id: "random-bytes",
|
id: "random-bytes",
|
||||||
instantiate: (): RandomBytes => promisify(randomBytes),
|
instantiate: (): RandomBytes => randomBytes,
|
||||||
causesSideEffects: true,
|
causesSideEffects: true,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user