Skip to content

Commit c262c66

Browse files
authored
fix: re-add browser support (#706)
Signed-off-by: Michael Beemer <[email protected]>
1 parent 8e8cfdd commit c262c66

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

libs/shared/flagd-core/src/lib/feature-flag.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { FlagValue } from '@openfeature/core';
2-
import { createHash } from 'crypto';
2+
import { sha1 } from 'object-hash';
33

44
/**
55
* Flagd flag configuration structure mapping to schema definition.
@@ -26,7 +26,7 @@ export class FeatureFlag {
2626
this._defaultVariant = flag['defaultVariant'];
2727
this._variants = new Map<string, FlagValue>(Object.entries(flag['variants']));
2828
this._targeting = flag['targeting'];
29-
this._hash = createHash('sha1').update(JSON.stringify(flag)).digest('base64');
29+
this._hash = sha1(flag);
3030
}
3131

3232
get hash(): string {

libs/shared/flagd-core/tsconfig.lib.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"compilerOptions": {
44
"outDir": "../../../dist/out-tsc",
55
"declaration": true,
6-
"types": ["node"]
6+
"types": []
77
},
88
"include": ["src/**/*.ts"],
99
"exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"]

libs/shared/flagd-core/tsconfig.spec.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
"compilerOptions": {
44
"outDir": "../../../dist/out-tsc",
55
"module": "commonjs",
6-
"types": ["jest", "node"]
6+
"types": ["jest"]
77
},
88
"include": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts"]
99
}

0 commit comments

Comments
 (0)