milojs/proto

View on GitHub
lib/dot/number.jst

Summary

Maintainability
Test Coverage
'use strict';

/**
 * - [isNumeric](#isNumeric)
 */
var numberMethods = module.exports = {
    isNumeric: isNumeric
};


/**
 * Function to test if a value is numeric
 *
 * @param {Any} self value to be tested
 * @return {Boolean} true if it is a numeric value
 */
function isNumeric({{# def.oneArg }}) {
    var result = !isNaN(parseFloat({{# def.self }})) && isFinite({{# def.self }});
    {{# def.return:result }}
}