diff --git a/libs/shared/flagd-core/src/lib/feature-flag.ts b/libs/shared/flagd-core/src/lib/feature-flag.ts index 7c5bf6f7f..30a7079cf 100644 --- a/libs/shared/flagd-core/src/lib/feature-flag.ts +++ b/libs/shared/flagd-core/src/lib/feature-flag.ts @@ -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. @@ -26,7 +26,7 @@ export class FeatureFlag { this._defaultVariant = flag['defaultVariant']; this._variants = new Map(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 { diff --git a/libs/shared/flagd-core/tsconfig.lib.json b/libs/shared/flagd-core/tsconfig.lib.json index 4befa7f09..36e88999e 100644 --- a/libs/shared/flagd-core/tsconfig.lib.json +++ b/libs/shared/flagd-core/tsconfig.lib.json @@ -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"] diff --git a/libs/shared/flagd-core/tsconfig.spec.json b/libs/shared/flagd-core/tsconfig.spec.json index b2ee74a6b..97775bd24 100644 --- a/libs/shared/flagd-core/tsconfig.spec.json +++ b/libs/shared/flagd-core/tsconfig.spec.json @@ -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"] }