0.0.2 • Published 2 years ago

@shanzhai/glob-compare-function v0.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@shanzhai/glob-compare-function Continuous Integration License FOSSA Status Renovate enabled npm npm type definitions

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).

License

FOSSA Status