Security News
GitHub Removes Malicious Pull Requests Targeting Open Source Repositories
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
@saimulhasnain-dev/input-validator
Advanced tools
Human-friendly and powerful data validator library utility for JavaScript
Human-friendly and powerful data validator library for JavaScript
This project requires NodeJS (version 8 or later) and NPM. Node and NPM are really easy to install. To make sure you have them available on your machine, try running the following command.
$ npm -v && node -v
6.4.1
v8.16.0
These instructions will help you to install this package in your project to perform data validation.
BEFORE YOU INSTALL: please read the prerequisites
Start with installation of package in your project:
$ cd PROJECT
$ npm i @saimulhasnain-dev/input-validator
After successful installation of package you need to import package in your file: To import complete package in once
$ import validator from '@saimulhasnain-dev/input-validator';
Or if you prefer using any particular function then:
$ import { isAlphabet } from '@saimulhasnain-dev/input-validator';
import validator from '@saimulhasnain-dev/input-validator';
let res = validator.isAlphabet('abc');//to verify string contains alphabet
console.log(res); // it will print `true` as it contains alphabet
validator.isStrongPassword('Qwert@!2313');//to check password strength
Accessing only required function
import { isValidEmail } from '@saimulhasnain-dev/input-validator';
isValidEmail('abc@gmail.com');//to test email is valid or not
import { getValueFromObject, isKeyExistsNested } from '@saimulhasnain-dev/input-validator';
const user = {
name: "abc",
email: "xyz@email.com",
address: {
state: "New york",
country: "USA",
phones: {
primary: "+1234567890",
secondary: "+0987654321"
}
}
}
getValueFromObject(user, ["address", "state"]);//to get value of `state` key inside `address` object
getValueFromObject(user, ["address", "phones","primary"])////to get value of `primary` key inside `phone` object inside `address`
isKeyExistsNested(user, "address", "phones","primary");// to check if key `primary` exists in this object or not
Please read CONTRIBUTING.md for details on our code of conduct, and the process for submitting pull requests to us.
git checkout -b my-new-feature
git add .
git commit -am 'Add some feature'
git push origin my-new-feature
All credit goes to me:sunglasses:
We use SemVer for versioning. For the versions available, see the tags on this repository.
FAQs
Human-friendly and powerful data validator library utility for JavaScript
We found that @saimulhasnain-dev/input-validator demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
GitHub removed 27 malicious pull requests attempting to inject harmful code across multiple open source repositories, in another round of low-effort attacks.
Security News
RubyGems.org has added a new "maintainer" role that allows for publishing new versions of gems. This new permission type is aimed at improving security for gem owners and the service overall.
Security News
Node.js will be enforcing stricter semver-major PR policies a month before major releases to enhance stability and ensure reliable release candidates.