1.0.3 • Published 7 years ago
is_digit v1.0.3
Install
$ npm install is_digit
Usage
var isDigit = require('is_digit');
isDigit('5');
// => true
isDigit('non-digit');
// => false
/* Accepts arrays and objects too! */
isDigit(['5', '70', '4']);
// => true
isDigit(['5', '70', 'non-digit']);
// => false
isDigit({ first: '5', second: '70', third: '4'});
// => true
isDigit({ first: '5', second: '70', third: 'non-digit'});
// => false
/* Nested too */
isDigit({
first: ['215415', '342'],
second: '2',
third: { first: '241', second: ['35']}
});
// => true