Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
linksOpts: function (v, n) {
var err = this.get('object')(v, n)
if (err)
return err
// .source
if (v.source && !ref.isLink(v.source) && !isFilter(v.source))
return AttrType(n, 'source', 'id|filter')
// .dest
if (v.dest && !ref.isLink(v.dest) && !isFilter(v.dest))
return AttrType(n, 'dest', 'id|filter')
// .rel
if (v.rel && typeof v.rel != 'string')
return AttrType(n, 'rel', 'string')
// .live
if (v.live && typeof v.live != 'boolean' && typeof v.live != 'number')
return AttrType(n, 'live', 'boolean')
// .reverse
if (v.reverse && typeof v.reverse != 'boolean' && typeof v.reverse != 'number')
return AttrType(n, 'reverse', 'boolean')
// .keys
if (v.keys && typeof v.keys != 'boolean' && typeof v.keys != 'number')
linksOpts: function (v, n) {
var err = this.get('object')(v, n)
if (err)
return err
// .source
if (v.source && !ref.isLink(v.source) && !isFilter(v.source))
return AttrType(n, 'source', 'id|filter')
// .dest
if (v.dest && !ref.isLink(v.dest) && !isFilter(v.dest))
return AttrType(n, 'dest', 'id|filter')
// .rel
if (v.rel && typeof v.rel != 'string')
return AttrType(n, 'rel', 'string')
// .live
if (v.live && typeof v.live != 'boolean' && typeof v.live != 'number')
return AttrType(n, 'live', 'boolean')
// .reverse
if (v.reverse && typeof v.reverse != 'boolean' && typeof v.reverse != 'number')
'message.obs.webshares': (id) => {
if (!ref.isLink(id)) throw new Error('an id must be specified')
var obs = get(id)
obs.id = id
var result = computed(obs, getShares, {
// allow manual append for simulated realtime
onListen: () => activeShares.add(obs),
onUnlisten: () => activeShares.delete(obs)
})
result.sync = obs.sync
return result
}
})
linksOpts: function (v, n) {
var err = this.get('object')(v, n)
if (err)
return err
// .source
if (v.source && !ref.isLink(v.source) && !isFilter(v.source))
return AttrType(n, 'source', 'id|filter')
// .dest
if (v.dest && !ref.isLink(v.dest) && !isFilter(v.dest))
return AttrType(n, 'dest', 'id|filter')
// .rel
if (v.rel && typeof v.rel != 'string')
return AttrType(n, 'rel', 'string')
// .live
if (v.live && typeof v.live != 'boolean' && typeof v.live != 'number')
return AttrType(n, 'live', 'boolean')
// .reverse
if (v.reverse && typeof v.reverse != 'boolean' && typeof v.reverse != 'number')
return AttrType(n, 'reverse', 'boolean')
// .keys
if (v.keys && typeof v.keys != 'boolean' && typeof v.keys != 'number')
function socialValue$(id, key, defaultValue) {
if (!ref.isLink(id)) throw new Error('About requires an ssb ref!');
return xs.createWithMemory({
start(listener) {
listener.next(defaultValue);
this.sink = pull.drain(listener.next.bind(listener));
pull(api.sbot.pull.aboutSocialValueStream({key, dest: id}), this.sink);
},
stop() {
if (this.sink) this.sink.abort(true);
},
});
}
};
function link (l) {
if (typeof l == 'string') {
if (ssbref.isLink(l))
return l
}
if (l && typeof l == 'object') {
if (Object.keys(l).length === 1 && l.link && ssbref.isLink(l))
return l
return mlib.link(l)
}
}
voterStream: function voterStream(msgId: string) {
if (!ref.isLink(msgId))
throw new Error('A message id must be specified');
return pull(
ssb.backlinks.read({
query: [{$filter: {dest: msgId}}],
index: 'DTA',
live: true,
}),
collectUniqueAuthors(),
);
},
};
function link (l) {
if (typeof l === 'string') {
if (isLink(l)) { return l }
}
if (l && typeof l === 'object') {
if (Object.keys(l).length === 1 && l.link && isLink(l)) { return l }
return mlib.link(l)
}
}
function link (l) {
if (typeof l == 'string') {
if (ssbref.isLink(l))
return l
}
if (l && typeof l == 'object') {
if (Object.keys(l).length === 1 && l.link && ssbref.isLink(l))
return l
return mlib.link(l)
}
}