No Password Management

    schm-methods

    0.4.1 • Public • Published

    schm-methods

    NPM version

    Adds methods to schm parsed objects.

    Install

    $ npm install --save schm-methods
    

    Usage

    const schema = require('schm')
    const methods = require('schm-methods')
     
    const userSchema = schema({
      name: String,
      preferredLanguages: [String],
    }, methods({
      codeIn: (values, language) => values.preferredLanguages.includes(language),
    }))
     
    const user = userSchema.parse({
      name: 'Haz',
      preferredLanguages: ['JavaScript', 'Swift', 'C#'],
    })
     
    user.codeIn('JavaScript') // true
    user.codeIn('Java') // false

    API

    Table of Contents

    methods

    Adds methods to schm parsed object.

    Parameters

    License

    MIT © Diego Haz

    Keywords

    Install

    npm i schm-methods

    DownloadsWeekly Downloads

    20

    Version

    0.4.1

    License

    MIT

    Unpacked Size

    4.34 kB

    Total Files

    5

    Last publish

    Collaborators

    • diegohaz