Skip to content

Commit

Permalink
Merge pull request #77 from mateuszsikora/remove-flat-map-usage
Browse files Browse the repository at this point in the history
  • Loading branch information
kinyoklion authored Oct 20, 2022
2 parents a16e16a + 214d4b9 commit 6be6dc5
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/headers.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ function getLDHeaders(platform, options) {
if (tagKeys.length) {
h['x-launchdarkly-tags'] = tagKeys
.sort()
.flatMap(
.map(
key => (Array.isArray(tags[key]) ? tags[key].sort().map(value => `${key}/${value}`) : [`${key}/${tags[key]}`])
)
.reduce((flattened, item) => flattened.concat(item), [])
.join(' ');
}
return h;
Expand Down

0 comments on commit 6be6dc5

Please sign in to comment.