Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 1,000,000+ packages pre-installed, including @currency-one/validators with all npm packages installed. Try it out:

require("libphonenumber-js/package.json"); // libphonenumber-js is a peer dependency. require("moment/package.json"); // moment is a peer dependency. var validators = require("@currency-one/validators")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

@currency-one/validators v1.1.6

Typescript collection of validators and regexp patterns

Validators

npm version License

Typescript collection of validators and regexp patterns

Installation

To install run:

npm i @currency-one/validators

or

yarn add @currency-one/validators

Basic usage with React and build systems (webpack, parcel etc.):

import { isNotEmptyStringValidator, isAccountNumberPattern } from '@currency-one/validators'

export const notEmptyValidator = (value) => {
  return !isNotEmptyStringValidator(value) ? 'This field cant be empty' : ''
}

export const accountNumberPattern = (value) => {
  return !isAccountNumberPattern(value) ? 'This field can contain only: letters, numbers and space' : ''
}

Documentation

See documentation for more details

RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free