/** * * VALIDATE: nonnegative-integer * * * DESCRIPTION: * - Validates if a value is a nonnegative integer. * * * NOTES: * [1] * * * TODO: * [1] * * * LICENSE: * MIT * * Copyright (c) 2015. Athan Reines. * * * AUTHOR: * Athan Reines. kgryte@gmail.com. 2015. * */ 'use strict'; // MODULES // var isInteger = require( 'validate.io-integer' ); // IS NONNEGATIVE INTEGER // /** * FUNCTION: isNonNegativeInteger( value ) * Validates if a value is a nonnegative integer. * * @param {*} value - value to be validated * @returns {Boolean} boolean indicating if a value is a nonnegative integer */ function isNonNegativeInteger( value ) { return isInteger( value ) && value >= 0; } // end FUNCTION isNonNegativeInteger() // EXPORTS // module.exports = isNonNegativeInteger;