Skip to content

Commit bab8d6f

Browse files
fixing some type errors; removing unneeded function from a crypto module
1 parent 90f2dd1 commit bab8d6f

File tree

3 files changed

+3
-6
lines changed

3 files changed

+3
-6
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,7 @@
7070
"test:build": "tsc",
7171
"test:mocha": "mocha",
7272
"test": "run-s test:*",
73+
"tsc": "tsc --noEmit",
7374
"coverage": "run-s coverage:clean test:build coverage:nyc:*",
7475
"coverage:clean": "rimraf coverage",
7576
"coverage:nyc:test": "nyc mocha",

src/helpers/Crypto.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
export function getCrypto<T = any>(): T {
2-
return global.DWA_BROWSER ? global.window.crypto : require("./crypto/node").getCrypto();
3-
}
4-
5-
export function generateRandomBytes() {
6-
return global.DWA_BROWSER ? getCrypto().getRandomValues(new Uint8Array(1)) : getCrypto().randomBytes(1);
2+
return global.DWA_BROWSER ? (global.window.crypto as T) : require("./crypto/node").getCrypto();
73
}

src/utils/Utility.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type * as Core from "../types";
2-
import { generateRandomBytes, getCrypto } from "../helpers/Crypto";
2+
import { getCrypto } from "../helpers/Crypto";
33
import { isUuid, extractUuid, parsePagingCookie } from "../helpers/Regex";
44

55
declare var GetGlobalContext: any;

0 commit comments

Comments
 (0)