0.0.7 • Published 4 years ago

notify-io-schemas v0.0.7

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

Notify-IO Schemas

Notify-IO Schemas are predefined schemas that can be easily included in your projects.

const { Notify, SchemaBuilder } = require('notify-io')
const { ObjectionSchema, JoiSchema, DefaultSchema } = require('notify-io-schemas')

const schema = new SchemaBuilder().merege({
    ObjectionSchema: ObjectionSchema(SchemaBuilder),
    JoiSchema: JoiSchema(SchemaBuilder),
})

Notify.loadSchema(schema)

const notify = new Notify('validation')
notify
    .message('any.required', 'password', 'password')

console.log(notify)
console.log(schema.keys()) // to see all the keys registered on a schema

output:

{
  lang: 'en',
  state: 'validation',
  messages: [
    { message: 'password is required', key: 'password' }
  ]
}
0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.3

4 years ago

0.0.4

4 years ago

0.0.1

4 years ago

0.0.2

4 years ago

0.0.0

4 years ago