@shanzhai/glob-compare-function
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

@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

Dependencies (0)

    Dev Dependencies (0)

      Package Sidebar

      Install

      npm i @shanzhai/glob-compare-function

      Weekly Downloads

      1

      Version

      0.0.2

      License

      MIT

      Unpacked Size

      4.91 kB

      Total Files

      5

      Last publish

      Collaborators

      • jameswilddev