You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
45 lines
656 B
45 lines
656 B
/**
|
|
*
|
|
* VALIDATE: number-primitive
|
|
*
|
|
*
|
|
* DESCRIPTION:
|
|
* - Validates if a value is a number primitive.
|
|
*
|
|
*
|
|
* NOTES:
|
|
* [1]
|
|
*
|
|
*
|
|
* TODO:
|
|
* [1]
|
|
*
|
|
*
|
|
* LICENSE:
|
|
* MIT
|
|
*
|
|
* Copyright (c) 2015. Athan Reines.
|
|
*
|
|
*
|
|
* AUTHOR:
|
|
* Athan Reines. kgryte@gmail.com. 2015.
|
|
*
|
|
*/
|
|
|
|
'use strict';
|
|
|
|
/**
|
|
* FUNCTION: isNumber( value )
|
|
* Validates if a value is a number primitive, excluding `NaN`.
|
|
*
|
|
* @param {*} value - value to be validated
|
|
* @returns {Boolean} boolean indicating if a value is a number primitive
|
|
*/
|
|
function isNumber( value ) {
|
|
return (typeof value === 'number') && (value === value);
|
|
} // end FUNCTION isNumber()
|
|
|
|
|
|
// EXPORTS //
|
|
|
|
module.exports = isNumber;
|
|
|