Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: micromatch/picomatch
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 2.2.2
Choose a base ref
...
head repository: micromatch/picomatch
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 2.2.3
Choose a head ref
  • 8 commits
  • 8 files changed
  • 7 contributors

Commits on May 2, 2020

  1. fix typo in readme

    GilgameshxZero committed May 2, 2020
    Copy the full SHA
    7bcae30 View commit details

Commits on Jul 25, 2020

  1. Merge pull request #67 from GilgameshxZero/bugfix-readme-typo

    Special character typo in readme
    jonschlinkert authored Jul 25, 2020
    Copy the full SHA
    d31ab87 View commit details

Commits on Aug 21, 2020

  1. test: fix typo in test name

    Krinkle authored Aug 21, 2020

    Verified

    This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
    Copy the full SHA
    f178b76 View commit details

Commits on Aug 27, 2020

  1. Merge pull request #70 from Krinkle/patch-1

    test: fix typo in test name
    mrmlnc authored Aug 27, 2020
    Copy the full SHA
    4a510d7 View commit details

Commits on Apr 10, 2021

  1. fix: set negatedExtGlob also if it does not span the whole pattern

    This way micromatch can detect that this is a negation pattern.
    danez committed Apr 10, 2021
    Copy the full SHA
    032e3f5 View commit details
  2. Copy the full SHA
    fb08a30 View commit details
  3. chore: Update CI config (#75)

    * remove `CI: true` since it's already set by the runner
    * remove Node.js 13 and add 14
    * update to `actions/setup-node@v2`
    * remove version info
    * switch to Node.js 14 for Coveralls
    XhmikosR authored Apr 10, 2021
    Copy the full SHA
    79eddb0 View commit details
  4. 2.2.3

    danez committed Apr 10, 2021
    Copy the full SHA
    8839c01 View commit details
Showing with 40 additions and 16 deletions.
  1. +4 −8 .github/workflows/test.yml
  2. +7 −0 CHANGELOG.md
  3. +1 −1 README.md
  4. +1 −1 lib/parse.js
  5. +6 −4 lib/scan.js
  6. +1 −1 package.json
  7. +16 −1 test/api.picomatch.js
  8. +4 −0 test/api.scan.js
12 changes: 4 additions & 8 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
name: Tests

on: [push, pull_request]
env:
CI: true

jobs:
run:
@@ -11,21 +10,18 @@ jobs:
strategy:
fail-fast: false
matrix:
node: [8.6, 10, 12, 13]
node: [8.6, 10, 12, 14]
os: [ubuntu-latest, windows-latest, macOS-latest]

steps:
- name: Clone repository
uses: actions/checkout@v2

- name: Set Node.js version
uses: actions/setup-node@v1
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}

- run: node --version
- run: npm --version

- name: Install npm dependencies
run: npm install

@@ -35,6 +31,6 @@ jobs:
- name: Run Coveralls
# `master` should be a tag but they don't have one
uses: coverallsapp/github-action@master
if: startsWith(matrix.os, 'ubuntu') && matrix.node == 12
if: startsWith(matrix.os, 'ubuntu') && matrix.node == 14
with:
github-token: "${{ secrets.GITHUB_TOKEN }}"
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -32,6 +32,13 @@ Changelog entries are classified using the following labels _(from [keep-a-chang

</details>

## 2.2.3 (2021-04-10)

### Fixed

* Do not skip pattern seperator for square brackets ([fb08a30](https://github.com/micromatch/picomatch/commit/fb08a30)).
* Set negatedExtGlob also if it does not span the whole pattern ([032e3f5](https://github.com/micromatch/picomatch/commit/032e3f5)).

## 2.2.2 (2020-03-21)

### Fixed
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -562,7 +562,7 @@ If you wish to match the following special characters in a filepath, and you wan
Some characters that are used for matching in regular expressions are also regarded as valid file path characters on some platforms.
To match any of the following characters as literals: `$^*+?()[]
To match any of the following characters as literals: `$^*+?()[]`
Examples:
2 changes: 1 addition & 1 deletion lib/parse.js
Original file line number Diff line number Diff line change
@@ -247,7 +247,7 @@ const parse = (input, options) => {
output = token.close = `)$))${extglobStar}`;
}

if (token.prev.type === 'bos' && eos()) {
if (token.prev.type === 'bos') {
state.negatedExtglob = true;
}
}
10 changes: 6 additions & 4 deletions lib/scan.js
Original file line number Diff line number Diff line change
@@ -231,13 +231,15 @@ const scan = (input, options) => {
isBracket = token.isBracket = true;
isGlob = token.isGlob = true;
finished = true;

if (scanToEnd === true) {
continue;
}
break;
}
}

if (scanToEnd === true) {
continue;
}

break;
}

if (opts.nonegate !== true && code === CHAR_EXCLAMATION_MARK && index === start) {
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "picomatch",
"description": "Blazing fast and accurate glob matcher written in JavaScript, with no dependencies and full support for standard and extended Bash glob features, including braces, extglobs, POSIX brackets, and regular expressions.",
"version": "2.2.2",
"version": "2.2.3",
"homepage": "https://github.com/micromatch/picomatch",
"author": "Jon Schlinkert (https://github.com/jonschlinkert)",
"funding": "https://github.com/sponsors/jonschlinkert",
17 changes: 16 additions & 1 deletion test/api.picomatch.js
Original file line number Diff line number Diff line change
@@ -149,7 +149,7 @@ describe('picomatch', () => {
assert(!isMatch('a-b.c-d', '*-bc-*'));
});

it('should match with copmon glob patterns', () => {
it('should match with common glob patterns', () => {
assert(!isMatch('/ab', './*/'));
assert(!isMatch('/ef', '*'));
assert(!isMatch('ab', './*/'));
@@ -347,4 +347,19 @@ describe('picomatch', () => {
});
});
});

describe('state', () => {
describe('negatedExtglob', () => {
it('should return true', () => {
assert(picomatch('!(abc)', {}, true).state.negatedExtglob);
assert(picomatch('!(abc)**', {}, true).state.negatedExtglob);
assert(picomatch('!(abc)/**', {}, true).state.negatedExtglob);
});

it('should return false', () => {
assert(!picomatch('(!(abc))', {}, true).state.negatedExtglob);
assert(!picomatch('**!(abc)', {}, true).state.negatedExtglob);
});
});
});
});
4 changes: 4 additions & 0 deletions test/api.scan.js
Original file line number Diff line number Diff line change
@@ -311,6 +311,10 @@ describe('picomatch', () => {

assertParts('XXX/*/*/12/*/*/m/*/*', ['XXX', '*', '*', '12', '*', '*', 'm', '*', '*']);
assertParts('foo/\\"**\\"/bar', ['foo', '\\"**\\"', 'bar']);

assertParts('[0-9]/[0-9]', ['[0-9]', '[0-9]']);
assertParts('foo/[0-9]/[0-9]', ['foo', '[0-9]', '[0-9]']);
assertParts('foo[0-9]/bar[0-9]', ['foo[0-9]', 'bar[0-9]']);
});
});