0.4.1 • Published 6 years ago

schm-computed v0.4.1

Weekly downloads
24
License
MIT
Repository
github
Last release
6 years ago

schm-computed

NPM version

Adds computed parameters to schm schemas.

Install

$ npm install --save schm-computed

Usage

const schema = require('schm')
const computed = require('schm-computed')

const userSchema = schema({
  firstName: String,
  lastName: String,
}, computed({
  fullName: values => `${values.firstName} ${values.lastName}`,
}))

userSchema.parse({
  firstName: 'Diego',
  lastName: 'Haz'
})

Output:

{
  firstName: 'Diego',
  lastName: 'Haz',
  fullName: 'Diego Haz'
}

API

Table of Contents

computed

Add computed parameters to schema.

Parameters

License

MIT © Diego Haz

0.4.1

6 years ago

0.1.6

6 years ago

0.1.5

6 years ago

0.1.4

6 years ago

0.1.3

6 years ago

0.1.2

6 years ago

0.1.1

6 years ago

0.1.0

6 years ago

0.0.7

7 years ago

0.0.6

7 years ago