ssbc / ssb-invite-schema

schema for scuttle-invite message types

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

ssb-invite-schema

Validations for type invite and reply for ssb messages.

const { isInvite, isReply } = require('ssb-invite-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)) {
    // ...
  }
})

About

schema for scuttle-invite message types


Languages

Language:JavaScript 100.0%