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

refactor #5

Merged
merged 48 commits into from
Oct 20, 2016
Merged

refactor #5

merged 48 commits into from
Oct 20, 2016

Conversation

jonschlinkert
Copy link
Member

@jonschlinkert jonschlinkert commented Sep 5, 2016

In addition to performance improvements, this refactor adds complete Bash 4.3 extglob support (shopt -s extglob), with the possible exception of patterns mentioned in #4.

related

Additional features

  • parser is exposed, so that extglob parsers can be used by upstream parsers (like micromatch)
  • compiler is exposed, so that extglob compilers can be used by upstream compilers
  • source maps

source map example

{ version: 3,
     sources: [ 'extglob' ],
     names: [],
     mappings: 'AAAA,CAAE,CAAE,EAAE,CAAE,CAAC,GAAE,GAAE,EAAC' }

preliminary benchmarks

Benchmarking: (4 of 4)
 · negation-simple
 · range-false
 · range-true
 · star-simple

# benchmark/fixtures/isMatch/negation-simple.js (43 bytes)
  extglob x 6,986,439 ops/sec ±0.67% (88 runs sampled)
  minimatch x 259,035 ops/sec ±1.12% (86 runs sampled)

  fastest is extglob

# benchmark/fixtures/isMatch/range-false.js (56 bytes)
  extglob x 5,736,659 ops/sec ±0.89% (86 runs sampled)
  minimatch x 254,250 ops/sec ±1.07% (85 runs sampled)

  fastest is extglob

# benchmark/fixtures/isMatch/range-true.js (56 bytes)
  extglob x 6,220,181 ops/sec ±0.89% (87 runs sampled)
  minimatch x 249,175 ops/sec ±1.03% (90 runs sampled)

  fastest is extglob

# benchmark/fixtures/isMatch/star-simple.js (45 bytes)
  extglob x 6,285,213 ops/sec ±0.89% (90 runs sampled)
  minimatch x 237,600 ops/sec ±1.00% (86 runs sampled)

  fastest is extglob

@jonschlinkert jonschlinkert mentioned this pull request Sep 5, 2016
@jonschlinkert jonschlinkert changed the title updated refactor refactor Sep 9, 2016
adds more unit tests from wildmatch (git), ksh, and bash
- adds `expand-brackets` parsers/compilers to handle nested brackets and extglobs
- uses `to-regex` to build regex for `makeRe` method
- adds `.create` method
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.

1 participant