skema.duplex

Duplex skema for mysql

Usage no npm install needed!

<script type="module">
  import skemaDuplex from 'https://cdn.skypack.dev/skema.duplex';
</script>

README

Build Status Coverage

skema.duplex

Duplex skema

Install

$ npm i skema.duplex

Usage

import duplex from 'skema.duplex'

const Member = duplex('Member', {
  id: [Number, String],
  name: String
})

Member.keys   // ['id', 'name']

Member.from({
  id: '123',
  name: 'kael'
})
// - id: 123
// - name: 'kael'

Member.fromR({
  id: 123,
  name: 'kael'
})
// -id: '123'
// -name: 'kael'

License

MIT