Would you like to clone this notebook?

When you clone a notebook you are able to make changes without affecting the original notebook.

Cancel

schm

node v7.10.1
version: 0.0.5
endpointsharetweet
const schema = require("schm") const userSchema = schema({ name: String, age: Number }) userSchema.parse({ name: 'Haz', age: '27' })
const computed = require('schm-computed') const userSchema2 = schema({ firstName: String, lastName: String }, computed({ fullName: values => `${values.firstName} ${values.lastName}` })) userSchema2.parse({ firstName: 'Diego', lastName: 'Haz' })
const methods = require('schm-methods') const userSchema3 = schema({ name: String, preferredLanguages: [String] }, methods({ codeIn: (values, language) => values.preferredLanguages.includes(language) })) const user3 = userSchema3.parse({ name: 'Haz', preferredLanguages: ['JavaScript', 'Swift', 'C#'] }) user3.codeIn('JavaScript')
const translate = require('schm-translate') const userSchema4 = schema({ name: String, email: String, }, translate({ name: 'username', email: 'emails.0', })) userSchema4.parse({ username: 'Haz', emails: [ 'hazdiego@gmail.com', 'diegohaz@live.com', ], })
Loading…

no comments

    sign in to comment