ljharb / qs

A querystring parser with nesting support
BSD 3-Clause "New" or "Revised" License
8.5k stars 729 forks source link

[utils] Simplify check isRegExp #430

Closed Connormiha closed 2 years ago

Connormiha commented 2 years ago

I refactored isRegExp to use short method for checking.

codecov[bot] commented 2 years ago

Codecov Report

Merging #430 (cf9622e) into main (408ff95) will increase coverage by 0.00%. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             main     #430   +/-   ##
=======================================
  Coverage   99.85%   99.85%           
=======================================
  Files           8        8           
  Lines        1408     1424   +16     
  Branches      172      173    +1     
=======================================
+ Hits         1406     1422   +16     
  Misses          2        2           
Impacted Files Coverage Δ
lib/utils.js 100.00% <100.00%> (ø)
test/stringify.js 99.75% <0.00%> (-0.01%) :arrow_down:
lib/parse.js 100.00% <0.00%> (ø)
test/parse.js 99.79% <0.00%> (+<0.01%) :arrow_up:

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...cf9622e. Read the comment docs.

ljharb commented 2 years ago

Please discuss changes like this in issues first, rather than sending a PR that might not be needed :-) all the "is" checks in this library are precisely what is needed.