ssb-invites-schema

0.0.8 • Public • Published

ssb-invites-schema

Validations for type invite and reply for ssb messages.

const { isInvite, isReply } = require('ssb-invites-schema')

// Get something from your database
server.get(key, (err, msg) => {
  const { content } = msg.value

  // Check if its an invite according to JSON schema
  if(isInvite(content)) {
    // ...
  }

  // Check if its an invite reply according to JSON schema
  if (isReply(content)) {
    // ...
  }
})

Readme

Keywords

none

Package Sidebar

Install

npm i ssb-invites-schema

Weekly Downloads

1

Version

0.0.8

License

ISC

Unpacked Size

12.6 kB

Total Files

17

Last publish

Collaborators

  • kyphae