Skip to content

Commit

Permalink
fix: Convert logical nullish assignment for backward compatibility (n…
Browse files Browse the repository at this point in the history
…odejs#1625)

* fix: remove logical nullish assignment

* more readable code
  • Loading branch information
avanelli authored and metcoder95 committed Dec 26, 2022
1 parent eaaf20f commit 0d53e5a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion lib/fetch/headers.js
Original file line number Diff line number Diff line change
Expand Up @@ -402,7 +402,9 @@ class Headers {
}

get [kHeadersSortedMap] () {
this[kHeadersList][kHeadersSortedMap] ??= new Map([...this[kHeadersList]].sort((a, b) => a[0] < b[0] ? -1 : 1))
if (!this[kHeadersList][kHeadersSortedMap]) {
this[kHeadersList][kHeadersSortedMap] = new Map([...this[kHeadersList]].sort((a, b) => a[0] < b[0] ? -1 : 1))
}
return this[kHeadersList][kHeadersSortedMap]
}

Expand Down

0 comments on commit 0d53e5a

Please sign in to comment.