Skip to content

Commit 6fd9a79

Browse files
committed
chore: glob built-in ignore
1 parent 3a8824e commit 6fd9a79

File tree

2 files changed

+4
-12
lines changed

2 files changed

+4
-12
lines changed

src/generators/ast-js/index.mjs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -56,12 +56,8 @@ export default {
5656
* @param {Partial<GeneratorOptions>} options
5757
* @returns {AsyncGenerator<Output>}
5858
*/
59-
async *generate(_, { input = [], ignore = [], worker }) {
60-
const toIgnore = globSync(ignore);
61-
62-
const files = globSync(input)
63-
.filter(path => extname(path) === '.js')
64-
.filter(path => !toIgnore.includes(path));
59+
async *generate(_, { input = [], ignore, worker }) {
60+
const files = globSync(input, { ignore }).filter(p => extname(p) === '.js');
6561

6662
// Parse the Javascript sources into ASTs in parallel using worker threads
6763
// source is both the items list and the fullInput since we use sliceInput

src/generators/ast/index.mjs

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -61,12 +61,8 @@ export default {
6161
* @param {Partial<GeneratorOptions>} options
6262
* @returns {AsyncGenerator<Output>}
6363
*/
64-
async *generate(_, { input = [], ignore = [], worker }) {
65-
const toIgnore = globSync(ignore);
66-
67-
const files = globSync(input)
68-
.filter(path => extname(path) === '.md')
69-
.filter(path => !toIgnore.includes(path));
64+
async *generate(_, { input = [], ignore, worker }) {
65+
const files = globSync(input, { ignore }).filter(p => extname(p) === '.md');
7066

7167
// Parse markdown files in parallel using worker threads
7268
for await (const chunkResult of worker.stream(files, files)) {

0 commit comments

Comments
 (0)