progfay/scrapbox-parser

View on GitHub
src/block/Title.ts

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import type { Row } from "./Row.ts";

export interface TitlePack {
    type: "title";
    rows: [Row];
}

/**
 * Scrapbox title type
 */
export interface Title {
    type: "title";
    text: string;
}

export const convertToTitle = (pack: TitlePack): Title => {
    return {
        type: "title",
        text: pack.rows[0].text,
    };
};