Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ssb-typescript

Package Overview
Dependencies
Maintainers
1
Versions
21
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ssb-typescript - npm Package Compare versions

Comparing version 2.2.0 to 2.3.0

.github/workflows/node.js.yml

10

package.json
{
"name": "ssb-typescript",
"version": "2.2.0",
"version": "2.3.0",
"description": "TypeScript type definitions for Secure Scuttlebutt",

@@ -16,8 +16,10 @@ "repository": {

"scripts": {
"prepublish": "tsc"
"prepublish": "tsc",
"test": "tsc --noEmit test.ts"
},
"devDependencies": {
"ts-node": "^4.1.0",
"typescript": "~3.7.5"
"tsd":"~0.15.1",
"ts-node": "^9.1.1",
"typescript": "~4.2.2"
}
}

17

readme.d.ts

@@ -57,3 +57,3 @@ /**

};
export declare type Content = Privatable<PostContent> | Privatable<ContactContent> | Privatable<VoteContent> | Privatable<AboutContent> | null;
export declare type Content = Privatable<PostContent> | Privatable<ContactContent> | Privatable<VoteContent> | Privatable<AboutContent> | Privatable<BlogContent> | null;
export declare type PostContent = {

@@ -133,1 +133,16 @@ type: 'post';

};
export declare type BlogContent = {
type: 'blog';
title: string;
summary: string;
channel?: string;
thumbnail?: string;
blog: string;
/**
* Links
*/
mentions?: Array<any>;
root?: MsgId;
branch?: MsgId | Array<MsgId>;
fork?: MsgId;
};

@@ -47,3 +47,3 @@ /**

branch?: MsgId;
}>
}>;

@@ -59,6 +59,6 @@ export type UnboxedMsg<C = Content> = Msg<C> & {

originalContent: string;
}
};
};
export type Privatable<T> = T & {recps?: Array<FeedId>};
export type Privatable<T> = T & { recps?: Array<FeedId> };

@@ -70,2 +70,3 @@ export type Content =

| Privatable<AboutContent>
| Privatable<BlogContent>
| null;

@@ -156,1 +157,20 @@

};
export type BlogContent = {
type: 'blog';
title: string;
summary: string;
channel?: string;
thumbnail?: string;
blog: string;
/**
* Links
*/
mentions?: Array<any>;
root?: MsgId;
branch?: MsgId | Array<MsgId>;
fork?: MsgId;
// recps: FeedLinks;
// mentions: Links;
};

@@ -1,14 +0,6 @@

import { Msg, PostContent, AboutContent, ContactContent, VoteContent, UnboxedMsg, MsgId } from './readme';
import { Msg, PostContent, BlogContent, AboutContent, ContactContent, VoteContent, UnboxedMsg, MsgId, MsgInThread } from './readme';
export declare function isMsg(msg: any): msg is Msg<any>;
export declare function isRootMsg(msg: Msg<any>): boolean;
export declare function isReplyMsgToRoot(rootKey: MsgId): (msg: Msg<{
root?: string | undefined;
fork?: string | undefined;
branch?: string | undefined;
}>) => boolean;
export declare function isIndirectReplyMsgToRoot(rootKey: MsgId): (msg: Msg<{
root?: string | undefined;
fork?: string | undefined;
branch?: string | undefined;
}>) => boolean;
export declare function isReplyMsgToRoot(rootKey: MsgId): (msg: MsgInThread) => boolean;
export declare function isIndirectReplyMsgToRoot(rootKey: MsgId): (msg: MsgInThread) => boolean;
export declare function isPostMsg(msg: Msg<any>): msg is Msg<PostContent>;

@@ -22,1 +14,2 @@ export declare function isRootPostMsg(msg: Msg<any>): msg is Msg<PostContent>;

export declare function isPublic(msg: Msg<any> | UnboxedMsg): boolean;
export declare function isBlogMsg(msg: Msg<any>): msg is Msg<BlogContent>;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.isBlogMsg = exports.isPublic = exports.isPrivate = exports.isVoteMsg = exports.isContactMsg = exports.isAboutMsg = exports.isReplyPostMsg = exports.isRootPostMsg = exports.isPostMsg = exports.isIndirectReplyMsgToRoot = exports.isReplyMsgToRoot = exports.isRootMsg = exports.isMsg = void 0;
function isMsg(msg) {

@@ -8,8 +9,8 @@ return msg && msg.key && msg.value && typeof msg.value === 'object';

function isRootMsg(msg) {
var _a, _b, _c;
return !((_c = (_b = (_a = msg) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.content) === null || _c === void 0 ? void 0 : _c.root);
var _a, _b;
return !((_b = (_a = msg === null || msg === void 0 ? void 0 : msg.value) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.root);
}
exports.isRootMsg = isRootMsg;
function isReplyMsgToRoot(rootKey) {
return function (msg) { var _a, _b, _c; return ((_c = (_b = (_a = msg) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.content) === null || _c === void 0 ? void 0 : _c.root) === rootKey; };
return function (msg) { var _a, _b; return ((_b = (_a = msg === null || msg === void 0 ? void 0 : msg.value) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.root) === rootKey; };
}

@@ -19,6 +20,6 @@ exports.isReplyMsgToRoot = isReplyMsgToRoot;

return function (msg) {
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
return ((_c = (_b = (_a = msg) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.content) === null || _c === void 0 ? void 0 : _c.root) === rootKey ||
((_f = (_e = (_d = msg) === null || _d === void 0 ? void 0 : _d.value) === null || _e === void 0 ? void 0 : _e.content) === null || _f === void 0 ? void 0 : _f.branch) === rootKey ||
((_j = (_h = (_g = msg) === null || _g === void 0 ? void 0 : _g.value) === null || _h === void 0 ? void 0 : _h.content) === null || _j === void 0 ? void 0 : _j.fork) === rootKey;
var _a, _b, _c, _d, _e, _f;
return ((_b = (_a = msg === null || msg === void 0 ? void 0 : msg.value) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.root) === rootKey ||
((_d = (_c = msg === null || msg === void 0 ? void 0 : msg.value) === null || _c === void 0 ? void 0 : _c.content) === null || _d === void 0 ? void 0 : _d.branch) === rootKey ||
((_f = (_e = msg === null || msg === void 0 ? void 0 : msg.value) === null || _e === void 0 ? void 0 : _e.content) === null || _f === void 0 ? void 0 : _f.fork) === rootKey;
};

@@ -28,33 +29,33 @@ }

function isPostMsg(msg) {
var _a, _b, _c;
return ((_c = (_b = (_a = msg) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.content) === null || _c === void 0 ? void 0 : _c.type) === 'post';
var _a, _b;
return ((_b = (_a = msg === null || msg === void 0 ? void 0 : msg.value) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.type) === 'post';
}
exports.isPostMsg = isPostMsg;
function isRootPostMsg(msg) {
var _a, _b, _c;
return isPostMsg(msg) && !((_c = (_b = (_a = msg) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.content) === null || _c === void 0 ? void 0 : _c.root);
var _a, _b;
return isPostMsg(msg) && !((_b = (_a = msg === null || msg === void 0 ? void 0 : msg.value) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.root);
}
exports.isRootPostMsg = isRootPostMsg;
function isReplyPostMsg(msg) {
var _a, _b, _c;
return isPostMsg(msg) && !!((_c = (_b = (_a = msg) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.content) === null || _c === void 0 ? void 0 : _c.root);
var _a, _b;
return isPostMsg(msg) && !!((_b = (_a = msg === null || msg === void 0 ? void 0 : msg.value) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.root);
}
exports.isReplyPostMsg = isReplyPostMsg;
function isAboutMsg(msg) {
var _a, _b, _c;
return ((_c = (_b = (_a = msg) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.content) === null || _c === void 0 ? void 0 : _c.type) === 'about';
var _a, _b;
return ((_b = (_a = msg === null || msg === void 0 ? void 0 : msg.value) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.type) === 'about';
}
exports.isAboutMsg = isAboutMsg;
function isContactMsg(msg) {
var _a, _b, _c;
return ((_c = (_b = (_a = msg) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.content) === null || _c === void 0 ? void 0 : _c.type) === 'contact';
var _a, _b;
return ((_b = (_a = msg === null || msg === void 0 ? void 0 : msg.value) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.type) === 'contact';
}
exports.isContactMsg = isContactMsg;
function isVoteMsg(msg) {
var _a, _b, _c;
return ((_c = (_b = (_a = msg) === null || _a === void 0 ? void 0 : _a.value) === null || _b === void 0 ? void 0 : _b.content) === null || _c === void 0 ? void 0 : _c.type) === 'vote';
var _a, _b;
return ((_b = (_a = msg === null || msg === void 0 ? void 0 : msg.value) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.type) === 'vote';
}
exports.isVoteMsg = isVoteMsg;
function isPrivate(msg) {
var _a, _b, _c, _d;
var _a, _b, _c;
if ((_a = msg.meta) === null || _a === void 0 ? void 0 : _a.private)

@@ -66,7 +67,7 @@ return true;

return true;
return typeof ((_d = (_c = msg) === null || _c === void 0 ? void 0 : _c.value) === null || _d === void 0 ? void 0 : _d.content) === 'string';
return typeof ((_c = msg === null || msg === void 0 ? void 0 : msg.value) === null || _c === void 0 ? void 0 : _c.content) === 'string';
}
exports.isPrivate = isPrivate;
function isPublic(msg) {
var _a, _b, _c, _d;
var _a, _b, _c;
if ((_a = msg.meta) === null || _a === void 0 ? void 0 : _a.private)

@@ -78,5 +79,10 @@ return false;

return false;
return typeof ((_d = (_c = msg) === null || _c === void 0 ? void 0 : _c.value) === null || _d === void 0 ? void 0 : _d.content) !== 'string';
return typeof ((_c = msg === null || msg === void 0 ? void 0 : msg.value) === null || _c === void 0 ? void 0 : _c.content) !== 'string';
}
exports.isPublic = isPublic;
function isBlogMsg(msg) {
var _a, _b;
return ((_b = (_a = msg === null || msg === void 0 ? void 0 : msg.value) === null || _a === void 0 ? void 0 : _a.content) === null || _b === void 0 ? void 0 : _b.type) === 'blog';
}
exports.isBlogMsg = isBlogMsg;
//# sourceMappingURL=utils.js.map

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc