textype
v1.0.8
Published
Find the data type by regular expression
Downloads
8
Readme
TexType
Find the data type by regular expression
Install
npm install textype
How to use
is public ip ?
var textype = require('textype');
var data = '10.10.221.15';
textype.isPublicIP(data);
is internal ip ?
var textype = require('textype');
var data = '10.10.221.15';
textype.isInternalIP(data);
is url ?
var textype = require('textype');
var data = 'https://tanpopo.cc';
textype.isURL(data);
### is e-mail ?
```node
var textype = require('textype');
var data = '[email protected]';
textype.isEmail(data);
is number ?
var textype = require('textype');
var data = '10452.70';
textype.isNumber(data);
is ObjectID ?
var textype = require('textype');
var data = '45cbc4a0e4123f6920000002';
textype.isObjectID(data);
is JSON ?
var textype = require('textype');
var data = '[9, 'b', false]';
textype.isJSON(data);
get multi-type
var textype = require('textype');
var data;
textype.multiType(data);