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.
npm install zeptomatch-is-staticVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to import and use `isStatic` to check various glob patterns, distinguishing between static and dynamic strings, including those with escaped characters.
Use `zeptomatch-unescape` to preprocess globs if escaped characters should be treated as dynamic wildcards or literal characters after unescaping. Example: `isStatic(unescape('foo\\*bar'))` would return `isStatic('foo*bar')` which is `false`.Always use `import isStatic from 'zeptomatch-is-static';` for consistent behavior. If you are in a CommonJS environment, ensure your bundler or Node.js version supports interoperability, or consider dynamically importing if strictly necessary for mixed modules.
Ensure you are using the correct ESM import syntax: `import isStatic from 'zeptomatch-is-static';`. If in a CommonJS-only file, verify the package's `package.json` for `main` or `exports` fields, or consider dynamic `import()`.
If the intent is to check if a glob contains *any* dynamic elements, including escaped wildcards, first unescape the glob using `zeptomatch-unescape` before passing it to `isStatic`. For example: `import unescape from 'zeptomatch-unescape'; isStatic(unescape('foo\\*bar')); // => false`.No dependency data recorded yet.