0.0.8 • Published 7 years ago

scuttle-invite-schema v0.0.8

Weekly downloads
5
License
ISC
Repository
github
Last release
7 years ago

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)) {
    // ...
  }
})