Skip to content

Latest commit

 

History

History

glob-compare-function

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 
 
 

@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