1.2.1 • Published 6 years ago

nocms-validation v1.2.1

Weekly downloads
15
License
ISC
Repository
github
Last release
6 years ago

nocms-validation

Validation of forms fields.

semantic-release Dependency Status devDependencies

Installation

Install nocms-validation from NPM and include it in your own build process (using Browserify, Webpack, etc).

npm install nocms-validation --save

Usage

import validation from 'nocms-validation';

validation.validate(this.state.value, 'email', this.props.required)

validationRule

validationRuledescription
function(value)Custom function returning a boolean
'notEmpty'Check if the value is set
'email'Evaluates email addresses
'phone'Norwegian phone numbers, 8 digits with optional country code
'datetime'Matches ISO datetime YYYY-MM-DDTHH:MM, no timezone
'date'Matches ISO datetime YYYY-MM-DD
'int'Matches integer values
'orgNumber'Matches Norwegian organization numbers, 9 digits with checksum
'accountNumber'Matches Norwegian account numbers, with checksum.
'confirm'Matches booleans, used for confirmation checkboxes
'internalUri'Matches a URI to a resource on the same domain. /test
'regex'A string with a custom regex to match the value

Commit message format and publishing

This repository is published using semantic-release, with the default AngularJS Commit Message Conventions.

1.2.1

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

7 years ago

1.0.3

7 years ago