Skip to content

Commit 1767ef0

Browse files
ConnormihaMylesBorins
authored andcommitted
url: simplify constructor URLSearchParams. Remove needless check null
PR-URL: #18700 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Gus Caplan <[email protected]> Reviewed-By: Tiancheng "Timothy" Gu <[email protected]> Reviewed-By: Colin Ihrig <[email protected]> Reviewed-By: Luigi Pinca <[email protected]>
1 parent b5073a0 commit 1767ef0

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lib/internal/url.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,7 @@ class URLSearchParams {
9898
constructor(init = undefined) {
9999
if (init === null || init === undefined) {
100100
this[searchParams] = [];
101-
} else if ((typeof init === 'object' && init !== null) ||
102-
typeof init === 'function') {
101+
} else if (typeof init === 'object' || typeof init === 'function') {
103102
const method = init[Symbol.iterator];
104103
if (method === this[Symbol.iterator]) {
105104
// While the spec does not have this branch, we can use it as a

0 commit comments

Comments
 (0)