Skip to content

Commit

Permalink
Merge pull request #167 from Flagsmith/fix/number-zero-flag-value
Browse files Browse the repository at this point in the history
fix: Return 0 as number flag value instead of undefined
  • Loading branch information
rolodato authored Jan 14, 2025
2 parents 3d04ec7 + d1cfffe commit d52fbac
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "flagsmith-nodejs",
"version": "5.0.0",
"version": "5.0.1",
"description": "Flagsmith lets you manage features flags and remote config across web, mobile and server side applications. Deliver true Continuous Integration. Get builds out faster. Control who has access to new features.",
"main": "./build/cjs/index.js",
"type": "module",
Expand Down
2 changes: 1 addition & 1 deletion sdk/models.ts
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ export class Flag extends BaseFlag {
static fromAPIFlag(flagData: any): Flag {
return new Flag({
enabled: flagData['enabled'],
value: flagData['feature_state_value'] || flagData['value'],
value: flagData['feature_state_value'] ?? flagData['value'],
featureId: flagData['feature']['id'],
featureName: flagData['feature']['name']
});
Expand Down

0 comments on commit d52fbac

Please sign in to comment.