You are reading content from Scuttlebutt
@mix %61eeyKJMd8B3XuWxERueNhQCYcpjHc0k5jMr6dYaOK0=.sha256

ssb-thread-schema

:gift: I made a module for you

var { isRoot, isReply, isFork, isNestedReply } = require('ssb-thread-schema')

const testMsg = {
  type: 'post',
  text: 'oh choice, finally a less janky way to check our stuff',
  root: '%+fBXl12aV1wpAdD62RMl1WRhwthDMuAuHH4iNWgB7jA=.sha256',
  fork: '%PK5aWmXVYJLcmRQTc/6EQE1ht9T5Kb+wi6NgTReMKXI=.sha256'
}
// can be the content of a message or the whole thing

isFork(testMsg)
// => false
isFork.errors
// => helpful errors

isNestedReply(testMsg)
// => true

more info : https://github.com/ssbc/ssb-thread-schema

@mix %cLEXqjXmqfo9OZRm6XVKoZcfvaVy6Us9Z8cNt1d1obA=.sha256

It's ridiculous this thing doesn't exist already.
I need this to be able to teach #patchbay to handle some of the new replies coming through, but more importantly I wanted to take the spec I started a year ago and give people clear ways to test their understand of the concepts there.

Anyway, enjoy :kissing_heart:

@Anders %btwTI1HgIfH35eIMMX3/sAOuNm9NbMXlF0ncjMH5rRo=.sha256
Voted It's ridiculous this thing doesn't exist already. I need this to be able to
@Anders %ThrOGcwl3OkCLvMU5xPGnXC9YpxX62SlF2l93U2ulrg=.sha256
Voted # ssb-thread-schema :gift: I made a module for you ```js var { isRoot, i
@mix %x6lDA05cI0yeIi20FsyynBVxptg6ebY6XsG6E1c0L3s=.sha256

cc @matt @christianbundy @cryptix @cel @luandro @SoapDog @Hendrik Peter

Join Scuttlebutt now