rittenhop-ghost/versions/5.94.2/node_modules/globalyzer
2024-09-23 19:05:38 -04:00
..
src adding local files for running this....locally 2024-09-23 19:05:38 -04:00
license adding local files for running this....locally 2024-09-23 19:05:38 -04:00
package.json adding local files for running this....locally 2024-09-23 19:05:38 -04:00
readme.md adding local files for running this....locally 2024-09-23 19:05:38 -04:00

globalyzer

Detect and extract the glob part of a string

Utility to detect if a string contains a glob and then split it in a glob and none-glob part.

Install

npm install globalyzer --save

Usage

const globalyzer = require('globalyzer');

globalyzer('foo/bar/.git/');
// => { base: 'foo/bar/.git/', glob: '', isGlob: false }

globalyzer('foo/bar/**/baz');
// => { base: 'foo/bar', glob: '**/baz', isGlob: true }

API

globalyzer(glob, options)

Type: function
Returns: { base, glob, isGlob }

Returns an object with the (non-glob) base path and the actual pattern.

options.strict

Type: Boolean
Default: true

Be strict about what's a glob and what's not

glob

Type: String

Glob string to analyze.

Credit

This is a fork of is-glob and glob-base

License

MIT © Terkel Gjervig