Skip to content

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

@Krinkle

Description

@Krinkle
const glob = require( "tiny-glob/sync" );

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

With an input like:

  • a.html
  • reporter-html/b.html
  • other/c.html
    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions