@subsocial/utils
Version:
JavaScript utils for Subsocial blockchain.
9 lines (8 loc) • 413 B
TypeScript
export declare type HasTitleOrBody = {
title?: string;
body: string;
};
/** Create slug from the content title or body, appended with the id at the end */
export declare const createPostSlug: (postId: string, content?: HasTitleOrBody | undefined) => string;
/** Extract post id from the slug generated from `createPostSlug` */
export declare const getPostIdFromSlug: (slug: string) => string | undefined;