This package has been deprecated

Author message:

old

abox-validator
TypeScript icon, indicating that this package has built-in type declarations

1.0.4 • Public • Published

abox-validator - Api Toolkit Validations

Build Status npm version codecov.io

Quickstart

Installation

npm install abox-validator --save

Code Example

action.ts

import {Action} from "abox";
import {Pattern, Required} from "abox-validator";

@Action({ name: "ping" })
export class Ping {
  @Required()
  @Pattern(/^[a-z]$/)
  public message: string
}

app.ts

import {Api} from "abox";
import * as validator from "abox-validator";
import {Ping} from "./actions";

const api = new Api();

api.use(validator.module);

api
  .on(Ping)
  .handle((context, data) => {
    //...
  });

export = api;

Readme

Keywords

none

Package Sidebar

Install

npm i abox-validator

Weekly Downloads

2

Version

1.0.4

License

MIT

Last publish

Collaborators

  • no0dles