Skip to content

Commit bb86267

Browse files
committed
fix typecheck
1 parent c1fbb8b commit bb86267

File tree

3 files changed

+9
-16
lines changed

3 files changed

+9
-16
lines changed

src/sdk/createPlatformInfo.ts

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,4 @@
1-
import type {
2-
Info,
3-
PlatformData,
4-
SdkData,
5-
} from "@launchdarkly/js-server-sdk-common";
1+
import type { Info, PlatformData, SdkData } from "@launchdarkly/js-server-sdk-common";
62

73
class ConvexPlatformInfo implements Info {
84
platformData(): PlatformData {

src/sdk/crypto.ts

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,5 @@
11
import type { Crypto, Hasher, Hmac } from "@launchdarkly/js-server-sdk-common";
2-
import { algo as CryptoAlgo } from "crypto-js";
32
import CryptoJS from "crypto-js";
4-
import Base64 from "crypto-js/enc-base64";
5-
import Hex from "crypto-js/enc-hex";
63

74
type SupportedHashAlgorithm = "sha1" | "sha256";
85
type SupportedOutputEncoding = "base64" | "hex";
@@ -75,10 +72,10 @@ class CryptoJSHasher implements Hasher {
7572

7673
switch (algorithm) {
7774
case "sha1":
78-
algo = CryptoAlgo.SHA1;
75+
algo = CryptoJS.algo.SHA1;
7976
break;
8077
case "sha256":
81-
algo = CryptoAlgo.SHA256;
78+
algo = CryptoJS.algo.SHA256;
8279
break;
8380
default:
8481
throw new Error(
@@ -95,10 +92,10 @@ class CryptoJSHasher implements Hasher {
9592
let enc;
9693
switch (encoding) {
9794
case "base64":
98-
enc = Base64;
95+
enc = CryptoJS.enc.Base64;
9996
break;
10097
case "hex":
101-
enc = Hex;
98+
enc = CryptoJS.enc.Hex;
10299
break;
103100
default:
104101
throw new Error(

tsconfig.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@
1010
"forceConsistentCasingInFileNames": true,
1111
"allowSyntheticDefaultImports": true,
1212
"noErrorTruncation": true,
13-
// We enforce stricter module resolution for Node16 compatibility
14-
// But when building we use Bundler & ESNext for ESM
15-
"module": "Node16",
16-
"moduleResolution": "NodeNext",
13+
// We use Bundler module resolution which is more compatible with
14+
// packages that don't have proper Node16 ESM type definitions
15+
"module": "ESNext",
16+
"moduleResolution": "Bundler",
1717

1818
"composite": true,
1919
"isolatedModules": true,

0 commit comments

Comments
 (0)