terkelg / tiny-glob

Super tiny and ~350% faster alternative to node-glob
MIT License
856 stars 25 forks source link

Unterminated group error for "{*,sub/*}.html" #75

Open Krinkle opened 3 years ago

Krinkle commented 3 years ago
const glob = require( "tiny-glob/sync" );

const files = glob( "{*,reporter-html/*}.html", {
    cwd: __dirname + "/../",
    filesOnly: true
} )

With an input like:

    SyntaxError: Invalid regular expression: /^(([^/]*)|reporter-html$/: Unterminated group
        at new RegExp (<anonymous>)
        at add (/qunit/node_modules/globrex/index.js:42:40)
        at globrex (/qunit/node_modules/globrex/index.js:62:13)
        at module.exports (/qunit/node_modules/tiny-glob/sync.js:75:20)
        at Object.QUnit.module (/qunit/test/cli/structure.js:57:17)
        at processModule (/qunit/qunit/qunit.js:1325:40)
        at Object.module$1 [as module] (/qunit/qunit/qunit.js:1361:5)
        at Object.QUnit.module (/qunit/test/cli/structure.js:53:8)
        at processModule (/qunit/qunit/qunit.js:1325:40)
        at Object.module$1 [as module] (/qunit/qunit/qunit.js:1361:5)

I tried the following (unsuccessful) workaround:

glob( "{*.html,reporter-html/*.html}" );

// SyntaxError: Invalid regular expression: /^(([^/]*)\.html|reporter-html$/: Unterminated group