redpwn / rctf

redpwn's CTF platform
https://rctf.redpwn.net/
BSD 3-Clause "New" or "Revised" License
266 stars 49 forks source link

refactor(server): leverage narrowing on cache typing #574

Closed ethanwu10 closed 3 years ago

ethanwu10 commented 3 years ago

Small refactor of implementation of leaderboard cache getRange to leverage type narrowing on the range parameters to eliminate a pair of casts. Also restrict the all parameter to true only.

codecov[bot] commented 3 years ago

Codecov Report

Merging #574 (c7177be) into next (f07ce6f) will not change coverage. The diff coverage is 100.00%.

Impacted file tree graph

@@           Coverage Diff           @@
##             next     #574   +/-   ##
=======================================
  Coverage   50.97%   50.97%           
=======================================
  Files          89       89           
  Lines        1542     1542           
  Branches      292      292           
=======================================
  Hits          786      786           
  Misses        735      735           
  Partials       21       21           
Impacted Files Coverage Δ
packages/server/src/cache/leaderboard.ts 32.60% <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 f07ce6f...c7177be. Read the comment docs.