Skip to content

fix: ignore#655

Open
Zamiell wants to merge 1 commit into
isaacs:mainfrom
Zamiell:fix-type-error
Open

fix: ignore#655
Zamiell wants to merge 1 commit into
isaacs:mainfrom
Zamiell:fix-type-error

Conversation

@Zamiell

@Zamiell Zamiell commented Jul 19, 2026

Copy link
Copy Markdown

Hello again isaac!

Today, I found a type bug in node-glob. The following code results in a type error:

const MY_IGNORES = ["foo", "bar"] as const;
await glob("**/*.txt, {
  ignore: MY_IGNORES,
})

This PR fixes the bug. Note that this change is backwards compatible because in TypeScript, you don't have to do readonly string[] | string[], because readonly string[] is the superset of both these things due to how the type system works.

Furthermore, the same issue seems to be present in the codebase in other places:

  • All  glob* , stream, and iterate functions in  src/index.ts 
  • new Glob(pattern, options)  in  src/glob.ts 
  • hasMagic(pattern)  in  src/has-magic.ts

Do you want me to fix those too?

@frontzhm

frontzhm commented Jul 19, 2026 via email

Copy link
Copy Markdown

@Zamiell

Zamiell commented Jul 19, 2026

Copy link
Copy Markdown
Author

^ Seems like a spam bot. I reported it to GitHub.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants