Skip to content

Commit

Permalink
fix: re-add browser support (#706)
Browse files Browse the repository at this point in the history
Signed-off-by: Michael Beemer <[email protected]>
  • Loading branch information
beeme1mr authored Dec 18, 2023
1 parent 8e8cfdd commit c262c66
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions libs/shared/flagd-core/src/lib/feature-flag.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { FlagValue } from '@openfeature/core';
import { createHash } from 'crypto';
import { sha1 } from 'object-hash';

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

get hash(): string {
Expand Down
2 changes: 1 addition & 1 deletion libs/shared/flagd-core/tsconfig.lib.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"compilerOptions": {
"outDir": "../../../dist/out-tsc",
"declaration": true,
"types": ["node"]
"types": []
},
"include": ["src/**/*.ts"],
"exclude": ["jest.config.ts", "src/**/*.spec.ts", "src/**/*.test.ts"]
Expand Down
2 changes: 1 addition & 1 deletion libs/shared/flagd-core/tsconfig.spec.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
"compilerOptions": {
"outDir": "../../../dist/out-tsc",
"module": "commonjs",
"types": ["jest", "node"]
"types": ["jest"]
},
"include": ["jest.config.ts", "src/**/*.test.ts", "src/**/*.spec.ts", "src/**/*.d.ts"]
}

0 comments on commit c262c66

Please sign in to comment.