Skip to content

Commit

Permalink
Build Tools: Docgen: Ensure unique package patterns
Browse files Browse the repository at this point in the history
  • Loading branch information
aduth committed Mar 21, 2020
1 parent 37adca3 commit 41e5daa
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions bin/api-docs/update-readmes.js
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function getPackagePattern( files ) {

// Since brace expansion doesn't work with a single package, special-case
// the pattern for the singular match.
const packages = files.map( getFilePackage );
const packages = Array.from( new Set( files.map( getFilePackage ) ) );
return packages.length === 1 ? packages[ 0 ] : '{' + packages.join() + '}';
}

Expand Down Expand Up @@ -143,9 +143,8 @@ function getDataDocumentationPattern( files ) {

// Since brace expansion doesn't work with a single package, special-case
// the pattern for the singular match.
const docFiles = files
.map( getFilePackage )
.map( getDataDocumentationFile );
const filePackages = Array.from( new Set( files.map( getFilePackage ) ) );
const docFiles = filePackages.map( getDataDocumentationFile );

return docFiles.length === 1 ? docFiles[ 0 ] : '{' + docFiles.join() + '}';
}
Expand Down

0 comments on commit 41e5daa

Please sign in to comment.