You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-11-25 05:23:13 +03:00
check whether notif level is undefined, because 0 is falsey (#651)
* check whether notif level is undefined, because `0` is falsey and it failed Signed-off-by: Michael Telatynski <7t3chguy@gmail.com> * improve number check for all m.room.power_levels related stuffs Signed-off-by: Michael Telatynski <7t3chguy@gmail.com>
This commit is contained in:
committed by
Luke Barnard
parent
67876bab4c
commit
172044a1cb
10
src/utils.js
10
src/utils.js
@@ -652,3 +652,13 @@ module.exports.inherits = function(ctor, superCtor) {
|
||||
},
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* Returns whether the given value is a finite number without type-coercion
|
||||
*
|
||||
* @param {*} value the value to test
|
||||
* @return {boolean} whether or not value is a finite number without type-coercion
|
||||
*/
|
||||
module.exports.isNumber = function(value) {
|
||||
return typeof value === 'number' && isFinite(value);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user