Skip to content

Commit

Permalink
refactor: components fileExtension check
Browse files Browse the repository at this point in the history
  • Loading branch information
cossssmin committed Dec 6, 2024
1 parent 9505748 commit 543ca9e
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/posthtml/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -94,11 +94,9 @@ export async function process(html = '', config = {}) {
)

// Ensure `fileExtension` is array and has no duplicates
componentsConfig.fileExtension = [...new Set(
Array.isArray(componentsConfig.fileExtension)
? componentsConfig.fileExtension
: [componentsConfig.fileExtension]
)]
componentsConfig.fileExtension = Array.from(new Set(
[].concat(componentsConfig.fileExtension)
))

return posthtml([
...get(config, 'posthtml.plugins.before', []),
Expand Down

0 comments on commit 543ca9e

Please sign in to comment.