npm

Need private packages and team management tools?Check out npm Orgs. »

is_digit

1.0.3 • Public • Published

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
 

install

npm i is_digit

Downloadsweekly downloads

3

version

1.0.3

license

WTFPL

last publish

collaborators

  • avatar
Report a vulnerability