@shanzhai/glob-compare-function
v0.0.2
Published
A comparison function for sorting glob patterns by priority.
Downloads
3
Readme
@shanzhai/glob-compare-function
A comparison function for sorting glob patterns by priority.
Usage
import { globCompareFunction } from "@shanzhai/glob-compare-function";
console.log([
`**/some-file.path`,
`**/*.some-file-path`,
`**/*.*`,
`some/file.path`,
`some-file.*`,
`file.path`,
`matched/**/all/*/*`,
`matched/**/added/*`,
`matched/**/more-specific/changed/*`,
].sort(globCompareFunction))
[
"file.path",
"some/file.path",
"some-file.*",
"matched/**/more-specific/changed/*",
"matched/**/all/*/*",
"matched/**/added/*",
"**/some-file.path",
"**/*.some-file-path",
"**/*.*"
]
Dependencies
This package has no runtime dependencies.
Peer Dependencies
This package has no runtime peer dependencies (it does not expect any other packages to be installed alongside itself).