1.0.1 • Published 4 years ago

validity-text-length v1.0.1

Weekly downloads
3
License
ISC
Repository
github
Last release
4 years ago

Text length validator

Validity style validator to ensure visible length of strings. Supports emojis and other graphemes through grapheme splitter

Installation

npm install validity-text-length --save

yarn add validity-text-length

Usage

Below is example usage of the text length validator:

const textLength = require('validity-text-length),
schemata = require('schemata)

var schema = schemata (
  {
    firstName:
    {
      type: String
      , validators: { [ textLength(1, 10) ] }
    }
  }
)