Skip to content

Commit afea974

Browse files
Removed default value for locale parameter
1 parent 4fc4c2f commit afea974

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

packages/docusaurus-plugin-content-blog/src/blogUtils.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -210,11 +210,8 @@ async function parseBlogPostMarkdownFile({
210210
}
211211
}
212212

213-
const defaultReadingTime: ReadingTimeFunction = ({
214-
content,
215-
options,
216-
locale = 'en',
217-
}) => calculateReadingTime(content, {...options, locale});
213+
const defaultReadingTime: ReadingTimeFunction = ({content, locale, options}) =>
214+
calculateReadingTime(content, {...options, locale});
218215

219216
async function processBlogSourceFile(
220217
blogSourceRelative: string,

packages/docusaurus-plugin-content-blog/src/plugin-content-blog.d.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -401,12 +401,12 @@ declare module '@docusaurus/plugin-content-blog' {
401401
export type ReadingTimeFunction = (params: {
402402
/** Markdown content. */
403403
content: string;
404+
/** Locale for word segmentation. */
405+
locale: string;
404406
/** Front matter. */
405407
frontMatter?: BlogPostFrontMatter & {[key: string]: unknown};
406408
/** Options for reading time calculation. */
407409
options?: ReadingTimeOptions;
408-
/** Locale for word segmentation. */
409-
locale?: string;
410410
}) => number;
411411

412412
/**

0 commit comments

Comments
 (0)