Skip to content

Commit

Permalink
put back getExperimentation functon and correct package version
Browse files Browse the repository at this point in the history
  • Loading branch information
nikrom17 committed May 30, 2024
1 parent 45b5629 commit d3b0880
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 1 deletion.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@paypal/sdk-client",
"version": "4.0.188-alpha.0",
"version": "4.0.189",
"description": "Shared config between PayPal/Braintree.",
"main": "index.js",
"scripts": {
Expand Down
17 changes: 17 additions & 0 deletions src/global.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,23 @@ export function getDisableSetCookie(): boolean {
return false;
}

export function getExperimentation(): Experimentation | null {
if (typeof __EXPERIMENTATION__ !== "undefined") {
if (__EXPERIMENTATION__) {
const experimentation: Experimentation = {};
if (__EXPERIMENTATION__.__EXPERIENCE__) {
experimentation.experience = __EXPERIMENTATION__.__EXPERIENCE__;
}
if (__EXPERIMENTATION__.__TREATMENT__) {
experimentation.treatment = __EXPERIMENTATION__.__TREATMENT__;
}
return experimentation;
}
}

return null;
}

export function getFirstRenderExperiments(): FirstRenderExperiments | null {
if (typeof __FIRST_RENDER_EXPERIMENTS__ !== "undefined") {
return __FIRST_RENDER_EXPERIMENTS__;
Expand Down

0 comments on commit d3b0880

Please sign in to comment.