Zeptomatch Is Static

1.0.1 · active · verified Sun Apr 19

zeptomatch-is-static is a lightweight utility designed to ascertain if a given glob pattern is entirely static, meaning it contains no dynamic wildcards or special glob syntax. It is part of the 'zeptomatch' ecosystem of packages, known for being absurdly small, opinionated, and highly performant for glob matching. The current stable version is 1.0.1, last published approximately a year ago, indicating a stable release cycle for focused utilities. Unlike broader glob libraries that offer extensive configuration, `zeptomatch-is-static` provides a singular, optimized function to quickly check for static patterns. A key differentiator is its specific interpretation where escaped characters are considered static, necessitating separate unescaping if a truly dynamic check is required. The library ships with TypeScript types, ensuring good developer experience in TypeScript projects.

Common errors

Warnings

Install

Imports

Quickstart

Demonstrates how to import and use `isStatic` to check various glob patterns, distinguishing between static and dynamic strings, including those with escaped characters.

import isStatic from 'zeptomatch-is-static';

// Install the package
// npm install zeptomatch-is-static

console.log(isStatic('foo')); // true
console.log(isStatic('foo/bar')); // true
console.log(isStatic('foo\\*bar')); // true (escaped characters are considered static)

console.log(isStatic('*')); // false
console.log(isStatic('**')); // false
console.log(isStatic('foo*')); // false
console.log(isStatic('foo/**/*')); // false
console.log(isStatic('foo*bar')); // false

view raw JSON →