File tree Expand file tree Collapse file tree 3 files changed +9
-16
lines changed
Expand file tree Collapse file tree 3 files changed +9
-16
lines changed Original file line number Diff line number Diff line change 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
73class ConvexPlatformInfo implements Info {
84 platformData ( ) : PlatformData {
Original file line number Diff line number Diff line change 11import type { Crypto , Hasher , Hmac } from "@launchdarkly/js-server-sdk-common" ;
2- import { algo as CryptoAlgo } from "crypto-js" ;
32import CryptoJS from "crypto-js" ;
4- import Base64 from "crypto-js/enc-base64" ;
5- import Hex from "crypto-js/enc-hex" ;
63
74type SupportedHashAlgorithm = "sha1" | "sha256" ;
85type 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 (
Original file line number Diff line number Diff line change 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 ,
You can’t perform that action at this time.
0 commit comments