Skip to content

Commit

Permalink
fix(repartitions): for progressive percentage
Browse files Browse the repository at this point in the history
  • Loading branch information
mfrachet committed Oct 17, 2024
1 parent fe3ffa9 commit e13f4f4
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion packages/core/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "@flag-engine/core",
"private": false,
"version": "0.0.7",
"version": "0.0.8",
"description": "Feature flags evaluation engine, runtime agnostic",
"type": "module",
"main": "./dist/index.cjs.js",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/src/resolveStrategyVariant.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@ export const resolveStrategyVariant = (strategy: Strategy, userKey: string) => {
let cumulative = 0;

const murmurkey = `${strategy.name}-${userKey}`;
const hash = murmur3(murmurkey);

const variant = strategy.variants.find((variant) => {
const hash = murmur3(murmurkey);
const userFlagPercentage = (hash / MAX_INT_32) * 100;

cumulative += variant.percent;
Expand Down

0 comments on commit e13f4f4

Please sign in to comment.