Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

In Node.js v20.11.0, it's not possible to match directories containing emojis. #436

Open
Nisekoi5 opened this issue Feb 5, 2024 · 0 comments

Comments

@Nisekoi5
Copy link

Nisekoi5 commented Feb 5, 2024

Environment

  • OS Version: Windows11
  • Node.js Version: v20.11.0

Actual behavior

Cannot be matched in file

Expected behavior

Match files correctly

Steps to reproduce

Directory Structure

scripts
│  og-template.svg
│  post-docs.ts
│  update.ts
│
├─types
│      changelog.d.ts
│      index.d.ts
│      metadata.d.ts
│
├─utils
│      index.ts
│
└─🪄test
        testtest.ts

Run the following code using nodejs v20.11.0 , Got the following result
The contents of the 🪄test directory are not included in it

[
  'scripts/post-docs.ts',
  'scripts/update.ts',
  'scripts/types/changelog.d.ts',
  'scripts/types/index.d.ts',
  'scripts/types/metadata.d.ts',
  'scripts/utils/index.ts'
]
[
  './scripts/post-docs.ts',
  './scripts/update.ts',
  './scripts/utils/index.ts',
  './scripts/types/changelog.d.ts',
  './scripts/types/index.d.ts',
  './scripts/types/metadata.d.ts'
]

Doing nothing, I just switched the version of nodejs to v18.19.0 and I got the following result

[
  'scripts/post-docs.ts',
  'scripts/update.ts',
  'scripts/types/changelog.d.ts',
  'scripts/types/index.d.ts',
  'scripts/types/metadata.d.ts',
  'scripts/utils/index.ts',
  'scripts/🪄test/testtest.ts'
]
[
  './scripts/post-docs.ts',
  './scripts/update.ts',
  './scripts/types/changelog.d.ts',
  './scripts/types/index.d.ts',
  './scripts/types/metadata.d.ts',
  './scripts/utils/index.ts',
  './scripts/🪄test/testtest.ts'
]

code

import fg from 'fast-glob'
const dir = './'
const pattern = [
    "scripts/**/*.ts",
    "./scripts/**/*.ts",

]
async function run() {
    let files
    for (const p of pattern) {
        files = await fg(p, {
            onlyFiles: true,
            cwd: dir,
            ignore: [
                '_*',
                'dist',
                'node_modules',
            ],
        })
        console.log(files)
    }

}
run()
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

No branches or pull requests

1 participant