1.0.8 • Published 7 years ago

textype v1.0.8

Weekly downloads
2
License
MIT
Repository
github
Last release
7 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

7 years ago

1.0.7

7 years ago

1.0.6

8 years ago

1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

9 years ago

1.0.2

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago