GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — fix: scan full pattern when tokens are requested · micromatch/picomatch@5f5819d

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • lib
    • scan.js
  • test
    • api.scan.js
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎lib/scan.js‎

Copy file name to clipboardExpand all lines: lib/scan.js
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ const scan = (input, options) => {
5050
const opts = options || {};
5151

5252
const length = input.length - 1;
53-
const scanToEnd = opts.parts === true || opts.scanToEnd === true;
53+
const scanToEnd = opts.parts === true || opts.tokens === true || opts.scanToEnd === true;
5454
const slashes = [];
5555
const tokens = [];
5656
const parts = [];
Collapse file

‎test/api.scan.js‎

Copy file name to clipboardExpand all lines: test/api.scan.js
+5Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,11 @@ describe('picomatch', () => {
375375
assertParts('foo/[0-9]/[0-9]', ['foo', '[0-9]', '[0-9]']);
376376
assertParts('foo[0-9]/bar[0-9]', ['foo[0-9]', 'bar[0-9]']);
377377
});
378+
379+
it('issue #62: should enable parts when tokens are requested', () => {
380+
const state = scan('a/b/*/c', { tokens: true });
381+
assert.deepStrictEqual(state.parts, ['a', 'b', '*', 'c']);
382+
});
378383
});
379384

380385
describe('.base (glob2base test patterns)', () => {

0 commit comments

Comments
0 (0)
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.