Socket
Book a DemoInstallSign in
Socket

froncubator-validator-js

Package Overview
Dependencies
Maintainers
3
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

froncubator-validator-js

Simple validator by Froncubator Pro

1.0.3
latest
npmnpm
Version published
Weekly downloads
2
Maintainers
3
Weekly downloads
 
Created
Source

Froncubator validator

A simple JavaScript library for validating data. https://github.com/froncubator/validator

Installation and Usage

Install the library with npm install froncubator-validator

const validator = require('froncubator-validator-js');

validator.isInt(123); //=> true
validator.isInt(10.5); //=> false
validator.isInt(undefined); //=> false
validator.isInt(123, 5, 10); //=> false

validator.isStr('Froncubator', 0, 100) //=> true
validator.isStr('Some String', null, 100) //=> true
validator.isStr('Next String', 100) //=> false
validator.isStr(undefined) //=> false

validator.isArr([1,2,3]) //=> true
validator.isArr([1,2,3], 1, 3) //=> true
validator.isArr([1,2,3], 5, 10) //=> false
validator.isArr(null) //=> false

validator.isEmail('some@email.com') //=> true
validator.isEmail('x@x.x') //=> true
validator.isEmail('some@email') //=> false
validator.isEmail('@.') //=> false

validator.isExist(false) //=> true
validator.isExist(undefined) //=> false
validator.isExist(null) //=> false
validator.isExist(NaN) //=> false

Validators list

ValidatorDescription
isEmail(value)Check is value is email and return true or false.
isStr(value, min, max)Check is value is string and return true or false. You can check count of characters in the string with min or max. (min, max) = not required.
isInt(value, min, max)Check is value is integer and return true or false. You can check number with min or max. (min, max) = not required.
isArr(value, min, max)Check is value is array and return true or false. You can check array length with min or max. (min, max) = not required.
isExist(value)Check is value exist (undefined, null, NaN).

Froncubator Validator is freely distributable under the terms of the MIT license.

Keywords

validator

FAQs

Package last updated on 09 Jan 2018

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.