diff --git a/.github/workflows/test-accessibility-alt-text-bot.yml b/.github/workflows/test-accessibility-alt-text-bot.yml
index bb59bddc..e324cb93 100644
--- a/.github/workflows/test-accessibility-alt-text-bot.yml
+++ b/.github/workflows/test-accessibility-alt-text-bot.yml
@@ -5,11 +5,11 @@ on:
pull_request:
types: [opened, edited]
issue_comment:
- types: [created, edited]
+ types: [created, edited, deleted]
discussion:
types: [created, edited]
discussion_comment:
- types: [created, edited]
+ types: [created, edited, deleted]
jobs:
accessibility_alt_text_bot:
diff --git a/README.md b/README.md
index e13c35ee..de79ce6b 100644
--- a/README.md
+++ b/README.md
@@ -36,11 +36,11 @@ on:
pull_request:
types: [opened, edited]
issue_comment:
- types: [created, edited]
+ types: [created, edited, deleted]
discussion:
types: [created, edited]
discussion_comment:
- types: [created, edited]
+ types: [created, edited, deleted]
permissions:
issues: write
diff --git a/action.yml b/action.yml
index da833e82..adab5114 100644
--- a/action.yml
+++ b/action.yml
@@ -13,13 +13,16 @@ runs:
if [ ${{ github.event.comment }} ]; then
content=$COMMENT
user=${{ github.event.comment.user.login }}
+ target_id=${{ github.event.comment.id }}
if ${{ github.event.issue.pull_request.url != '' }}; then
type=pr_comment
issue_url=${{ github.event.issue.html_url }}
+ bot_comment_id=$(gh api repos/${{ github.repository }}/issues/${{ github.event.issue.number }}/comments | jq -r '.[] | select(.user.login == "github-actions[bot]") | select(.body | test("
Uh oh! @$user, at least one image you shared is missing helpful alt text. Check $target to fix the following violations:
+
+ $flag
Alt text is an invisible description that helps screen readers describe images to blind or low-vision users. If you are using markdown to display images, add your alt text inside the brackets of the markdown image.
@@ -63,16 +75,37 @@ runs:
echo "Detected bad alt text: ${flag}"
echo "Event type: $type"
-
- if [[ $flag = true ]]; then
- if [[ $type = pr_comment ]] || [[ $type = pr_description ]]; then
- gh pr comment $issue_url --body "$message"
- elif [[ $type = issue_comment ]] || [[ $type = issue_description ]]; then
- gh issue comment $issue_url --body "$message"
- elif [[ $type = discussion_description ]]; then
- addDiscussionComment $discussion_node_id "$message"
- elif [[ $type = discussion_comment ]]; then
- addDiscussionComment $discussion_node_id "$message" $reply_to_id
+ if [[ $flag && ${{ github.event.action }} != 'deleted' ]]; then
+ if [ $bot_comment_id ]; then
+ if [[ $type = pr_comment ]] || [[ $type = pr_description ]]; then
+ gh api repos/${{ github.repository }}/issues/comments/$bot_comment_id -X PATCH -f body="$message"
+ elif [[ $type = issue_comment ]] || [[ $type = issue_description ]]; then
+ gh api repos/${{ github.repository }}/issues/comments/$bot_comment_id -X PATCH -f body="$message"
+ elif [[ $type = discussion_description ]] || [[ $type = discussion_comment ]]; then
+ gh api graphql -f query='mutation($commentId: ID!, $body: String!) { updateDiscussionComment(input: {commentId: $commentId, body: $body}) { comment { id body }}}' -f commentId=$bot_comment_id -f body="$message"
+ fi
+ else
+ if [[ $type = pr_comment ]] || [[ $type = pr_description ]]; then
+ gh pr comment $issue_url --body "$message"
+ elif [[ $type = issue_comment ]] || [[ $type = issue_description ]]; then
+ gh issue comment $issue_url --body "$message"
+ elif [[ $type = discussion_description ]]; then
+ addDiscussionComment $discussion_node_id "$message"
+ elif [[ $type = discussion_comment ]]; then
+ addDiscussionComment $discussion_node_id "$message" $reply_to_id
+ fi
+ fi
+ else
+ echo "bot_comment_id: $bot_comment_id"
+ if [ $bot_comment_id ]; then
+ echo "Deleting bot comment..."
+ if [[ $type = pr_comment ]] || [[ $type = pr_description ]]; then
+ gh api -X DELETE /repos/${{ github.repository }}/issues/comments/$bot_comment_id
+ elif [[ $type = issue_comment ]] || [[ $type = issue_description ]]; then
+ gh api -X DELETE /repos/${{ github.repository }}/issues/comments/$bot_comment_id
+ elif [[ $type = discussion_description ]] || [[ $type = discussion_comment ]]; then
+ gh api graphql -f query='mutation($id: ID!) { deleteDiscussionComment(input: {id: $id}) { clientMutationId } }' -f id=$bot_comment_id
+ fi
fi
fi
shell: bash
diff --git a/node_modules/.package-lock.json b/node_modules/.package-lock.json
index 590a4bec..3d0289c7 100644
--- a/node_modules/.package-lock.json
+++ b/node_modules/.package-lock.json
@@ -1332,12 +1332,12 @@
}
},
"node_modules/braces": {
- "version": "3.0.2",
- "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz",
- "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==",
+ "version": "3.0.3",
+ "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz",
+ "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==",
"dev": true,
"dependencies": {
- "fill-range": "^7.0.1"
+ "fill-range": "^7.1.1"
},
"engines": {
"node": ">=8"
@@ -1580,9 +1580,9 @@
}
},
"node_modules/cross-spawn": {
- "version": "7.0.3",
- "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz",
- "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==",
+ "version": "7.0.6",
+ "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz",
+ "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==",
"dev": true,
"dependencies": {
"path-key": "^3.1.0",
@@ -1834,9 +1834,9 @@
}
},
"node_modules/fill-range": {
- "version": "7.0.1",
- "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz",
- "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==",
+ "version": "7.1.1",
+ "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz",
+ "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==",
"dev": true,
"dependencies": {
"to-regex-range": "^5.0.1"
@@ -3150,12 +3150,12 @@
"dev": true
},
"node_modules/micromatch": {
- "version": "4.0.5",
- "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz",
- "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==",
+ "version": "4.0.8",
+ "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz",
+ "integrity": "sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==",
"dev": true,
"dependencies": {
- "braces": "^3.0.2",
+ "braces": "^3.0.3",
"picomatch": "^2.3.1"
},
"engines": {
diff --git a/node_modules/braces/CHANGELOG.md b/node_modules/braces/CHANGELOG.md
deleted file mode 100644
index 36f798b0..00000000
--- a/node_modules/braces/CHANGELOG.md
+++ /dev/null
@@ -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).
-
-
- Guiding Principles
-
-- 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.
-
-
-
-
- Types of changes
-
-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.
-
-
-
-## [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/node_modules/braces/LICENSE b/node_modules/braces/LICENSE
index d32ab442..9af4a67d 100644
--- a/node_modules/braces/LICENSE
+++ b/node_modules/braces/LICENSE
@@ -1,6 +1,6 @@
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
of this software and associated documentation files (the "Software"), to deal
diff --git a/node_modules/braces/README.md b/node_modules/braces/README.md
index cba2f600..f59dd604 100644
--- a/node_modules/braces/README.md
+++ b/node_modules/braces/README.md
@@ -20,15 +20,15 @@ See the [changelog](CHANGELOG.md) for details.
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
@@ -52,9 +52,9 @@ By default, brace patterns are compiled into strings that are optimized for crea
**Compiled**
```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' ]
```
@@ -87,13 +87,13 @@ console.log(braces.expand('a/{foo,bar,baz}/*.js'));
Expand ranges of characters (like Bash "sequences"):
```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']
```
@@ -178,12 +178,12 @@ console.log(braces.expand('a{b}c'));
**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
```
### options.expand
@@ -244,7 +244,7 @@ const alpha = braces.expand('x/{a..e}/y', {
transform(value, index) {
// When non-numeric values are passed, "value" is a character code.
return 'foo/' + String.fromCharCode(value) + '-' + index;
- }
+ },
});
console.log(alpha);
//=> [ 'x/foo/a-0/y', 'x/foo/b-1/y', 'x/foo/c-2/y', 'x/foo/d-3/y', 'x/foo/e-4/y' ]
@@ -257,9 +257,9 @@ const numeric = braces.expand('{1..5}', {
transform(value) {
// 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' ]
```
@@ -281,19 +281,19 @@ The `quantifiers` option tells braces to detect when [regex quantifiers](https:/
const braces = require('braces');
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`
**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"?
@@ -301,8 +301,8 @@ Brace expansion is a type of parameter expansion that was made popular by unix s
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
More about brace expansion (click to expand)
@@ -382,9 +382,9 @@ Although brace patterns offer a user-friendly way of matching ranges or sets of
**"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.
@@ -406,8 +406,8 @@ For example, the following sets demonstrate quadratic (`O(n^2)`) complexity:
But add an element to a set, and we get a n-fold Cartesian product with `O(n^c)` complexity:
```
-{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
```
@@ -424,9 +424,9 @@ Although these examples are clearly contrived, they demonstrate how brace patter
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)
@@ -444,25 +444,25 @@ Instead, convert the pattern into an optimized regular expression. This is easie
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
@@ -471,7 +471,7 @@ When you need expansion, braces is still much faster.
_(the following results were generated using `braces.expand()` and `minimatch.braceExpand()`, respectively)_
| **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) |
| `{1..100000}` | `588.89 kB` (20ms 728μs) | `588.89 kB` (156ms 919μs) |
@@ -498,37 +498,30 @@ npm i -d && npm benchmark
Braces is more accurate, without sacrificing performance.
```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)
```
## About
@@ -566,28 +559,28 @@ $ npm install -g verbose/verb#dev verb-generate-readme && verb
### 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
**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
Copyright © 2019, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT License](LICENSE).
-***
+---
-_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on April 08, 2019._
\ 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._
diff --git a/node_modules/braces/index.js b/node_modules/braces/index.js
index 0eee0f56..d222c13b 100644
--- a/node_modules/braces/index.js
+++ b/node_modules/braces/index.js
@@ -23,8 +23,8 @@ const braces = (input, options = {}) => {
let output = [];
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);
} else {
@@ -158,7 +158,7 @@ braces.create = (input, options = {}) => {
return [input];
}
- return options.expand !== true
+ return options.expand !== true
? braces.compile(input, options)
: braces.expand(input, options);
};
diff --git a/node_modules/braces/lib/compile.js b/node_modules/braces/lib/compile.js
index 3e984a4b..dce69beb 100644
--- a/node_modules/braces/lib/compile.js
+++ b/node_modules/braces/lib/compile.js
@@ -4,30 +4,32 @@ const fill = require('fill-range');
const utils = require('./utils');
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 = '';
if (node.isOpen === true) {
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 : '|';
}
if (node.value) {
@@ -35,8 +37,8 @@ const compile = (ast, options = {}) => {
}
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) {
return args.length > 1 && range.length > 1 ? `(${range})` : range;
@@ -44,10 +46,11 @@ const compile = (ast, options = {}) => {
}
if (node.nodes) {
- for (let child of node.nodes) {
+ for (const child of node.nodes) {
output += walk(child, node);
}
}
+
return output;
};
diff --git a/node_modules/braces/lib/constants.js b/node_modules/braces/lib/constants.js
index a9379436..2bb3b884 100644
--- a/node_modules/braces/lib/constants.js
+++ b/node_modules/braces/lib/constants.js
@@ -1,7 +1,7 @@
'use strict';
module.exports = {
- MAX_LENGTH: 1024 * 64,
+ MAX_LENGTH: 10000,
// Digits
CHAR_0: '0', /* 0 */
diff --git a/node_modules/braces/lib/expand.js b/node_modules/braces/lib/expand.js
index 376c748a..35b2c41d 100644
--- a/node_modules/braces/lib/expand.js
+++ b/node_modules/braces/lib/expand.js
@@ -5,7 +5,7 @@ const stringify = require('./stringify');
const utils = require('./utils');
const append = (queue = '', stash = '', enclose = false) => {
- let result = [];
+ const result = [];
queue = [].concat(queue);
stash = [].concat(stash);
@@ -15,15 +15,15 @@ const append = (queue = '', stash = '', enclose = false) => {
return enclose ? utils.flatten(stash).map(ele => `{${ele}}`) : stash;
}
- 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));
}
} else {
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);
}
}
}
@@ -31,9 +31,9 @@ const append = (queue = '', stash = '', enclose = false) => {
};
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 = [];
let p = parent;
@@ -55,7 +55,7 @@ const expand = (ast, options = {}) => {
}
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)) {
throw new RangeError('expanded array length exceeds range limit. Use options.rangeLimit to increase or disable the limit.');
@@ -71,7 +71,7 @@ const expand = (ast, options = {}) => {
return;
}
- let enclose = utils.encloseBrace(node);
+ const enclose = utils.encloseBrace(node);
let queue = node.queue;
let block = node;
@@ -81,7 +81,7 @@ const expand = (ast, options = {}) => {
}
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') {
if (i === 1) queue.push('');
diff --git a/node_modules/braces/lib/parse.js b/node_modules/braces/lib/parse.js
index 145ea264..3a6988e6 100644
--- a/node_modules/braces/lib/parse.js
+++ b/node_modules/braces/lib/parse.js
@@ -33,22 +33,21 @@ const parse = (input, options = {}) => {
throw new TypeError('Expected a string');
}
- 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 = {};
/**
* Helpers
@@ -111,7 +110,6 @@ const parse = (input, options = {}) => {
if (value === CHAR_LEFT_SQUARE_BRACKET) {
brackets++;
- let closed = true;
let next;
while (index < length && (next = advance())) {
@@ -167,7 +165,7 @@ const parse = (input, options = {}) => {
*/
if (value === CHAR_DOUBLE_QUOTE || value === CHAR_SINGLE_QUOTE || value === CHAR_BACKTICK) {
- let open = value;
+ const open = value;
let next;
if (options.keepQuotes !== true) {
@@ -199,8 +197,8 @@ const parse = (input, options = {}) => {
if (value === CHAR_LEFT_CURLY_BRACE) {
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,
close: false,
@@ -227,7 +225,7 @@ const parse = (input, options = {}) => {
continue;
}
- let type = 'close';
+ const type = 'close';
block = stack.pop();
block.close = true;
@@ -245,7 +243,7 @@ const parse = (input, options = {}) => {
if (value === CHAR_COMMA && depth > 0) {
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) }];
}
@@ -259,7 +257,7 @@ const parse = (input, options = {}) => {
*/
if (value === CHAR_DOT && depth > 0 && block.commas === 0) {
- let siblings = block.nodes;
+ const siblings = block.nodes;
if (depth === 0 || siblings.length === 0) {
push({ type: 'text', value });
@@ -286,7 +284,7 @@ const parse = (input, options = {}) => {
if (prev.type === 'range') {
siblings.pop();
- let before = siblings[siblings.length - 1];
+ const before = siblings[siblings.length - 1];
before.value += prev.value + value;
prev = before;
block.ranges--;
@@ -319,8 +317,8 @@ const parse = (input, options = {}) => {
});
// 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/node_modules/braces/lib/stringify.js b/node_modules/braces/lib/stringify.js
index 414b7bcc..8bcf872c 100644
--- a/node_modules/braces/lib/stringify.js
+++ b/node_modules/braces/lib/stringify.js
@@ -3,9 +3,9 @@
const utils = require('./utils');
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 = '';
if (node.value) {
@@ -20,7 +20,7 @@ module.exports = (ast, options = {}) => {
}
if (node.nodes) {
- for (let child of node.nodes) {
+ for (const child of node.nodes) {
output += stringify(child);
}
}
diff --git a/node_modules/braces/lib/utils.js b/node_modules/braces/lib/utils.js
index e3551a67..d19311fe 100644
--- a/node_modules/braces/lib/utils.js
+++ b/node_modules/braces/lib/utils.js
@@ -31,7 +31,7 @@ exports.exceedsLimit = (min, max, step = 1, limit) => {
*/
exports.escapeNode = (block, n = 0, type) => {
- let node = block.nodes[n];
+ const node = block.nodes[n];
if (!node) return;
if ((type && node.type === type) || node.type === 'open' || node.type === 'close') {
@@ -100,13 +100,23 @@ exports.reduce = nodes => nodes.reduce((acc, node) => {
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;
};
diff --git a/node_modules/braces/package.json b/node_modules/braces/package.json
index 3f52e346..c3c056e4 100644
--- a/node_modules/braces/package.json
+++ b/node_modules/braces/package.json
@@ -1,7 +1,7 @@
{
"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)",
"contributors": [
@@ -29,7 +29,7 @@
"benchmark": "node benchmark"
},
"dependencies": {
- "fill-range": "^7.0.1"
+ "fill-range": "^7.1.1"
},
"devDependencies": {
"ansi-colors": "^3.2.4",
diff --git a/node_modules/cross-spawn/CHANGELOG.md b/node_modules/cross-spawn/CHANGELOG.md
deleted file mode 100644
index d07c9e5c..00000000
--- a/node_modules/cross-spawn/CHANGELOG.md
+++ /dev/null
@@ -1,130 +0,0 @@
-# Changelog
-
-All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
-
-### [7.0.3](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.2...v7.0.3) (2020-05-25)
-
-
-### Bug Fixes
-
-* detect path key based on correct environment ([#133](https://github.com/moxystudio/node-cross-spawn/issues/133)) ([159e7e9](https://github.com/moxystudio/node-cross-spawn/commit/159e7e9785e57451cba034ae51719f97135074ae))
-
-### [7.0.2](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.1...v7.0.2) (2020-04-04)
-
-
-### Bug Fixes
-
-* fix worker threads in Node >=11.10.0 ([#132](https://github.com/moxystudio/node-cross-spawn/issues/132)) ([6c5b4f0](https://github.com/moxystudio/node-cross-spawn/commit/6c5b4f015814a6c4f6b33230dfd1a860aedc0aaf))
-
-### [7.0.1](https://github.com/moxystudio/node-cross-spawn/compare/v7.0.0...v7.0.1) (2019-10-07)
-
-
-### Bug Fixes
-
-* **core:** support worker threads ([#127](https://github.com/moxystudio/node-cross-spawn/issues/127)) ([cfd49c9](https://github.com/moxystudio/node-cross-spawn/commit/cfd49c9))
-
-## [7.0.0](https://github.com/moxystudio/node-cross-spawn/compare/v6.0.5...v7.0.0) (2019-09-03)
-
-
-### ⚠ BREAKING CHANGES
-
-* drop support for Node.js < 8
-
-* drop support for versions below Node.js 8 ([#125](https://github.com/moxystudio/node-cross-spawn/issues/125)) ([16feb53](https://github.com/moxystudio/node-cross-spawn/commit/16feb53))
-
-
-## [6.0.5](https://github.com/moxystudio/node-cross-spawn/compare/v6.0.4...v6.0.5) (2018-03-02)
-
-
-### Bug Fixes
-
-* avoid using deprecated Buffer constructor ([#94](https://github.com/moxystudio/node-cross-spawn/issues/94)) ([d5770df](https://github.com/moxystudio/node-cross-spawn/commit/d5770df)), closes [/nodejs.org/api/deprecations.html#deprecations_dep0005](https://github.com//nodejs.org/api/deprecations.html/issues/deprecations_dep0005)
-
-
-
-
-## [6.0.4](https://github.com/moxystudio/node-cross-spawn/compare/v6.0.3...v6.0.4) (2018-01-31)
-
-
-### Bug Fixes
-
-* fix paths being incorrectly normalized on unix ([06ee3c6](https://github.com/moxystudio/node-cross-spawn/commit/06ee3c6)), closes [#90](https://github.com/moxystudio/node-cross-spawn/issues/90)
-
-
-
-
-## [6.0.3](https://github.com/moxystudio/node-cross-spawn/compare/v6.0.2...v6.0.3) (2018-01-23)
-
-
-
-
-## [6.0.2](https://github.com/moxystudio/node-cross-spawn/compare/v6.0.1...v6.0.2) (2018-01-23)
-
-
-
-
-## [6.0.1](https://github.com/moxystudio/node-cross-spawn/compare/v6.0.0...v6.0.1) (2018-01-23)
-
-
-
-
-# [6.0.0](https://github.com/moxystudio/node-cross-spawn/compare/5.1.0...6.0.0) (2018-01-23)
-
-
-### Bug Fixes
-
-* fix certain arguments not being correctly escaped or causing batch syntax error ([900cf10](https://github.com/moxystudio/node-cross-spawn/commit/900cf10)), closes [#82](https://github.com/moxystudio/node-cross-spawn/issues/82) [#51](https://github.com/moxystudio/node-cross-spawn/issues/51)
-* fix commands as posix relatixe paths not working correctly, e.g.: `./my-command` ([900cf10](https://github.com/moxystudio/node-cross-spawn/commit/900cf10))
-* fix `options` argument being mutated ([900cf10](https://github.com/moxystudio/node-cross-spawn/commit/900cf10))
-* fix commands resolution when PATH was actually Path ([900cf10](https://github.com/moxystudio/node-cross-spawn/commit/900cf10))
-
-
-### Features
-
-* improve compliance with node's ENOENT errors ([900cf10](https://github.com/moxystudio/node-cross-spawn/commit/900cf10))
-* improve detection of node's shell option support ([900cf10](https://github.com/moxystudio/node-cross-spawn/commit/900cf10))
-
-
-### Chores
-
-* upgrade tooling
-* upgrate project to es6 (node v4)
-
-
-### BREAKING CHANGES
-
-* remove support for older nodejs versions, only `node >= 4` is supported
-
-
-
-## [5.1.0](https://github.com/moxystudio/node-cross-spawn/compare/5.0.1...5.1.0) (2017-02-26)
-
-
-### Bug Fixes
-
-* fix `options.shell` support for NodeJS [v4.8](https://github.com/nodejs/node/blob/master/doc/changelogs/CHANGELOG_V4.md#4.8.0)
-
-
-
-## [5.0.1](https://github.com/moxystudio/node-cross-spawn/compare/5.0.0...5.0.1) (2016-11-04)
-
-
-### Bug Fixes
-
-* fix `options.shell` support for NodeJS v7
-
-
-
-# [5.0.0](https://github.com/moxystudio/node-cross-spawn/compare/4.0.2...5.0.0) (2016-10-30)
-
-
-## Features
-
-* add support for `options.shell`
-* improve parsing of shebangs by using [`shebang-command`](https://github.com/kevva/shebang-command) module
-
-
-## Chores
-
-* refactor some code to make it more clear
-* update README caveats
diff --git a/node_modules/cross-spawn/README.md b/node_modules/cross-spawn/README.md
index c4a4da84..1ed9252b 100644
--- a/node_modules/cross-spawn/README.md
+++ b/node_modules/cross-spawn/README.md
@@ -1,24 +1,17 @@
# cross-spawn
-[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][travis-image]][travis-url] [![Build status][appveyor-image]][appveyor-url] [![Coverage Status][codecov-image]][codecov-url] [![Dependency status][david-dm-image]][david-dm-url] [![Dev Dependency status][david-dm-dev-image]][david-dm-dev-url]
+[![NPM version][npm-image]][npm-url] [![Downloads][downloads-image]][npm-url] [![Build Status][ci-image]][ci-url] [![Build status][appveyor-image]][appveyor-url]
[npm-url]:https://npmjs.org/package/cross-spawn
[downloads-image]:https://img.shields.io/npm/dm/cross-spawn.svg
[npm-image]:https://img.shields.io/npm/v/cross-spawn.svg
-[travis-url]:https://travis-ci.org/moxystudio/node-cross-spawn
-[travis-image]:https://img.shields.io/travis/moxystudio/node-cross-spawn/master.svg
+[ci-url]:https://github.com/moxystudio/node-cross-spawn/actions/workflows/ci.yaml
+[ci-image]:https://github.com/moxystudio/node-cross-spawn/actions/workflows/ci.yaml/badge.svg
[appveyor-url]:https://ci.appveyor.com/project/satazor/node-cross-spawn
[appveyor-image]:https://img.shields.io/appveyor/ci/satazor/node-cross-spawn/master.svg
-[codecov-url]:https://codecov.io/gh/moxystudio/node-cross-spawn
-[codecov-image]:https://img.shields.io/codecov/c/github/moxystudio/node-cross-spawn/master.svg
-[david-dm-url]:https://david-dm.org/moxystudio/node-cross-spawn
-[david-dm-image]:https://img.shields.io/david/moxystudio/node-cross-spawn.svg
-[david-dm-dev-url]:https://david-dm.org/moxystudio/node-cross-spawn?type=dev
-[david-dm-dev-image]:https://img.shields.io/david/dev/moxystudio/node-cross-spawn.svg
A cross platform solution to node's spawn and spawnSync.
-
## Installation
Node.js version 8 and up:
diff --git a/node_modules/cross-spawn/lib/enoent.js b/node_modules/cross-spawn/lib/enoent.js
index 14df9b62..da334713 100644
--- a/node_modules/cross-spawn/lib/enoent.js
+++ b/node_modules/cross-spawn/lib/enoent.js
@@ -24,7 +24,7 @@ function hookChildProcess(cp, parsed) {
// the command exists and emit an "error" instead
// See https://github.com/IndigoUnited/node-cross-spawn/issues/16
if (name === 'exit') {
- const err = verifyENOENT(arg1, parsed, 'spawn');
+ const err = verifyENOENT(arg1, parsed);
if (err) {
return originalEmit.call(cp, 'error', err);
diff --git a/node_modules/cross-spawn/lib/util/escape.js b/node_modules/cross-spawn/lib/util/escape.js
index b0bb84c3..7bf2905c 100644
--- a/node_modules/cross-spawn/lib/util/escape.js
+++ b/node_modules/cross-spawn/lib/util/escape.js
@@ -15,15 +15,17 @@ function escapeArgument(arg, doubleEscapeMetaChars) {
arg = `${arg}`;
// Algorithm below is based on https://qntm.org/cmd
+ // It's slightly altered to disable JS backtracking to avoid hanging on specially crafted input
+ // Please see https://github.com/moxystudio/node-cross-spawn/pull/160 for more information
// Sequence of backslashes followed by a double quote:
// double up all the backslashes and escape the double quote
- arg = arg.replace(/(\\*)"/g, '$1$1\\"');
+ arg = arg.replace(/(?=(\\+?)?)\1"/g, '$1$1\\"');
// Sequence of backslashes followed by the end of the string
// (which will become a double quote later):
// double up all the backslashes
- arg = arg.replace(/(\\*)$/, '$1$1');
+ arg = arg.replace(/(?=(\\+?)?)\1$/, '$1$1');
// All other backslashes occur literally
diff --git a/node_modules/cross-spawn/package.json b/node_modules/cross-spawn/package.json
index 232ff97e..24b2eb4c 100644
--- a/node_modules/cross-spawn/package.json
+++ b/node_modules/cross-spawn/package.json
@@ -1,6 +1,6 @@
{
"name": "cross-spawn",
- "version": "7.0.3",
+ "version": "7.0.6",
"description": "Cross platform child_process#spawn and child_process#spawnSync",
"keywords": [
"spawn",
@@ -65,7 +65,7 @@
"lint-staged": "^9.2.5",
"mkdirp": "^0.5.1",
"rimraf": "^3.0.0",
- "standard-version": "^7.0.0"
+ "standard-version": "^9.5.0"
},
"engines": {
"node": ">= 8"
diff --git a/node_modules/fill-range/index.js b/node_modules/fill-range/index.js
index 97ce35a5..ddb212ee 100644
--- a/node_modules/fill-range/index.js
+++ b/node_modules/fill-range/index.js
@@ -60,7 +60,7 @@ const toMaxLen = (input, maxLength) => {
return negative ? ('-' + input) : input;
};
-const toSequence = (parts, options) => {
+const toSequence = (parts, options, maxLen) => {
parts.negatives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
parts.positives.sort((a, b) => a < b ? -1 : a > b ? 1 : 0);
@@ -70,11 +70,11 @@ const toSequence = (parts, options) => {
let result;
if (parts.positives.length) {
- positives = parts.positives.join('|');
+ positives = parts.positives.map(v => toMaxLen(String(v), maxLen)).join('|');
}
if (parts.negatives.length) {
- negatives = `-(${prefix}${parts.negatives.join('|')})`;
+ negatives = `-(${prefix}${parts.negatives.map(v => toMaxLen(String(v), maxLen)).join('|')})`;
}
if (positives && negatives) {
@@ -172,7 +172,7 @@ const fillNumbers = (start, end, step = 1, options = {}) => {
if (options.toRegex === true) {
return step > 1
- ? toSequence(parts, options)
+ ? toSequence(parts, options, maxLen)
: toRegex(range, null, { wrap: false, ...options });
}
@@ -184,7 +184,6 @@ const fillLetters = (start, end, step = 1, options = {}) => {
return invalidRange(start, end, options);
}
-
let format = options.transform || (val => String.fromCharCode(val));
let a = `${start}`.charCodeAt(0);
let b = `${end}`.charCodeAt(0);
diff --git a/node_modules/fill-range/package.json b/node_modules/fill-range/package.json
index 07d30767..582357fb 100644
--- a/node_modules/fill-range/package.json
+++ b/node_modules/fill-range/package.json
@@ -1,7 +1,7 @@
{
"name": "fill-range",
"description": "Fill in a range of numbers or letters, optionally passing an increment or `step` to use, or create a regex-compatible range with `options.toRegex`",
- "version": "7.0.1",
+ "version": "7.1.1",
"homepage": "https://github.com/jonschlinkert/fill-range",
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
"contributors": [
@@ -24,14 +24,19 @@
"node": ">=8"
},
"scripts": {
- "test": "mocha"
+ "lint": "eslint --cache --cache-location node_modules/.cache/.eslintcache --report-unused-disable-directives --ignore-path .gitignore .",
+ "mocha": "mocha --reporter dot",
+ "test": "npm run lint && npm run mocha",
+ "test:ci": "npm run test:cover",
+ "test:cover": "nyc npm run mocha"
},
"dependencies": {
"to-regex-range": "^5.0.1"
},
"devDependencies": {
"gulp-format-md": "^2.0.0",
- "mocha": "^6.1.1"
+ "mocha": "^6.1.1",
+ "nyc": "^15.1.0"
},
"keywords": [
"alpha",
diff --git a/node_modules/micromatch/README.md b/node_modules/micromatch/README.md
index fd563365..d72a059a 100644
--- a/node_modules/micromatch/README.md
+++ b/node_modules/micromatch/README.md
@@ -9,57 +9,67 @@ Please consider following this project's author, [Jon Schlinkert](https://github
Details
-- [Install](#install)
-- [Quickstart](#quickstart)
-- [Why use micromatch?](#why-use-micromatch)
- * [Matching features](#matching-features)
-- [Switching to micromatch](#switching-to-micromatch)
- * [From minimatch](#from-minimatch)
- * [From multimatch](#from-multimatch)
-- [API](#api)
-- [Options](#options)
-- [Options Examples](#options-examples)
- * [options.basename](#optionsbasename)
- * [options.bash](#optionsbash)
- * [options.expandRange](#optionsexpandrange)
- * [options.format](#optionsformat)
- * [options.ignore](#optionsignore)
- * [options.matchBase](#optionsmatchbase)
- * [options.noextglob](#optionsnoextglob)
- * [options.nonegate](#optionsnonegate)
- * [options.noglobstar](#optionsnoglobstar)
- * [options.nonull](#optionsnonull)
- * [options.nullglob](#optionsnullglob)
- * [options.onIgnore](#optionsonignore)
- * [options.onMatch](#optionsonmatch)
- * [options.onResult](#optionsonresult)
- * [options.posixSlashes](#optionsposixslashes)
- * [options.unescape](#optionsunescape)
-- [Extended globbing](#extended-globbing)
- * [Extglobs](#extglobs)
- * [Braces](#braces)
- * [Regex character classes](#regex-character-classes)
- * [Regex groups](#regex-groups)
- * [POSIX bracket expressions](#posix-bracket-expressions)
-- [Notes](#notes)
- * [Bash 4.3 parity](#bash-43-parity)
- * [Backslashes](#backslashes)
-- [Benchmarks](#benchmarks)
- * [Running benchmarks](#running-benchmarks)
- * [Latest results](#latest-results)
-- [Contributing](#contributing)
-- [About](#about)
+ * [Install](#install)
+- [Sponsors](#sponsors)
+ * [Gold Sponsors](#gold-sponsors)
+ * [Quickstart](#quickstart)
+ * [Why use micromatch?](#why-use-micromatch)
+ + [Matching features](#matching-features)
+ * [Switching to micromatch](#switching-to-micromatch)
+ + [From minimatch](#from-minimatch)
+ + [From multimatch](#from-multimatch)
+ * [API](#api)
+ * [Options](#options)
+ * [Options Examples](#options-examples)
+ + [options.basename](#optionsbasename)
+ + [options.bash](#optionsbash)
+ + [options.expandRange](#optionsexpandrange)
+ + [options.format](#optionsformat)
+ + [options.ignore](#optionsignore)
+ + [options.matchBase](#optionsmatchbase)
+ + [options.noextglob](#optionsnoextglob)
+ + [options.nonegate](#optionsnonegate)
+ + [options.noglobstar](#optionsnoglobstar)
+ + [options.nonull](#optionsnonull)
+ + [options.nullglob](#optionsnullglob)
+ + [options.onIgnore](#optionsonignore)
+ + [options.onMatch](#optionsonmatch)
+ + [options.onResult](#optionsonresult)
+ + [options.posixSlashes](#optionsposixslashes)
+ + [options.unescape](#optionsunescape)
+ * [Extended globbing](#extended-globbing)
+ + [Extglobs](#extglobs)
+ + [Braces](#braces)
+ + [Regex character classes](#regex-character-classes)
+ + [Regex groups](#regex-groups)
+ + [POSIX bracket expressions](#posix-bracket-expressions)
+ * [Notes](#notes)
+ + [Bash 4.3 parity](#bash-43-parity)
+ + [Backslashes](#backslashes)
+ * [Benchmarks](#benchmarks)
+ + [Running benchmarks](#running-benchmarks)
+ + [Latest results](#latest-results)
+ * [Contributing](#contributing)
+ * [About](#about)
## Install
-Install with [npm](https://www.npmjs.com/) (requires [Node.js](https://nodejs.org/en/) >=8.6):
+Install with [npm](https://www.npmjs.com/):
```sh
$ npm install --save micromatch
```
+
+
+# Sponsors
+
+[Become a Sponsor](https://github.com/sponsors/jonschlinkert) to add your logo to this README, or any of [my other projects](https://github.com/jonschlinkert?tab=repositories&q=&type=&language=&sort=stargazers)
+
+
+
## Quickstart
```js
@@ -157,7 +167,7 @@ console.log(mm(['a.js', 'a.txt'], ['*.js']));
//=> [ 'a.js' ]
```
-### [.matcher](index.js#L104)
+### [.matcher](index.js#L109)
Returns a matcher function from the given glob `pattern` and `options`. The returned function takes a string to match as its only argument and returns true if the string is a match.
@@ -178,7 +188,7 @@ console.log(isMatch('a.a')); //=> false
console.log(isMatch('a.b')); //=> true
```
-### [.isMatch](index.js#L123)
+### [.isMatch](index.js#L128)
Returns true if **any** of the given glob `patterns` match the specified `string`.
@@ -199,7 +209,7 @@ console.log(mm.isMatch('a.a', ['b.*', '*.a'])); //=> true
console.log(mm.isMatch('a.a', 'b.*')); //=> false
```
-### [.not](index.js#L148)
+### [.not](index.js#L153)
Returns a list of strings that _**do not match any**_ of the given `patterns`.
@@ -220,7 +230,7 @@ console.log(mm.not(['a.a', 'b.b', 'c.c'], '*.a'));
//=> ['b.b', 'c.c']
```
-### [.contains](index.js#L188)
+### [.contains](index.js#L193)
Returns true if the given `string` contains the given pattern. Similar to [.isMatch](#isMatch) but the pattern can match any part of the string.
@@ -243,7 +253,7 @@ console.log(mm.contains('aa/bb/cc', '*d'));
//=> false
```
-### [.matchKeys](index.js#L230)
+### [.matchKeys](index.js#L235)
Filter the keys of the given object with the given `glob` pattern and `options`. Does not attempt to match nested keys. If you need this feature, use [glob-object](https://github.com/jonschlinkert/glob-object) instead.
@@ -265,7 +275,7 @@ console.log(mm.matchKeys(obj, '*b'));
//=> { ab: 'b' }
```
-### [.some](index.js#L259)
+### [.some](index.js#L264)
Returns true if some of the strings in the given `list` match any of the given glob `patterns`.
@@ -288,7 +298,7 @@ console.log(mm.some(['foo.js'], ['*.js', '!foo.js']));
// false
```
-### [.every](index.js#L295)
+### [.every](index.js#L300)
Returns true if every string in the given `list` matches any of the given glob `patterns`.
@@ -315,7 +325,7 @@ console.log(mm.every(['foo.js'], ['*.js', '!foo.js']));
// false
```
-### [.all](index.js#L334)
+### [.all](index.js#L339)
Returns true if **all** of the given `patterns` match the specified string.
@@ -345,7 +355,7 @@ console.log(mm.all('foo.js', ['*.js', 'f*', '*o*', '*o.js']));
// true
```
-### [.capture](index.js#L361)
+### [.capture](index.js#L366)
Returns an array of matches captured by `pattern` in `string, or`null` if the pattern did not match.
@@ -368,7 +378,7 @@ console.log(mm.capture('test/*.js', 'foo/bar.css'));
//=> null
```
-### [.makeRe](index.js#L387)
+### [.makeRe](index.js#L392)
Create a regular expression from the given glob `pattern`.
@@ -388,7 +398,7 @@ console.log(mm.makeRe('*.js'));
//=> /^(?:(\.[\\\/])?(?!\.)(?=.)[^\/]*?\.js)$/
```
-### [.scan](index.js#L403)
+### [.scan](index.js#L408)
Scan a glob pattern to separate the pattern into segments. Used by the [split](#split) method.
@@ -405,7 +415,7 @@ const mm = require('micromatch');
const state = mm.scan(pattern[, options]);
```
-### [.parse](index.js#L419)
+### [.parse](index.js#L424)
Parse a glob pattern to create the source string for a regular expression.
@@ -422,7 +432,7 @@ const mm = require('micromatch');
const state = mm.parse(pattern[, options]);
```
-### [.braces](index.js#L446)
+### [.braces](index.js#L451)
Process the given brace `pattern`.
@@ -845,7 +855,7 @@ $ npm run bench
### Latest results
-As of March 24, 2022 (longer bars are better):
+As of August 23, 2024 (longer bars are better):
```sh
# .makeRe star
@@ -963,35 +973,38 @@ You might also be interested in these projects:
| **Commits** | **Contributor** |
| --- | --- |
-| 512 | [jonschlinkert](https://github.com/jonschlinkert) |
+| 523 | [jonschlinkert](https://github.com/jonschlinkert) |
| 12 | [es128](https://github.com/es128) |
| 9 | [danez](https://github.com/danez) |
| 8 | [doowb](https://github.com/doowb) |
| 6 | [paulmillr](https://github.com/paulmillr) |
| 5 | [mrmlnc](https://github.com/mrmlnc) |
| 3 | [DrPizza](https://github.com/DrPizza) |
-| 2 | [TrySound](https://github.com/TrySound) |
-| 2 | [mceIdo](https://github.com/mceIdo) |
-| 2 | [Glazy](https://github.com/Glazy) |
-| 2 | [MartinKolarik](https://github.com/MartinKolarik) |
-| 2 | [antonyk](https://github.com/antonyk) |
| 2 | [Tvrqvoise](https://github.com/Tvrqvoise) |
-| 1 | [amilajack](https://github.com/amilajack) |
-| 1 | [Cslove](https://github.com/Cslove) |
-| 1 | [devongovett](https://github.com/devongovett) |
-| 1 | [DianeLooney](https://github.com/DianeLooney) |
-| 1 | [UltCombo](https://github.com/UltCombo) |
-| 1 | [frangio](https://github.com/frangio) |
-| 1 | [joyceerhl](https://github.com/joyceerhl) |
-| 1 | [juszczykjakub](https://github.com/juszczykjakub) |
-| 1 | [muescha](https://github.com/muescha) |
-| 1 | [sebdeckers](https://github.com/sebdeckers) |
-| 1 | [tomByrer](https://github.com/tomByrer) |
-| 1 | [fidian](https://github.com/fidian) |
-| 1 | [curbengh](https://github.com/curbengh) |
-| 1 | [simlu](https://github.com/simlu) |
-| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) |
+| 2 | [antonyk](https://github.com/antonyk) |
+| 2 | [MartinKolarik](https://github.com/MartinKolarik) |
+| 2 | [Glazy](https://github.com/Glazy) |
+| 2 | [mceIdo](https://github.com/mceIdo) |
+| 2 | [TrySound](https://github.com/TrySound) |
| 1 | [yvele](https://github.com/yvele) |
+| 1 | [wtgtybhertgeghgtwtg](https://github.com/wtgtybhertgeghgtwtg) |
+| 1 | [simlu](https://github.com/simlu) |
+| 1 | [curbengh](https://github.com/curbengh) |
+| 1 | [fidian](https://github.com/fidian) |
+| 1 | [tomByrer](https://github.com/tomByrer) |
+| 1 | [ZoomerTedJackson](https://github.com/ZoomerTedJackson) |
+| 1 | [styfle](https://github.com/styfle) |
+| 1 | [sebdeckers](https://github.com/sebdeckers) |
+| 1 | [muescha](https://github.com/muescha) |
+| 1 | [juszczykjakub](https://github.com/juszczykjakub) |
+| 1 | [joyceerhl](https://github.com/joyceerhl) |
+| 1 | [donatj](https://github.com/donatj) |
+| 1 | [frangio](https://github.com/frangio) |
+| 1 | [UltCombo](https://github.com/UltCombo) |
+| 1 | [DianeLooney](https://github.com/DianeLooney) |
+| 1 | [devongovett](https://github.com/devongovett) |
+| 1 | [Cslove](https://github.com/Cslove) |
+| 1 | [amilajack](https://github.com/amilajack) |
### Author
@@ -1003,9 +1016,9 @@ You might also be interested in these projects:
### License
-Copyright © 2022, [Jon Schlinkert](https://github.com/jonschlinkert).
+Copyright © 2024, [Jon Schlinkert](https://github.com/jonschlinkert).
Released under the [MIT License](LICENSE).
***
-_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on March 24, 2022._
\ 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 August 23, 2024._
\ No newline at end of file
diff --git a/node_modules/micromatch/index.js b/node_modules/micromatch/index.js
index 1fad7f72..cb9d9ef3 100644
--- a/node_modules/micromatch/index.js
+++ b/node_modules/micromatch/index.js
@@ -4,7 +4,12 @@ const util = require('util');
const braces = require('braces');
const picomatch = require('picomatch');
const utils = require('picomatch/lib/utils');
-const isEmptyString = val => val === '' || val === './';
+
+const isEmptyString = v => v === '' || v === './';
+const hasBraces = v => {
+ const index = v.indexOf('{');
+ return index > -1 && v.indexOf('}', index) > -1;
+};
/**
* Returns an array of strings that match one or more glob patterns.
@@ -445,7 +450,7 @@ micromatch.parse = (patterns, options) => {
micromatch.braces = (pattern, options) => {
if (typeof pattern !== 'string') throw new TypeError('Expected a string');
- if ((options && options.nobrace === true) || !/\{.*\}/.test(pattern)) {
+ if ((options && options.nobrace === true) || !hasBraces(pattern)) {
return [pattern];
}
return braces(pattern, options);
@@ -464,4 +469,6 @@ micromatch.braceExpand = (pattern, options) => {
* Expose micromatch
*/
+// exposed for tests
+micromatch.hasBraces = hasBraces;
module.exports = micromatch;
diff --git a/node_modules/micromatch/package.json b/node_modules/micromatch/package.json
index 6061d5be..d5558bb9 100644
--- a/node_modules/micromatch/package.json
+++ b/node_modules/micromatch/package.json
@@ -1,7 +1,7 @@
{
"name": "micromatch",
"description": "Glob matching for javascript/node.js. A replacement and faster alternative to minimatch and multimatch.",
- "version": "4.0.5",
+ "version": "4.0.8",
"homepage": "https://github.com/micromatch/micromatch",
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
"contributors": [
@@ -37,7 +37,7 @@
"test": "mocha"
},
"dependencies": {
- "braces": "^3.0.2",
+ "braces": "^3.0.3",
"picomatch": "^2.3.1"
},
"devDependencies": {
diff --git a/src/index.js b/src/index.js
index 855a933f..c92ff568 100644
--- a/src/index.js
+++ b/src/index.js
@@ -2,8 +2,9 @@ import { validate } from "./validate.js";
const [content] = process.argv.slice(2);
+
const run = async () => {
- console.log((await validate(content)).length > 0);
+ console.log((await validate(content)));
};
run();
diff --git a/src/index.test.js b/src/index.test.js
index ca0b8e98..a3b5c440 100644
--- a/src/index.test.js
+++ b/src/index.test.js
@@ -2,134 +2,134 @@ import { validate } from "./validate.js";
test("no-alt-text: should return errors", async () => {
let result = await validate("![]()");
- expect(result[0]).toBe("Images should have alternate text (alt text)");
+ expect(result).toBe("- Images should have alternate text (alt text) at line 1");
result = await validate('');
- expect(result[0]).toBe("Images should have alternate text (alt text)");
+ expect(result).toBe("- Images should have alternate text (alt text) at line 1");
result = await validate('');
- expect(result[0]).toBe("Images should have alternate text (alt text)");
+ expect(result).toBe("- Images should have alternate text (alt text) at line 1");
result = await validate('');
- expect(result[0]).toBe("Images should have alternate text (alt text)");
+ expect(result).toBe("- Images should have alternate text (alt text) at line 1");
});
test("no-default-alt-text: should return errors", async () => {
let result = await validate("![Cleanshot 2020-01-01 at 12.00.00.png]()");
- expect(result[0]).toBe(
- "Images should have meaningful alternative text (alt text)"
+ expect(result).toBe(
+ "- Images should have meaningful alternative text (alt text) at line 1"
);
result = await validate("![Clean shot 2020-12-01 @12x]()");
- expect(result[0]).toBe(
- "Images should have meaningful alternative text (alt text)"
+ expect(result).toBe(
+ "- Images should have meaningful alternative text (alt text) at line 1"
);
result = await validate("![Clean shot 2020-12-01 @12x]()");
- expect(result[0]).toBe(
- "Images should have meaningful alternative text (alt text)"
+ expect(result).toBe(
+ "- Images should have meaningful alternative text (alt text) at line 1"
);
result = await validate("![Screen Shot 2020-01-01 at 12.00.00.png]()");
- expect(result[0]).toBe(
- "Images should have meaningful alternative text (alt text)"
+ expect(result).toBe(
+ "- Images should have meaningful alternative text (alt text) at line 1"
);
result = await validate("![Screenshot 2020-01-01 at 12.00.00.png]()");
- expect(result[0]).toBe(
- "Images should have meaningful alternative text (alt text)"
+ expect(result).toBe(
+ "- Images should have meaningful alternative text (alt text) at line 1"
);
result = await validate("![Screencast 2020-01-01 at 12.00.00.png]()");
- expect(result[0]).toBe(
- "Images should have meaningful alternative text (alt text)"
+ expect(result).toBe(
+ "- Images should have meaningful alternative text (alt text) at line 1"
);
result = await validate("![image]()");
- expect(result[0]).toBe(
- "Images should have meaningful alternative text (alt text)"
+ expect(result).toBe(
+ "- Images should have meaningful alternative text (alt text) at line 1"
);
result = await validate("![Image]()");
- expect(result[0]).toBe(
- "Images should have meaningful alternative text (alt text)"
+ expect(result).toBe(
+ "- Images should have meaningful alternative text (alt text) at line 1"
);
result = await validate("Check this: ![Image]()");
- expect(result[0]).toBe(
- "Images should have meaningful alternative text (alt text)"
+ expect(result).toBe(
+ "- Images should have meaningful alternative text (alt text) at line 1"
);
result = await validate("My awesome ![image]()");
- expect(result[0]).toBe(
- "Images should have meaningful alternative text (alt text)"
+ expect(result).toBe(
+ "- Images should have meaningful alternative text (alt text) at line 1"
);
result = await validate('Check this out: ');
- expect(result[0]).toBe(
- "Images should have meaningful alternative text (alt text)"
+ expect(result).toBe(
+ "- Images should have meaningful alternative text (alt text) at line 1"
);
result = await validate('');
- expect(result[0]).toBe(
- "Images should have meaningful alternative text (alt text)"
+ expect(result).toBe(
+ "- Images should have meaningful alternative text (alt text) at line 1"
);
result = await validate('');
- expect(result[0]).toBe(
- "Please provide an alternative text for the image."
+ expect(result).toBe(
+ "- Please provide an alternative text for the image. at line 1"
);
result = await validate("");
- expect(result[0]).toBe(
- "Please provide an alternative text for the image."
+ expect(result).toBe(
+ "- Please provide an alternative text for the image. at line 1"
);
result = await validate(
''
);
- expect(result[0]).toBe(
- "Images should have meaningful alternative text (alt text)"
+ expect(result).toBe(
+ "- Images should have meaningful alternative text (alt text) at line 1"
);
result = await validate(
''
);
- expect(result[0]).toBe(
- "Images should have meaningful alternative text (alt text)"
+ expect(result).toBe(
+ "- Images should have meaningful alternative text (alt text) at line 1"
);
result = await validate(
''
);
- expect(result[0]).toBe(
- "Images should have meaningful alternative text (alt text)"
+ expect(result).toBe(
+ "- Images should have meaningful alternative text (alt text) at line 1"
);
result = await validate(
''
);
result = await validate('');
- expect(result[0]).toBe(
- "Images should have meaningful alternative text (alt text)"
+ expect(result).toBe(
+ "- Images should have meaningful alternative text (alt text) at line 1"
);
- expect(result[0]).toBe(
- "Images should have meaningful alternative text (alt text)"
+ expect(result).toBe(
+ "- Images should have meaningful alternative text (alt text) at line 1"
);
});
test("no-alt-text: should not return errors", async () => {
let result = await validate("```![]()```");
- expect(result.length).toBe(0);
+ expect(result).toBe("");
});
test("no-default-alt-text: should not return errors", async () => {
let result = await validate("![Mona Lisa, the Octocat](cat.png)");
- expect(result.length).toBe(0);
+ expect(result).toBe("");
result = await validate(
"![Screen shot of Submit button with updated color contrast.]()"
);
- expect(result.length).toBe(0);
+ expect(result).toBe("");
result = await validate("![Image of a cat]()");
- expect(result.length).toBe(0);
+ expect(result).toBe("");
result = await validate("![Screenshot of the new GitHub home page]()");
- expect(result.length).toBe(0);
+ expect(result).toBe("");
result = await validate(
''
);
- expect(result.length).toBe(0);
+ expect(result).toBe("");
result = await validate(
''
);
- expect(result.length).toBe(0);
+ expect(result).toBe("");
result = await validate('');
- expect(result.length).toBe(0);
+ expect(result).toBe("");
result = await validate('');
- expect(result.length).toBe(0);
+ expect(result).toBe("");
result = await validate(
'``````'
);
- expect(result.length).toBe(0);
+ expect(result).toBe("");
result = await validate("```![Image]()```");
- expect(result.length).toBe(0);
+ expect(result).toBe("");
});
diff --git a/src/validate.js b/src/validate.js
index e3c4374e..d1272e92 100644
--- a/src/validate.js
+++ b/src/validate.js
@@ -1,8 +1,8 @@
import markdownlint from "markdownlint";
import markdownlintGitHub from "@github/markdownlint-github";
-export const validate = (markdown) =>
- markdownlint
+export const validate = (markdown) =>
+ (markdownlint
.sync({
strings: {
content: markdown,
@@ -17,5 +17,5 @@ export const validate = (markdown) =>
customRules: markdownlintGitHub,
})
.content?.map((error) => {
- return error.ruleDescription;
- }) ?? [];
+ return `- ${error.ruleDescription} at line ${error.lineNumber}`;
+ }) ?? []).join("\n");
diff --git a/yarn.lock b/yarn.lock
index 51e04f55..7761eaac 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -23,7 +23,7 @@
resolved "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.22.20.tgz"
integrity sha512-BQYjKbpXjoXwFW5jGqiizJQQT/aC7pFm9Ok1OWssonuguICi264lbgMzRp2ZMmRSlfkX6DsWDDcsrctK8Rwfiw==
-"@babel/core@^7.11.6", "@babel/core@^7.12.3":
+"@babel/core@^7.0.0", "@babel/core@^7.0.0-0", "@babel/core@^7.11.6", "@babel/core@^7.12.3", "@babel/core@^7.8.0":
version "7.23.0"
resolved "https://registry.npmjs.org/@babel/core/-/core-7.23.0.tgz"
integrity sha512-97z/ju/Jy1rZmDxybphrBuI+jtJjFVoz7Mr9yUQVVVi+DNZE333uFQeMOqcCIy1x3WYBIbWftUSLmbNXNT7qFQ==
@@ -798,12 +798,12 @@ brace-expansion@^1.1.7:
braces@^3.0.3:
version "3.0.3"
- resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.3.tgz#490332f40919452272d55a8480adc0c441358789"
+ resolved "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz"
integrity sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==
dependencies:
fill-range "^7.1.1"
-browserslist@^4.21.9:
+browserslist@^4.21.9, "browserslist@>= 4.21.0":
version "4.22.1"
resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.22.1.tgz"
integrity sha512-FEVc202+2iuClEhZhrWy6ZiAcRLvNMyYcxZ8raemul1DYVOVdFsbqckWLdsixQZCpJlwe77Z3UTalE7jsjnKfQ==
@@ -936,16 +936,16 @@ color-convert@^2.0.1:
dependencies:
color-name "~1.1.4"
-color-name@1.1.3:
- version "1.1.3"
- resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz"
- integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==
-
color-name@~1.1.4:
version "1.1.4"
resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz"
integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==
+color-name@1.1.3:
+ version "1.1.3"
+ resolved "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz"
+ integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==
+
concat-map@0.0.1:
version "0.0.1"
resolved "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz"
@@ -976,7 +976,7 @@ create-jest@^29.7.0:
cross-spawn@^7.0.3:
version "7.0.6"
- resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.6.tgz#8a58fe78f00dcd70c370451759dfbfaf03e8ee9f"
+ resolved "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz"
integrity sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==
dependencies:
path-key "^3.1.0"
@@ -1128,7 +1128,7 @@ figures@^3.0.0:
fill-range@^7.1.1:
version "7.1.1"
- resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.1.1.tgz#44265d3cac07e3ea7dc247516380643754a05292"
+ resolved "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz"
integrity sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==
dependencies:
to-regex-range "^5.0.1"
@@ -1146,11 +1146,6 @@ fs.realpath@^1.0.0:
resolved "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz"
integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==
-fsevents@^2.3.2:
- version "2.3.3"
- resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.3.tgz#cac6407785d03675a2a5e1a5305c697b347d90d6"
- integrity sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==
-
gensync@^1.0.0-beta.2:
version "1.0.0-beta.2"
resolved "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.2.tgz"
@@ -1564,7 +1559,7 @@ jest-resolve-dependencies@^29.7.0:
jest-regex-util "^29.6.3"
jest-snapshot "^29.7.0"
-jest-resolve@^29.7.0:
+jest-resolve@*, jest-resolve@^29.7.0:
version "29.7.0"
resolved "https://registry.npmjs.org/jest-resolve/-/jest-resolve-29.7.0.tgz"
integrity sha512-IOVhZSrg+UvVAshDSDtHyFCCBUl/Q3AAJv8iZ6ZjnZ74xzvwuzLXid9IIIPgTnY62SJjfuupMKZsZQRsCvxEgA==
@@ -1854,7 +1849,7 @@ merge-stream@^2.0.0:
micromatch@^4.0.4:
version "4.0.8"
- resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.8.tgz#d66fa18f3a47076789320b9b1af32bd86d9fa202"
+ resolved "https://registry.npmjs.org/micromatch/-/micromatch-4.0.8.tgz"
integrity sha512-PXwfBhYu0hBCPw8Dn0E+WDYb7af3dSLVWKi3HGv84IdF4TyFoC0ysxFd0Goxw7nSv4T/PzEJQxsYsEiFCKo2BA==
dependencies:
braces "^3.0.3"
@@ -2126,7 +2121,14 @@ semver@^6.3.0, semver@^6.3.1:
resolved "https://registry.npmjs.org/semver/-/semver-6.3.1.tgz"
integrity sha512-BR7VvDCVHO+q2xBEWskxS6DJE1qRnb7DxzUrogb71CWoSficBxYsiAGd+Kl0mmq/MprG9yArRkyrQxTO6XjMzA==
-semver@^7.5.3, semver@^7.5.4:
+semver@^7.5.3:
+ version "7.5.4"
+ resolved "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz"
+ integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==
+ dependencies:
+ lru-cache "^6.0.0"
+
+semver@^7.5.4:
version "7.5.4"
resolved "https://registry.npmjs.org/semver/-/semver-7.5.4.tgz"
integrity sha512-1bCSESV6Pv+i21Hvpxp3Dx+pSD8lIPt8uVjRrxAUt/nbswYc+tK6Y2btiULjd4+fnq15PX+nqQDC7Oft7WkwcA==