Skip to content

Commit a26d2eb

Browse files
committed
chore: remove useless default type {}
1 parent 1b39787 commit a26d2eb

File tree

4 files changed

+5
-6
lines changed

4 files changed

+5
-6
lines changed

examples/blogging/pages/[...nextmd].tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ type MyBlogPostFrontMatter = MyFrontMatter & { date: string; author: string };
88

99
const nextmd = NextMarkdown<MyFrontMatter, MyBlogPostFrontMatter>({
1010
pathToContent: './pages-markdown',
11-
debug: true,
1211
});
1312

1413
export const getStaticProps = nextmd.getStaticProps;

examples/documentation/pages/[...nextmd].tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import MarkdownPage from '../components/MarkdownPage';
44
import remarkPrism from 'remark-prism';
55
import 'prismjs/themes/prism-tomorrow.css';
66
import { GetStaticPropsContext } from 'next';
7-
import { DocumentationPageProps, FMatter, MyNextMarkdownProps } from '../lib/types';
7+
import { DocumentationPageProps, MyNextMarkdownProps } from '../lib/types';
88

99
const nextmd = NextMarkdown({
1010
pathToContent: './pages-markdown',

src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ const NextMarkdown = <T extends YAMLFrontMatter, U extends YAMLFrontMatter = T>(
3737
return allFiles.filter((e) => e.isIncluded).map((e) => e.file);
3838
};
3939

40-
const getStaticPropsForNextmd = async <R extends YAMLFrontMatter = {}, S extends YAMLFrontMatter = R>(
40+
const getStaticPropsForNextmd = async <R extends YAMLFrontMatter, S extends YAMLFrontMatter = R>(
4141
nextmd: string[],
4242
): Promise<{ props: NextMarkdownProps<R, S> }> => {
4343
const allFiles = await getAllFiles();

src/types.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export type Config = MarkdownPlugins & {
4545
/**
4646
* File that passes this test will be parsed by next-markdown. If `null` or `undefined`, next-markdown will ignore "README.md" by default.
4747
*/
48-
filterFile?: <T extends YAMLFrontMatter = {}>(file: File, frontMatter: T) => boolean;
48+
filterFile?: <T extends YAMLFrontMatter>(file: File, frontMatter: T) => boolean;
4949

5050
/**
5151
* Get more logs. Make sure it is `false` for production.
@@ -79,14 +79,14 @@ export interface TableOfContentItem {
7979

8080
export type TableOfContents = TableOfContentItem[];
8181

82-
export type NextMarkdownProps<T extends YAMLFrontMatter = {}, U extends YAMLFrontMatter = T> = NextMarkdownFile<T> & {
82+
export type NextMarkdownProps<T extends YAMLFrontMatter, U extends YAMLFrontMatter = T> = NextMarkdownFile<T> & {
8383
html: string | null;
8484
mdxSource: MDXRemoteSerializeResult<Record<string, unknown>> | null;
8585
tableOfContents: TableOfContents;
8686
subPaths: NextMarkdownFile<U>[] | null;
8787
};
8888

89-
export type NextMarkdownFile<U extends YAMLFrontMatter = {}> = {
89+
export type NextMarkdownFile<U extends YAMLFrontMatter> = {
9090
nextmd: string[];
9191
frontMatter: U;
9292
markdown: string;

0 commit comments

Comments
 (0)