When testing NaN
against ow.number
, the following error message is emitted:
ArgumentError: Expected argument to be of type `number` but received type `number`
at ow (node_modules/ow/dist/index.js:29:28)
{
validationErrors: Map(1) {
'number' => Set(1) {
'Expected argument to be of type `number` but received type `number`'
}
}
}
This behaviour can be verified by running this two line snippet in the Node REPL:
const { default: ow } = require('ow')
ow(NaN, ow.number)
I think that this error message would be quite confusing for those who encounter it. I see two possible ways to solve this problem:
NaN
case to be something along the lines of: Expected argument to be of type `number`, but received `NaN`.
ow.number.nan
and ow.number.not.nan
checks.Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too