diff --git a/docs/docs/050-modules.md b/docs/docs/050-modules.md index 94b7671..096ed91 100644 --- a/docs/docs/050-modules.md +++ b/docs/docs/050-modules.md @@ -414,8 +414,8 @@ Source: ```js { - removeComments: (comments) => { - if (comments.includes('noindex')) return true; + removeComments: (comment) => { + if (comment.includes('noindex')) return true; return false; } } diff --git a/index.d.ts b/index.d.ts index ac3ef44..f71b506 100644 --- a/index.d.ts +++ b/index.d.ts @@ -22,7 +22,7 @@ export interface HtmlnanoOptions { minifySvg?: SvgoOptimizeOptions | boolean; normalizeAttributeValues?: boolean; removeAttributeQuotes?: boolean; - removeComments?: boolean | "safe" | "all" | RegExp | (() => boolean); + removeComments?: boolean | "safe" | "all" | RegExp | ((comment: string) => boolean); removeEmptyAttributes?: boolean; removeRedundantAttributes?: boolean; removeOptionalTags?: boolean; diff --git a/test/modules/removeComments.mjs b/test/modules/removeComments.mjs index 3f250cb..8d926a4 100644 --- a/test/modules/removeComments.mjs +++ b/test/modules/removeComments.mjs @@ -122,8 +122,8 @@ describe('removeComments', () => { 'this text will not be indexedLorem ipsum dolor sit ametLorem ipsum dolor sit amet', 'this text will not be indexedLorem ipsum dolor sit ametLorem ipsum dolor sit amet', { - removeComments: (comments) => { - if (comments.includes('noindex')) return true; + removeComments: (comment) => { + if (comment.includes('noindex')) return true; return false; }, }