Improved handling of null values when entering tags frontmatter

This commit is contained in:
PrinOrange
2024-01-06 20:20:05 +08:00
parent fb308f7b11
commit eac42b69a7
8 changed files with 61 additions and 15 deletions

View File

@@ -1,7 +1,9 @@
import { NonEmptyArray } from "./utils.type";
export type TFrontmatter = {
title: string;
time: string;
tags: string[] | null;
tags: NonEmptyArray<string> | null;
subtitle: string | null;
summary: string | null;
coverURL: string | null;

1
types/utils.type.ts Normal file
View File

@@ -0,0 +1 @@
export type NonEmptyArray<T> = [T, ...T[]];