-
-
Notifications
You must be signed in to change notification settings - Fork 22
Open
Labels
upstreamNeeds work upstreamNeeds work upstream
Description
picomatch has weird range support, some work, some don't
what I've observed during testing:
1.zero-padded range don't work
import { glob } from 'tinyglobby';
import { writeFileSync, unlinkSync } from 'fs';
writeFileSync('file01.txt', '');
console.log(await glob('file{01..03}.txt')); // [] - should be ['file01.txt']
unlinkSync('file01.txt');- step ranges include wrong files
writeFileSync('file1.txt', '');
writeFileSync('file2.txt', '');
writeFileSync('file3.txt', '');
writeFileSync('file5.txt', '');
console.log(await glob('file{1..5..2}.txt'));
// ['file1.txt', 'file2.txt', 'file5.txt'] - should be ['file1.txt', 'file3.txt', 'file5.txt']
['file1.txt', 'file2.txt', 'file3.txt', 'file5.txt'].forEach(f => unlinkSync(f));- reverse ranges ignore order
writeFileSync('a.js', '');
writeFileSync('b.js', '');
writeFileSync('c.js', '');
console.log(await glob('{c..a}.js'));
// ['a.js', 'b.js', 'c.js'] - should be ['c.js', 'b.js', 'a.js']
['a.js', 'b.js', 'c.js'].forEach(f => unlinkSync(f));haven't seen patterns like №3 used much in the wild. it's upstream, but might be worth documenting as a known limitation since you're working on the website
p.s. mostly doing this for search visibility.
Metadata
Metadata
Assignees
Labels
upstreamNeeds work upstreamNeeds work upstream