Skip to content

Commit

Permalink
Merge pull request #283 from cueaz/fix-removecomments
Browse files Browse the repository at this point in the history
fix: add missing argument in typescript definition of removeComments
  • Loading branch information
maltsev committed May 5, 2024
2 parents 151da26 + ecc80a9 commit 249b2a4
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions docs/docs/050-modules.md
Original file line number Diff line number Diff line change
Expand Up @@ -414,8 +414,8 @@ Source:

```js
{
removeComments: (comments) => {
if (comments.includes('noindex')) return true;
removeComments: (comment) => {
if (comment.includes('noindex')) return true;
return false;
}
}
Expand Down
2 changes: 1 addition & 1 deletion index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions test/modules/removeComments.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,8 @@ describe('removeComments', () => {
'<!--noindex-->this text will not be indexed<!--/noindex-->Lorem ipsum dolor sit amet<!--more-->Lorem ipsum dolor sit amet',
'this text will not be indexedLorem ipsum dolor sit amet<!--more-->Lorem ipsum dolor sit amet',
{
removeComments: (comments) => {
if (comments.includes('noindex')) return true;
removeComments: (comment) => {
if (comment.includes('noindex')) return true;
return false;
},
}
Expand Down

0 comments on commit 249b2a4

Please sign in to comment.