1.0.3 • Published 7 years ago

is_digit v1.0.3

Weekly downloads
48
License
WTFPL
Repository
-
Last release
7 years ago

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
1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago