Skip to content

Commit

Permalink
mapRange() should be a no-op for null and NaN
Browse files Browse the repository at this point in the history
  • Loading branch information
LeaVerou committed May 24, 2024
1 parent 719ab1b commit 0f70067
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ export function interpolateInv (start, end, value) {
}

export function mapRange (from, to, value) {
if (!from || !to || from === to || from[0] === to[0] && from[1] === to[1]) {
if (!from || !to || from === to || from[0] === to[0] && from[1] === to[1] || isNaN(value) || value === null) {
// Ranges missing or the same
return value;
}
Expand Down

0 comments on commit 0f70067

Please sign in to comment.