REDROOM
PHP 8.2.30
Path:
Logout
Edit File
Size: 3.54 KB
Close
//opt/alt/alt-nodejs19/root/usr/lib/node_modules/npm/node_modules/glob/dist/mjs/ignore.js
Text
Base64
// give it a pattern, and it'll be able to tell you if // a given path should be ignored. // Ignoring a path ignores its children if the pattern ends in /** // Ignores are always parsed in dot:true mode import { Minimatch } from 'minimatch'; import { Pattern } from './pattern.js'; const defaultPlatform = typeof process === 'object' && process && typeof process.platform === 'string' ? process.platform : 'linux'; /** * Class used to process ignored patterns */ export class Ignore { relative; relativeChildren; absolute; absoluteChildren; constructor(ignored, { nobrace, nocase, noext, noglobstar, platform = defaultPlatform, }) { this.relative = []; this.absolute = []; this.relativeChildren = []; this.absoluteChildren = []; const mmopts = { dot: true, nobrace, nocase, noext, noglobstar, optimizationLevel: 2, platform, nocomment: true, nonegate: true, }; // this is a little weird, but it gives us a clean set of optimized // minimatch matchers, without getting tripped up if one of them // ends in /** inside a brace section, and it's only inefficient at // the start of the walk, not along it. // It'd be nice if the Pattern class just had a .test() method, but // handling globstars is a bit of a pita, and that code already lives // in minimatch anyway. // Another way would be if maybe Minimatch could take its set/globParts // as an option, and then we could at least just use Pattern to test // for absolute-ness. // Yet another way, Minimatch could take an array of glob strings, and // a cwd option, and do the right thing. for (const ign of ignored) { const mm = new Minimatch(ign, mmopts); for (let i = 0; i < mm.set.length; i++) { const parsed = mm.set[i]; const globParts = mm.globParts[i]; const p = new Pattern(parsed, globParts, 0, platform); const m = new Minimatch(p.globString(), mmopts); const children = globParts[globParts.length - 1] === '**'; const absolute = p.isAbsolute(); if (absolute) this.absolute.push(m); else this.relative.push(m); if (children) { if (absolute) this.absoluteChildren.push(m); else this.relativeChildren.push(m); } } } } ignored(p) { const fullpath = p.fullpath(); const fullpaths = `${fullpath}/`; const relative = p.relative() || '.'; const relatives = `${relative}/`; for (const m of this.relative) { if (m.match(relative) || m.match(relatives)) return true; } for (const m of this.absolute) { if (m.match(fullpath) || m.match(fullpaths)) return true; } return false; } childrenIgnored(p) { const fullpath = p.fullpath() + '/'; const relative = (p.relative() || '.') + '/'; for (const m of this.relativeChildren) { if (m.match(relative)) return true; } for (const m of this.absoluteChildren) { if (m.match(fullpath)) true; } return false; } } //# sourceMappingURL=ignore.js.map
Save
Close
Exit & Reset
Text mode: syntax highlighting auto-detects file type.
Directory Contents
Dirs: 0 × Files: 8
Delete Selected
Select All
Select None
Sort:
Name
Size
Modified
Enable drag-to-move
Name
Size
Perms
Modified
Actions
glob.js
7.18 KB
lrw-r--r--
2023-12-06 18:07:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
has-magic.js
917 B
lrw-r--r--
2023-12-06 18:07:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
ignore.js
3.54 KB
lrw-r--r--
2023-12-06 18:07:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
index.js
1.59 KB
lrw-r--r--
2023-12-06 18:07:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
package.json
23 B
lrw-r--r--
2023-12-06 18:07:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
pattern.js
6.99 KB
lrw-r--r--
2023-12-06 18:07:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
processor.js
10.44 KB
lrw-r--r--
2023-12-06 18:07:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
walker.js
10.86 KB
lrw-r--r--
2023-12-06 18:07:52
Edit
Download
Rename
Chmod
Change Date
Delete
OK
Cancel
recursive
OK
Cancel
recursive
OK
Cancel
Zip Selected
If ZipArchive is unavailable, a
.tar
will be created (no compression).