mirror of
https://github.com/umap-project/umap.git
synced 2025-04-28 19:42:36 +02:00
chore: explicit comment for global isNaN usage
This commit is contained in:
parent
b5cb092cd4
commit
31d1c36a48
1 changed files with 4 additions and 0 deletions
|
@ -74,6 +74,10 @@ class Rule {
|
|||
if (vars.length !== 2) return
|
||||
this.key = vars[0]
|
||||
this.expected = vars[1]
|
||||
// Special cases where we want to be lousy when checking isNaN without
|
||||
// coercing to a Number first because we handle multiple types.
|
||||
// See https://developer.mozilla.org/en-US/docs/Web/JavaScript/
|
||||
// Reference/Global_Objects/Number/isNaN
|
||||
// biome-ignore lint/suspicious/noGlobalIsNan: expected might not be a number.
|
||||
if (!isNaN(this.expected)) this.cast = Number.parseFloat
|
||||
else if (['true', 'false'].includes(this.expected)) this.cast = (v) => !!v
|
||||
|
|
Loading…
Reference in a new issue