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

chore(deps-dev): bump braces from 3.0.2 to 3.0.3 #1016

Merged
merged 1 commit into from
Jun 16, 2024

Conversation

dependabot[bot]
Copy link
Contributor

@dependabot dependabot bot commented on behalf of github Jun 16, 2024

Bumps braces from 3.0.2 to 3.0.3.

Commits

Dependabot compatibility score

Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting @dependabot rebase.


Dependabot commands and options

You can trigger Dependabot actions by commenting on this PR:

  • @dependabot rebase will rebase this PR
  • @dependabot recreate will recreate this PR, overwriting any edits that have been made to it
  • @dependabot merge will merge this PR after your CI passes on it
  • @dependabot squash and merge will squash and merge this PR after your CI passes on it
  • @dependabot cancel merge will cancel a previously requested merge and block automerging
  • @dependabot reopen will reopen this PR if it is closed
  • @dependabot close will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually
  • @dependabot show <dependency name> ignore conditions will show all of the ignore conditions of the specified dependency
  • @dependabot ignore this major version will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this minor version will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself)
  • @dependabot ignore this dependency will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself)
    You can disable automated security fix PRs for this repo from the Security Alerts page.

Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3.
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](micromatch/braces@3.0.2...3.0.3)

---
updated-dependencies:
- dependency-name: braces
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
@dependabot dependabot bot added dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code labels Jun 16, 2024
@github-actions github-actions bot enabled auto-merge (squash) June 16, 2024 09:52
Copy link
Contributor

Diff between braces 3.0.2 and 3.0.3
diff --git a/package.json b/package.json
index v3.0.2..v3.0.3 100644
--- a/package.json
+++ b/package.json
@@ -2,5 +2,5 @@
   "name": "braces",
   "description": "Bash-like brace expansion, implemented in JavaScript. Safer than other brace expansion libs, with complete support for the Bash 4.3 braces specification, without sacrificing speed.",
-  "version": "3.0.2",
+  "version": "3.0.3",
   "homepage": "https://github.com/micromatch/braces",
   "author": "Jon Schlinkert (https://github.com/jonschlinkert)",
@@ -30,5 +30,5 @@
   },
   "dependencies": {
-    "fill-range": "^7.0.1"
+    "fill-range": "^7.1.1"
   },
   "devDependencies": {
diff --git a/CHANGELOG.md b/CHANGELOG.md
deleted file mode 100644
index v3.0.2..v3.0.3 
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,184 +0,0 @@
-# Release history
-
-All notable changes to this project will be documented in this file.
-
-The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
-and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
-
-<details>
-  <summary><strong>Guiding Principles</strong></summary>
-
-- Changelogs are for humans, not machines.
-- There should be an entry for every single version.
-- The same types of changes should be grouped.
-- Versions and sections should be linkable.
-- The latest version comes first.
-- The release date of each versions is displayed.
-- Mention whether you follow Semantic Versioning.
-
-</details>
-
-<details>
-  <summary><strong>Types of changes</strong></summary>
-
-Changelog entries are classified using the following labels _(from [keep-a-changelog](http://keepachangelog.com/)_):
-
-- `Added` for new features.
-- `Changed` for changes in existing functionality.
-- `Deprecated` for soon-to-be removed features.
-- `Removed` for now removed features.
-- `Fixed` for any bug fixes.
-- `Security` in case of vulnerabilities.
-
-</details>
-
-## [3.0.0] - 2018-04-08
-
-v3.0 is a complete refactor, resulting in a faster, smaller codebase, with fewer deps, and a more accurate parser and compiler. 
-
-**Breaking Changes**
-
-- The undocumented `.makeRe` method was removed
-
-**Non-breaking changes**
-
-- Caching was removed
-
-## [2.3.2] - 2018-04-08
-
-- start refactoring
-- cover sets
-- better range handling
-
-## [2.3.1] - 2018-02-17
-
-- Remove unnecessary escape in Regex. (#14)
-
-## [2.3.0] - 2017-10-19
-
-- minor code reorganization
-- optimize regex
-- expose `maxLength` option
-
-## [2.2.1] - 2017-05-30
-
-- don't condense when braces contain extglobs
-
-## [2.2.0] - 2017-05-28
-
-- ensure word boundaries are preserved
-- fixes edge case where extglob characters precede a brace pattern
-
-## [2.1.1] - 2017-04-27
-
-- use snapdragon-node
-- handle edge case
-- optimizations, lint
-
-## [2.0.4] - 2017-04-11
-
-- pass opts to compiler
-- minor optimization in create method
-- re-write parser handlers to remove negation regex
-
-## [2.0.3] - 2016-12-10
-
-- use split-string
-- clear queue at the end
-- adds sequences example
-- add unit tests
-
-## [2.0.2] - 2016-10-21
-
-- fix comma handling in nested extglobs
-
-## [2.0.1] - 2016-10-20
-
-- add comments
-- more tests, ensure quotes are stripped
-
-## [2.0.0] - 2016-10-19
-
-- don't expand braces inside character classes
-- add quantifier pattern
-
-## [1.8.5] - 2016-05-21
-
-- Refactor (#10)
-
-## [1.8.4] - 2016-04-20
-
-- fixes https://github.com/jonschlinkert/micromatch/issues/66
-
-## [1.8.0] - 2015-03-18
-
-- adds exponent examples, tests
-- fixes the first example in https://github.com/jonschlinkert/micromatch/issues/38
-
-## [1.6.0] - 2015-01-30
-
-- optimizations, `bash` mode:
-- improve path escaping
-
-## [1.5.0] - 2015-01-28
-
-- Merge pull request #5 from eush77/lib-files
-
-## [1.4.0] - 2015-01-24
-
-- add extglob tests
-- externalize exponent function
-- better whitespace handling
-
-## [1.3.0] - 2015-01-24
-
-- make regex patterns explicity
-
-## [1.1.0] - 2015-01-11
-
-- don't create a match group with `makeRe`
-
-## [1.0.0] - 2014-12-23
-
-- Merge commit '97b05f5544f8348736a8efaecf5c32bbe3e2ad6e'
-- support empty brace syntax
-- better bash coverage
-- better support for regex strings
-
-## [0.1.4] - 2014-11-14
-
-- improve recognition of bad args, recognize mismatched argument types
-- support escaping
-- remove pathname-expansion
-- support whitespace in patterns
-
-## [0.1.0]
-
-- first commit
-
-[2.3.2]: https://github.com/micromatch/braces/compare/2.3.1...2.3.2
-[2.3.1]: https://github.com/micromatch/braces/compare/2.3.0...2.3.1
-[2.3.0]: https://github.com/micromatch/braces/compare/2.2.1...2.3.0
-[2.2.1]: https://github.com/micromatch/braces/compare/2.2.0...2.2.1
-[2.2.0]: https://github.com/micromatch/braces/compare/2.1.1...2.2.0
-[2.1.1]: https://github.com/micromatch/braces/compare/2.1.0...2.1.1
-[2.1.0]: https://github.com/micromatch/braces/compare/2.0.4...2.1.0
-[2.0.4]: https://github.com/micromatch/braces/compare/2.0.3...2.0.4
-[2.0.3]: https://github.com/micromatch/braces/compare/2.0.2...2.0.3
-[2.0.2]: https://github.com/micromatch/braces/compare/2.0.1...2.0.2
-[2.0.1]: https://github.com/micromatch/braces/compare/2.0.0...2.0.1
-[2.0.0]: https://github.com/micromatch/braces/compare/1.8.5...2.0.0
-[1.8.5]: https://github.com/micromatch/braces/compare/1.8.4...1.8.5
-[1.8.4]: https://github.com/micromatch/braces/compare/1.8.0...1.8.4
-[1.8.0]: https://github.com/micromatch/braces/compare/1.6.0...1.8.0
-[1.6.0]: https://github.com/micromatch/braces/compare/1.5.0...1.6.0
-[1.5.0]: https://github.com/micromatch/braces/compare/1.4.0...1.5.0
-[1.4.0]: https://github.com/micromatch/braces/compare/1.3.0...1.4.0
-[1.3.0]: https://github.com/micromatch/braces/compare/1.2.0...1.3.0
-[1.2.0]: https://github.com/micromatch/braces/compare/1.1.0...1.2.0
-[1.1.0]: https://github.com/micromatch/braces/compare/1.0.0...1.1.0
-[1.0.0]: https://github.com/micromatch/braces/compare/0.1.4...1.0.0
-[0.1.4]: https://github.com/micromatch/braces/compare/0.1.0...0.1.4
-
-[Unreleased]: https://github.com/micromatch/braces/compare/0.1.0...HEAD
-[keep-a-changelog]: https://github.com/olivierlacan/keep-a-changelog
\ No newline at end of file
diff --git a/index.js b/index.js
index v3.0.2..v3.0.3 100644
--- a/index.js
+++ b/index.js
@@ -24,6 +24,6 @@
 
   if (Array.isArray(input)) {
-    for (let pattern of input) {
-      let result = braces.create(pattern, options);
+    for (const pattern of input) {
+      const result = braces.create(pattern, options);
       if (Array.isArray(result)) {
         output.push(...result);
@@ -159,5 +159,5 @@
   }
 
- return options.expand !== true
+  return options.expand !== true
     ? braces.compile(input, options)
     : braces.expand(input, options);
diff --git a/LICENSE b/LICENSE
index v3.0.2..v3.0.3 100644
--- a/LICENSE
+++ b/LICENSE
@@ -1,5 +1,5 @@
 The MIT License (MIT)
 
-Copyright (c) 2014-2018, Jon Schlinkert.
+Copyright (c) 2014-present, Jon Schlinkert.
 
 Permission is hereby granted, free of charge, to any person obtaining a copy
diff --git a/README.md b/README.md
index v3.0.2..v3.0.3 100644
--- a/README.md
+++ b/README.md
@@ -21,13 +21,13 @@
 Brace patterns make globs more powerful by adding the ability to match specific ranges and sequences of characters.
 
-* **Accurate** - complete support for the [Bash 4.3 Brace Expansion](www.gnu.org/software/bash/) specification (passes all of the Bash braces tests)
-* **[fast and performant](#benchmarks)** - Starts fast, runs fast and [scales well](#performance) as patterns increase in complexity.
-* **Organized code base** - The parser and compiler are easy to maintain and update when edge cases crop up.
-* **Well-tested** - Thousands of test assertions, and passes all of the Bash, minimatch, and [brace-expansion](https://github.com/juliangruber/brace-expansion) unit tests (as of the date this was written).
-* **Safer** - You shouldn't have to worry about users defining aggressive or malicious brace patterns that can break your application. Braces takes measures to prevent malicious regex that can be used for DDoS attacks (see [catastrophic backtracking](https://www.regular-expressions.info/catastrophic.html)).
-* [Supports lists](#lists) - (aka "sets") `a/{b,c}/d` => `['a/b/d', 'a/c/d']`
-* [Supports sequences](#sequences) - (aka "ranges") `{01..03}` => `['01', '02', '03']`
-* [Supports steps](#steps) - (aka "increments") `{2..10..2}` => `['2', '4', '6', '8', '10']`
-* [Supports escaping](#escaping) - To prevent evaluation of special characters.
+- **Accurate** - complete support for the [Bash 4.3 Brace Expansion](www.gnu.org/software/bash/) specification (passes all of the Bash braces tests)
+- **[fast and performant](#benchmarks)** - Starts fast, runs fast and [scales well](#performance) as patterns increase in complexity.
+- **Organized code base** - The parser and compiler are easy to maintain and update when edge cases crop up.
+- **Well-tested** - Thousands of test assertions, and passes all of the Bash, minimatch, and [brace-expansion](https://github.com/juliangruber/brace-expansion) unit tests (as of the date this was written).
+- **Safer** - You shouldn't have to worry about users defining aggressive or malicious brace patterns that can break your application. Braces takes measures to prevent malicious regex that can be used for DDoS attacks (see [catastrophic backtracking](https://www.regular-expressions.info/catastrophic.html)).
+- [Supports lists](#lists) - (aka "sets") `a/{b,c}/d` => `['a/b/d', 'a/c/d']`
+- [Supports sequences](#sequences) - (aka "ranges") `{01..03}` => `['01', '02', '03']`
+- [Supports steps](#steps) - (aka "increments") `{2..10..2}` => `['2', '4', '6', '8', '10']`
+- [Supports escaping](#escaping) - To prevent evaluation of special characters.
 
 ## Usage
@@ -53,7 +53,7 @@
 
 ```js
-console.log(braces('a/{x,y,z}/b')); 
+console.log(braces('a/{x,y,z}/b'));
 //=> ['a/(x|y|z)/b']
-console.log(braces(['a/{01..20}/b', 'a/{1..5}/b'])); 
+console.log(braces(['a/{01..20}/b', 'a/{1..5}/b']));
 //=> [ 'a/(0[1-9]|1[0-9]|20)/b', 'a/([1-5])/b' ]
 ```
@@ -88,11 +88,11 @@
 
 ```js
-console.log(braces.expand('{1..3}'));                // ['1', '2', '3']
-console.log(braces.expand('a/{1..3}/b'));            // ['a/1/b', 'a/2/b', 'a/3/b']
-console.log(braces('{a..c}', { expand: true }));     // ['a', 'b', 'c']
+console.log(braces.expand('{1..3}')); // ['1', '2', '3']
+console.log(braces.expand('a/{1..3}/b')); // ['a/1/b', 'a/2/b', 'a/3/b']
+console.log(braces('{a..c}', { expand: true })); // ['a', 'b', 'c']
 console.log(braces('foo/{a..c}', { expand: true })); // ['foo/a', 'foo/b', 'foo/c']
 
 // supports zero-padded ranges
-console.log(braces('a/{01..03}/b'));   //=> ['a/(0[1-3])/b']
+console.log(braces('a/{01..03}/b')); //=> ['a/(0[1-3])/b']
 console.log(braces('a/{001..300}/b')); //=> ['a/(0{2}[1-9]|0[1-9][0-9]|[12][0-9]{2}|300)/b']
 ```
@@ -179,10 +179,10 @@
 **Type**: `Number`
 
-**Default**: `65,536`
+**Default**: `10,000`
 
 **Description**: Limit the length of the input string. Useful when the input string is generated or your application allows users to pass a string, et cetera.
 
 ```js
-console.log(braces('a/{b,c}/d', { maxLength: 3 }));  //=> throws an error
+console.log(braces('a/{b,c}/d', { maxLength: 3 })); //=> throws an error
 ```
 
@@ -245,5 +245,5 @@
     // When non-numeric values are passed, "value" is a character code.
     return 'foo/' + String.fromCharCode(value) + '-' + index;
-  }
+  },
 });
 console.log(alpha);
@@ -258,7 +258,7 @@
     // when numeric values are passed, "value" is a number
     return 'foo/' + value * 2;
-  }
+  },
 });
-console.log(numeric); 
+console.log(numeric);
 //=> [ 'foo/2', 'foo/4', 'foo/6', 'foo/8', 'foo/10' ]
 ```
@@ -282,11 +282,11 @@
 console.log(braces('a/b{1,3}/{x,y,z}'));
 //=> [ 'a/b(1|3)/(x|y|z)' ]
-console.log(braces('a/b{1,3}/{x,y,z}', {quantifiers: true}));
+console.log(braces('a/b{1,3}/{x,y,z}', { quantifiers: true }));
 //=> [ 'a/b{1,3}/(x|y|z)' ]
-console.log(braces('a/b{1,3}/{x,y,z}', {quantifiers: true, expand: true}));
+console.log(braces('a/b{1,3}/{x,y,z}', { quantifiers: true, expand: true }));
 //=> [ 'a/b{1,3}/x', 'a/b{1,3}/y', 'a/b{1,3}/z' ]
 ```
 
-### options.unescape
+### options.keepEscaping
 
 **Type**: `Boolean`
@@ -294,5 +294,5 @@
 **Default**: `undefined`
 
-**Description**: Strip backslashes that were used for escaping from the result.
+**Description**: Do not strip backslashes that were used for escaping from the result.
 
 ## What is "brace expansion"?
@@ -302,6 +302,6 @@
 In addition to "expansion", braces are also used for matching. In other words:
 
-* [brace expansion](#brace-expansion) is for generating new lists
-* [brace matching](#brace-matching) is for filtering existing lists
+- [brace expansion](#brace-expansion) is for generating new lists
+- [brace matching](#brace-matching) is for filtering existing lists
 
 <details>
@@ -383,7 +383,7 @@
 **"brace bombs"**
 
-* brace expansion can eat up a huge amount of processing resources
-* as brace patterns increase _linearly in size_, the system resources required to expand the pattern increase exponentially
-* users can accidentally (or intentially) exhaust your system's resources resulting in the equivalent of a DoS attack (bonus: no programming knowledge is required!)
+- brace expansion can eat up a huge amount of processing resources
+- as brace patterns increase _linearly in size_, the system resources required to expand the pattern increase exponentially
+- users can accidentally (or intentially) exhaust your system's resources resulting in the equivalent of a DoS attack (bonus: no programming knowledge is required!)
 
 For a more detailed explanation with examples, see the [geometric complexity](#geometric-complexity) section.
@@ -407,6 +407,6 @@
 
 ```
-{1,2,3}{4,5,6}{7,8,9} => (3X3X3) => 147 148 149 157 158 159 167 168 169 247 248 
-                                    249 257 258 259 267 268 269 347 348 349 357 
+{1,2,3}{4,5,6}{7,8,9} => (3X3X3) => 147 148 149 157 158 159 167 168 169 247 248
+                                    249 257 258 259 267 268 269 347 348 349 357
                                     358 359 367 368 369
 ```
@@ -425,7 +425,7 @@
 Interested in learning more about brace expansion?
 
-* [linuxjournal/bash-brace-expansion](http://www.linuxjournal.com/content/bash-brace-expansion)
-* [rosettacode/Brace_expansion](https://rosettacode.org/wiki/Brace_expansion)
-* [cartesian product](https://en.wikipedia.org/wiki/Cartesian_product)
+- [linuxjournal/bash-brace-expansion](http://www.linuxjournal.com/content/bash-brace-expansion)
+- [rosettacode/Brace_expansion](https://rosettacode.org/wiki/Brace_expansion)
+- [cartesian product](https://en.wikipedia.org/wiki/Cartesian_product)
 
 </details>
@@ -445,23 +445,23 @@
 Minimatch gets exponentially slower as patterns increase in complexity, braces does not. The following results were generated using `braces()` and `minimatch.braceExpand()`, respectively.
 
-| **Pattern**                 | **braces**         | **[minimatch][]**            |
-| ---                         | ---                | ---                          |
-| `{1..9007199254740991}`[^1] | `298 B` (5ms 459μs)|  N/A (freezes)               |
-| `{1..1000000000000000}`     | `41 B` (1ms 15μs)  |  N/A (freezes)               |
-| `{1..100000000000000}`      | `40 B` (890μs)     |  N/A (freezes)               |
-| `{1..10000000000000}`       | `39 B` (2ms 49μs)  |  N/A (freezes)               |
-| `{1..1000000000000}`        | `38 B` (608μs)     |  N/A (freezes)               |
-| `{1..100000000000}`         | `37 B` (397μs)     |  N/A (freezes)               |
-| `{1..10000000000}`          | `35 B` (983μs)     |  N/A (freezes)               |
-| `{1..1000000000}`           | `34 B` (798μs)     |  N/A (freezes)               |
-| `{1..100000000}`            | `33 B` (733μs)     |  N/A (freezes)               |
-| `{1..10000000}`             | `32 B` (5ms 632μs) | `78.89 MB` (16s 388ms 569μs) |
-| `{1..1000000}`              | `31 B` (1ms 381μs) | `6.89 MB` (1s 496ms 887μs)   |
-| `{1..100000}`               | `30 B` (950μs)     | `588.89 kB` (146ms 921μs)    |
-| `{1..10000}`                | `29 B` (1ms 114μs) | `48.89 kB` (14ms 187μs)      |
-| `{1..1000}`                 | `28 B` (760μs)     | `3.89 kB` (1ms 453μs)        |
-| `{1..100}`                  | `22 B` (345μs)     | `291 B` (196μs)              |
-| `{1..10}`                   | `10 B` (533μs)     | `20 B` (37μs)                |
-| `{1..3}`                    | `7 B` (190μs)      | `5 B` (27μs)                 |
+| **Pattern**                 | **braces**          | **[minimatch][]**            |
+| --------------------------- | ------------------- | ---------------------------- |
+| `{1..9007199254740991}`[^1] | `298 B` (5ms 459μs) | N/A (freezes)                |
+| `{1..1000000000000000}`     | `41 B` (1ms 15μs)   | N/A (freezes)                |
+| `{1..100000000000000}`      | `40 B` (890μs)      | N/A (freezes)                |
+| `{1..10000000000000}`       | `39 B` (2ms 49μs)   | N/A (freezes)                |
+| `{1..1000000000000}`        | `38 B` (608μs)      | N/A (freezes)                |
+| `{1..100000000000}`         | `37 B` (397μs)      | N/A (freezes)                |
+| `{1..10000000000}`          | `35 B` (983μs)      | N/A (freezes)                |
+| `{1..1000000000}`           | `34 B` (798μs)      | N/A (freezes)                |
+| `{1..100000000}`            | `33 B` (733μs)      | N/A (freezes)                |
+| `{1..10000000}`             | `32 B` (5ms 632μs)  | `78.89 MB` (16s 388ms 569μs) |
+| `{1..1000000}`              | `31 B` (1ms 381μs)  | `6.89 MB` (1s 496ms 887μs)   |
+| `{1..100000}`               | `30 B` (950μs)      | `588.89 kB` (146ms 921μs)    |
+| `{1..10000}`                | `29 B` (1ms 114μs)  | `48.89 kB` (14ms 187μs)      |
+| `{1..1000}`                 | `28 B` (760μs)      | `3.89 kB` (1ms 453μs)        |
+| `{1..100}`                  | `22 B` (345μs)      | `291 B` (196μs)              |
+| `{1..10}`                   | `10 B` (533μs)      | `20 B` (37μs)                |
+| `{1..3}`                    | `7 B` (190μs)       | `5 B` (27μs)                 |
 
 ### Faster algorithms
@@ -472,5 +472,5 @@
 
 | **Pattern**     | **braces**                  | **[minimatch][]**            |
-| ---             | ---                         | ---                          |
+| --------------- | --------------------------- | ---------------------------- |
 | `{1..10000000}` | `78.89 MB` (2s 698ms 642μs) | `78.89 MB` (18s 601ms 974μs) |
 | `{1..1000000}`  | `6.89 MB` (458ms 576μs)     | `6.89 MB` (1s 491ms 621μs)   |
@@ -499,35 +499,28 @@
 
 ```bash
-# range (expanded)
-  braces x 29,040 ops/sec ±3.69% (91 runs sampled))
-  minimatch x 4,735 ops/sec ±1.28% (90 runs sampled)
-
-# range (optimized for regex)
-  braces x 382,878 ops/sec ±0.56% (94 runs sampled)
-  minimatch x 1,040 ops/sec ±0.44% (93 runs sampled)
-
-# nested ranges (expanded)
-  braces x 19,744 ops/sec ±2.27% (92 runs sampled))
-  minimatch x 4,579 ops/sec ±0.50% (93 runs sampled)
-
-# nested ranges (optimized for regex)
-  braces x 246,019 ops/sec ±2.02% (93 runs sampled)
-  minimatch x 1,028 ops/sec ±0.39% (94 runs sampled)
-
-# set (expanded) 
-  braces x 138,641 ops/sec ±0.53% (95 runs sampled)
-  minimatch x 219,582 ops/sec ±0.98% (94 runs sampled)
-
-# set (optimized for regex)
-  braces x 388,408 ops/sec ±0.41% (95 runs sampled)
-  minimatch x 44,724 ops/sec ±0.91% (89 runs sampled)
-
-# nested sets (expanded)
-  braces x 84,966 ops/sec ±0.48% (94 runs sampled)
-  minimatch x 140,720 ops/sec ±0.37% (95 runs sampled)
-
-# nested sets (optimized for regex)
-  braces x 263,340 ops/sec ±2.06% (92 runs sampled)
-  minimatch x 28,714 ops/sec ±0.40% (90 runs sampled)
+● expand - range (expanded)
+     braces x 53,167 ops/sec ±0.12% (102 runs sampled)
+  minimatch x 11,378 ops/sec ±0.10% (102 runs sampled)
+● expand - range (optimized for regex)
+     braces x 373,442 ops/sec ±0.04% (100 runs sampled)
+  minimatch x 3,262 ops/sec ±0.18% (100 runs sampled)
+● expand - nested ranges (expanded)
+     braces x 33,921 ops/sec ±0.09% (99 runs sampled)
+  minimatch x 10,855 ops/sec ±0.28% (100 runs sampled)
+● expand - nested ranges (optimized for regex)
+     braces x 287,479 ops/sec ±0.52% (98 runs sampled)
+  minimatch x 3,219 ops/sec ±0.28% (101 runs sampled)
+● expand - set (expanded)
+     braces x 238,243 ops/sec ±0.19% (97 runs sampled)
+  minimatch x 538,268 ops/sec ±0.31% (96 runs sampled)
+● expand - set (optimized for regex)
+     braces x 321,844 ops/sec ±0.10% (97 runs sampled)
+  minimatch x 140,600 ops/sec ±0.15% (100 runs sampled)
+● expand - nested sets (expanded)
+     braces x 165,371 ops/sec ±0.42% (96 runs sampled)
+  minimatch x 337,720 ops/sec ±0.28% (100 runs sampled)
+● expand - nested sets (optimized for regex)
+     braces x 242,948 ops/sec ±0.12% (99 runs sampled)
+  minimatch x 87,403 ops/sec ±0.79% (96 runs sampled)
 ```
 
@@ -567,12 +560,12 @@
 ### Contributors
 
-| **Commits** | **Contributor** |  
-| --- | --- |  
-| 197 | [jonschlinkert](https://github.com/jonschlinkert) |  
-| 4   | [doowb](https://github.com/doowb) |  
-| 1   | [es128](https://github.com/es128) |  
-| 1   | [eush77](https://github.com/eush77) |  
-| 1   | [hemanth](https://github.com/hemanth) |  
-| 1   | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) |  
+| **Commits** | **Contributor**                                               |
+| ----------- | ------------------------------------------------------------- |
+| 197         | [jonschlinkert](https://github.com/jonschlinkert)             |
+| 4           | [doowb](https://github.com/doowb)                             |
+| 1           | [es128](https://github.com/es128)                             |
+| 1           | [eush77](https://github.com/eush77)                           |
+| 1           | [hemanth](https://github.com/hemanth)                         |
+| 1           | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) |
 
 ### Author
@@ -580,7 +573,7 @@
 **Jon Schlinkert**
 
-* [GitHub Profile](https://github.com/jonschlinkert)
-* [Twitter Profile](https://twitter.com/jonschlinkert)
-* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)
+- [GitHub Profile](https://github.com/jonschlinkert)
+- [Twitter Profile](https://twitter.com/jonschlinkert)
+- [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)
 
 ### License
@@ -589,5 +582,5 @@
 Released under the [MIT License](LICENSE).
 
-***
+---
 
\ No newline at end of file
-_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on April 08, 2019._
+_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on April 08, 2019._
diff --git a/lib/compile.js b/lib/compile.js
index v3.0.2..v3.0.3 100644
--- a/lib/compile.js
+++ b/lib/compile.js
@@ -5,9 +5,9 @@
 
 const compile = (ast, options = {}) => {
-  let walk = (node, parent = {}) => {
-    let invalidBlock = utils.isInvalidBrace(parent);
-    let invalidNode = node.invalid === true && options.escapeInvalid === true;
-    let invalid = invalidBlock === true || invalidNode === true;
-    let prefix = options.escapeInvalid === true ? '\\' : '';
+  const walk = (node, parent = {}) => {
+    const invalidBlock = utils.isInvalidBrace(parent);
+    const invalidNode = node.invalid === true && options.escapeInvalid === true;
+    const invalid = invalidBlock === true || invalidNode === true;
+    const prefix = options.escapeInvalid === true ? '\\' : '';
     let output = '';
 
@@ -15,18 +15,20 @@
       return prefix + node.value;
     }
+
     if (node.isClose === true) {
+      console.log('node.isClose', prefix, node.value);
       return prefix + node.value;
     }
 
     if (node.type === 'open') {
-      return invalid ? (prefix + node.value) : '(';
+      return invalid ? prefix + node.value : '(';
     }
 
     if (node.type === 'close') {
-      return invalid ? (prefix + node.value) : ')';
+      return invalid ? prefix + node.value : ')';
     }
 
     if (node.type === 'comma') {
-      return node.prev.type === 'comma' ? '' : (invalid ? node.value : '|');
+      return node.prev.type === 'comma' ? '' : invalid ? node.value : '|';
     }
 
@@ -36,6 +38,6 @@
 
     if (node.nodes && node.ranges > 0) {
-      let args = utils.reduce(node.nodes);
-      let range = fill(...args, { ...options, wrap: false, toRegex: true });
+      const args = utils.reduce(node.nodes);
+      const range = fill(...args, { ...options, wrap: false, toRegex: true, strictZeros: true });
 
       if (range.length !== 0) {
@@ -45,8 +47,9 @@
 
     if (node.nodes) {
-      for (let child of node.nodes) {
+      for (const child of node.nodes) {
         output += walk(child, node);
       }
     }
+
     return output;
   };
diff --git a/lib/constants.js b/lib/constants.js
index v3.0.2..v3.0.3 100644
--- a/lib/constants.js
+++ b/lib/constants.js
@@ -2,5 +2,5 @@
 
 module.exports = {
-  MAX_LENGTH: 1024 * 64,
+  MAX_LENGTH: 10000,
 
   // Digits
diff --git a/lib/expand.js b/lib/expand.js
index v3.0.2..v3.0.3 100644
--- a/lib/expand.js
+++ b/lib/expand.js
@@ -6,5 +6,5 @@
 
 const append = (queue = '', stash = '', enclose = false) => {
-  let result = [];
+  const result = [];
 
   queue = [].concat(queue);
@@ -16,7 +16,7 @@
   }
 
-  for (let item of queue) {
+  for (const item of queue) {
     if (Array.isArray(item)) {
-      for (let value of item) {
+      for (const value of item) {
         result.push(append(value, stash, enclose));
       }
@@ -24,5 +24,5 @@
       for (let ele of stash) {
         if (enclose === true && typeof ele === 'string') ele = `{${ele}}`;
-        result.push(Array.isArray(ele) ? append(item, ele, enclose) : (item + ele));
+        result.push(Array.isArray(ele) ? append(item, ele, enclose) : item + ele);
       }
     }
@@ -32,7 +32,7 @@
 
 const expand = (ast, options = {}) => {
-  let rangeLimit = options.rangeLimit === void 0 ? 1000 : options.rangeLimit;
+  const rangeLimit = options.rangeLimit === undefined ? 1000 : options.rangeLimit;
 
-  let walk = (node, parent = {}) => {
+  const walk = (node, parent = {}) => {
     node.queue = [];
 
@@ -56,5 +56,5 @@
 
     if (node.nodes && node.ranges > 0) {
-      let args = utils.reduce(node.nodes);
+      const args = utils.reduce(node.nodes);
 
       if (utils.exceedsLimit(...args, options.step, rangeLimit)) {
@@ -72,5 +72,5 @@
     }
 
-    let enclose = utils.encloseBrace(node);
+    const enclose = utils.encloseBrace(node);
     let queue = node.queue;
     let block = node;
@@ -82,5 +82,5 @@
 
     for (let i = 0; i < node.nodes.length; i++) {
-      let child = node.nodes[i];
+      const child = node.nodes[i];
 
       if (child.type === 'comma' && node.type === 'brace') {
diff --git a/lib/parse.js b/lib/parse.js
index v3.0.2..v3.0.3 100644
--- a/lib/parse.js
+++ b/lib/parse.js
@@ -34,20 +34,19 @@
   }
 
-  let opts = options || {};
-  let max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
+  const opts = options || {};
+  const max = typeof opts.maxLength === 'number' ? Math.min(MAX_LENGTH, opts.maxLength) : MAX_LENGTH;
   if (input.length > max) {
     throw new SyntaxError(`Input length (${input.length}), exceeds max characters (${max})`);
   }
 
-  let ast = { type: 'root', input, nodes: [] };
-  let stack = [ast];
+  const ast = { type: 'root', input, nodes: [] };
+  const stack = [ast];
   let block = ast;
   let prev = ast;
   let brackets = 0;
-  let length = input.length;
+  const length = input.length;
   let index = 0;
   let depth = 0;
   let value;
-  let memo = {};
 
   /**
@@ -112,5 +111,4 @@
       brackets++;
 
-      let closed = true;
       let next;
 
@@ -168,5 +166,5 @@
 
     if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
-      let open = value;
+      const open = value;
       let next;
 
@@ -200,6 +198,6 @@
       depth++;
 
-      let dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true;
-      let brace = {
+      const dollar = prev.value && prev.value.slice(-1) === '$' || block.dollar === true;
+      const brace = {
         type: 'brace',
         open: true,
@@ -228,5 +226,5 @@
       }
 
-      let type = 'close';
+      const type = 'close';
       block = stack.pop();
       block.close = true;
@@ -246,5 +244,5 @@
       if (block.ranges > 0) {
         block.ranges = 0;
-        let open = block.nodes.shift();
+        const open = block.nodes.shift();
         block.nodes = [open, { type: 'text', value: stringify(block) }];
       }
@@ -260,5 +258,5 @@
 
     if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
-      let siblings = block.nodes;
+      const siblings = block.nodes;
 
       if (depth === 0 || siblings.length === 0) {
@@ -287,5 +285,5 @@
         siblings.pop();
 
-        let before = siblings[siblings.length - 1];
+        const before = siblings[siblings.length - 1];
         before.value += prev.value + value;
         prev = before;
@@ -320,6 +318,6 @@
 
       // get the location of the block on parent.nodes (block's siblings)
-      let parent = stack[stack.length - 1];
-      let index = parent.nodes.indexOf(block);
+      const parent = stack[stack.length - 1];
+      const index = parent.nodes.indexOf(block);
       // replace the (invalid) block with it's nodes
       parent.nodes.splice(index, 1, ...block.nodes);
diff --git a/lib/stringify.js b/lib/stringify.js
index v3.0.2..v3.0.3 100644
--- a/lib/stringify.js
+++ b/lib/stringify.js
@@ -4,7 +4,7 @@
 
 module.exports = (ast, options = {}) => {
-  let stringify = (node, parent = {}) => {
-    let invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
-    let invalidNode = node.invalid === true && options.escapeInvalid === true;
+  const stringify = (node, parent = {}) => {
+    const invalidBlock = options.escapeInvalid && utils.isInvalidBrace(parent);
+    const invalidNode = node.invalid === true && options.escapeInvalid === true;
     let output = '';
 
@@ -21,5 +21,5 @@
 
     if (node.nodes) {
-      for (let child of node.nodes) {
+      for (const child of node.nodes) {
         output += stringify(child);
       }
diff --git a/lib/utils.js b/lib/utils.js
index v3.0.2..v3.0.3 100644
--- a/lib/utils.js
+++ b/lib/utils.js
@@ -32,5 +32,5 @@
 
 exports.escapeNode = (block, n = 0, type) => {
-  let node = block.nodes[n];
+  const node = block.nodes[n];
   if (!node) return;
 
@@ -101,11 +101,21 @@
 exports.flatten = (...args) => {
   const result = [];
+
   const flat = arr => {
     for (let i = 0; i < arr.length; i++) {
-      let ele = arr[i];
-      Array.isArray(ele) ? flat(ele, result) : ele !== void 0 && result.push(ele);
+      const ele = arr[i];
+
+      if (Array.isArray(ele)) {
+        flat(ele);
+        continue;
+      }
+
+      if (ele !== undefined) {
+        result.push(ele);
+      }
     }
     return result;
   };
+
   flat(args);
   return result;
Size Files
48.1 KB → 43.6 KB (-4.5 KB 🟢) 11 → 10 (-1 🟢)
Command details
npm diff --diff=braces@3.0.2 --diff=braces@3.0.3 --diff-unified=2

See also the npm diff document.

Reported by ybiquitous/npm-diff-action@v1.6.0 (Node.js 22.3.0 and npm 10.8.1)

@github-actions github-actions bot merged commit a5915d3 into main Jun 16, 2024
8 checks passed
@github-actions github-actions bot deleted the dependabot/npm_and_yarn/braces-3.0.3 branch June 16, 2024 09:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
dependencies Pull requests that update a dependency file javascript Pull requests that update Javascript code
Projects
None yet
Development

Successfully merging this pull request may close these issues.

0 participants