Closed Connormiha closed 2 years ago
@ljharb
These are not needless at all.
undefined
can be redefined in every scope except the global scope in ES5, and in ES3 - which this package supports - it can be modified in the global scope otherwise.
Yes, but there are many places with same check. For example https://github.com/ljharb/qs/blob/master/lib/stringify.js#L155 or https://github.com/ljharb/qs/blob/master/lib/stringify.js#L195
In that case, those should be changed to use typeof instead :-) want to update the PR to do that?
@ljharb typeof
or void 0
? Which one is preferable?
@ljharb updated.
Definitely the typeof
, because it has minimal runtime weight.
Merging #427 (0a1d3e8) into master (408ff95) will not change coverage. The diff coverage is
100.00%
.
@@ Coverage Diff @@
## master #427 +/- ##
=======================================
Coverage 99.85% 99.85%
=======================================
Files 8 8
Lines 1408 1408
Branches 172 172
=======================================
Hits 1406 1406
Misses 2 2
Impacted Files | Coverage Δ | |
---|---|---|
lib/stringify.js | 100.00% <100.00%> (ø) |
Continue to review full report at Codecov.
Legend - Click here to learn more
Δ = absolute <relative> (impact)
,ø = not affected
,? = missing data
Powered by Codecov. Last update 408ff95...0a1d3e8. Read the comment docs.
I just removed needless(for these cases)
typeof
for checking for undefinedupdate: Added checking for typeof in parser.