From 87cfce9a8641771a3dc58fafe5cc19abea3e24d3 Mon Sep 17 00:00:00 2001 From: Sameeran Kunche Date: Fri, 17 Nov 2023 22:35:35 -0800 Subject: [PATCH] Bump axios version and use nullish coalesce --- package.json | 2 +- src/client/eppo-client.ts | 6 ++---- yarn.lock | 24 +++++++++++++++--------- 3 files changed, 18 insertions(+), 14 deletions(-) diff --git a/package.json b/package.json index d1e4e188..156fd123 100644 --- a/package.json +++ b/package.json @@ -63,7 +63,7 @@ "xhr-mock": "^2.5.1" }, "dependencies": { - "axios": "^0.27.2", + "axios": "^1.6.0", "lru-cache": "^10.0.1", "md5": "^2.3.0" } diff --git a/src/client/eppo-client.ts b/src/client/eppo-client.ts index 34b4009f..7b2f0428 100644 --- a/src/client/eppo-client.ts +++ b/src/client/eppo-client.ts @@ -380,10 +380,8 @@ export default class EppoClient implements IEppoClient { } return assignedVariation; }); - let holdoutKey = null; - if (matchingHoldout) { - holdoutKey = matchingHoldout.holdoutKey; - } else { + const holdoutKey = matchingHoldout?.holdoutKey ?? null; + if (!matchingHoldout) { const assignmentShard = getShard(`assignment-${subjectKey}-${flagKey}`, subjectShards); assignedVariation = variations.find((variation) => isShardInRange(assignmentShard, variation.shardRange), diff --git a/yarn.lock b/yarn.lock index c01dc9ff..4cf28a01 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1293,13 +1293,14 @@ asynckit@^0.4.0: resolved "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz" integrity sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q== -axios@^0.27.2: - version "0.27.2" - resolved "https://registry.npmjs.org/axios/-/axios-0.27.2.tgz" - integrity sha512-t+yRIyySRTp/wua5xEr+z1q60QmLq8ABsS5O9Me1AsE5dfKqgnCFzwiCZZ/cGNd1lq4/7akDWMxdhVlucjmnOQ== +axios@^1.6.0: + version "1.6.2" + resolved "https://registry.yarnpkg.com/axios/-/axios-1.6.2.tgz#de67d42c755b571d3e698df1b6504cde9b0ee9f2" + integrity sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A== dependencies: - follow-redirects "^1.14.9" + follow-redirects "^1.15.0" form-data "^4.0.0" + proxy-from-env "^1.1.0" babel-jest@^28.1.1: version "28.1.1" @@ -2149,10 +2150,10 @@ flatted@^3.1.0: resolved "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz" integrity sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg== -follow-redirects@^1.14.9: - version "1.15.1" - resolved "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.1.tgz" - integrity sha512-yLAMQs+k0b2m7cVxpS1VKJVvoz7SS9Td1zss3XRwXj+ZDH00RJgnuLx7E44wx02kQLrdM3aOOy+FpzS7+8OizA== +follow-redirects@^1.15.0: + version "1.15.3" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.3.tgz#fe2f3ef2690afce7e82ed0b44db08165b207123a" + integrity sha512-1VzOtuEM8pC9SFU1E+8KfTjZyMztRsgEfwQl44z8A25uy13jSzTj6dyK2Df52iV0vgHCfBwLhDWevLn95w5v6Q== form-data@^4.0.0: version "4.0.0" @@ -3572,6 +3573,11 @@ prompts@^2.0.1: kleur "^3.0.3" sisteransi "^1.0.5" +proxy-from-env@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/proxy-from-env/-/proxy-from-env-1.1.0.tgz#e102f16ca355424865755d2c9e8ea4f24d58c3e2" + integrity sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg== + psl@^1.1.33: version "1.8.0" resolved "https://registry.npmjs.org/psl/-/psl-1.8.0.tgz"