@ayte/archetype.validation
TypeScript icon, indicating that this package has built-in type declarations

0.2.0 • Public • Published

Ayte / TypeScript / Archetype / Validation

npm CircleCI

This package contains types related to validation process. This package is in incubatory stage and thus may significantly change it's API in future releases.

Installation

yarn add @ayte/archetype.validation

# - or -

npm install -S @ayte/archetype.validation

Structure

At this moment this library only defines validator (IValidator) and violation (IViolation) types.

It is implied that violation consists of message, validated value, validation root, path from root to value and arbitrary metadata. For example, if one validates {"text": 12}, then violation may have this object as root, ["text"] as path, 12 as validated value and not a text as message.

Validator is just a function that takes in value and returns list of violations.

Licensing

MIT / UPL-1.0

Ayte Labs, 2020

Readme

Keywords

none

Package Sidebar

Install

npm i @ayte/archetype.validation

Weekly Downloads

1

Version

0.2.0

License

(MIT OR UPL-1.0)

Unpacked Size

6.19 kB

Total Files

10

Last publish

Collaborators

  • ayte-bot
  • etki