This PR implements a minor optimization on number checking using only Number.isFinite(x) and omits the typeof x === 'number'. This update reduces the number check to a singular function call. This update also applies a similar change to integer checking where only Number.isInteger(x) is used. Note that TypeSystemPolicy.AllowNaN = true will return the check to typeof x === 'number' for Number types only.
This PR implements a minor optimization on number checking using only
Number.isFinite(x)
and omits thetypeof x === 'number'
. This update reduces the number check to a singular function call. This update also applies a similar change to integer checking where onlyNumber.isInteger(x)
is used. Note thatTypeSystemPolicy.AllowNaN = true
will return the check totypeof x === 'number'
for Number types only.This optimization was suggested by https://github.com/aquapi
Additional updates include small fix to the TemplateLiteral comment in the readme, and a minor update to the overview copy.