Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Include default treatment in SplitView #232

Merged
3 changes: 2 additions & 1 deletion src/sdkManager/__tests__/mocks/output.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,6 @@
"treatments": ["on", "off"],
"configs": {
"on": "\"color\": \"green\""
}
},
"defaultTreatment": "off"
}
3 changes: 2 additions & 1 deletion src/sdkManager/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ function objectToView(splitObject: ISplit | null): SplitIO.SplitView | null {
killed: splitObject.killed,
changeNumber: splitObject.changeNumber || 0,
treatments: collectTreatments(splitObject),
configs: splitObject.configurations || {}
configs: splitObject.configurations || {},
defaultTreatment: splitObject.defaultTreatment
};
}

Expand Down
5 changes: 5 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -610,6 +610,11 @@ export namespace SplitIO {
configs: {
[treatmentName: string]: string
}
/**
* Default treatment value for feature flag.
* @property {string} defaultTreatment
*/
defaultTreatment: string,
};
/**
* A promise that resolves to a feature flag view.
Expand Down
Loading