Nocturnal Pumpkin Maelstrom
Miss any of our Open RFC calls?Watch the recordings here! »

textype

1.0.8 • Public • Published

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);

Install

npm i textype

DownloadsWeekly Downloads

10

Version

1.0.8

License

MIT

Last publish

Collaborators

  • avatar