1.0.8 • Published 8 years ago

textype v1.0.8

Weekly downloads
2
License
MIT
Repository
github
Last release
8 years ago

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 = 'service@tanpopo.cc';
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);
1.0.8

8 years ago

1.0.7

8 years ago

1.0.6

9 years ago

1.0.5

9 years ago

1.0.4

9 years ago

1.0.3

10 years ago

1.0.2

10 years ago

1.0.1

10 years ago

1.0.0

10 years ago