0.4.1 • Published 6 years ago

schm-translate v0.4.1

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

schm-translate

NPM version

Translates values keys to schema keys.

Install

$ npm install --save schm-translate

Usage

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

const userSchema = schema({
  name: String,
  email: String,
}, translate({
  name: 'username',
  email: 'emails.0',
}))

const user = userSchema.parse({
  username: 'Haz',
  emails: [
    'hazdiego@gmail.com',
    'diegohaz@live.com',
  ],
})

Output:

{
  name: 'Haz',
  email: 'hazdiego@gmail.com',
}

API

Table of Contents

translate

Translates values keys to schema keys.

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

0.0.5

7 years ago

0.0.4

7 years ago

0.0.3

7 years ago

0.0.2

7 years ago