MCPcopy
hub / github.com/shelljs/shelljs / globOptions

Function globOptions

src/common.js:257–291  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

255exports.parseOptions = parseOptions;
256
257function globOptions() {
258 // These options are just to make fast-glob be compatible with POSIX (bash)
259 // wildcard behavior.
260 var defaultGlobOptions = {
261 onlyFiles: false,
262 followSymbolicLinks: false,
263 };
264
265 var newGlobOptions = Object.assign({}, config.globOptions);
266 var optionRenames = {
267 // node-glob's 'nodir' is not quote the same as fast-glob's 'onlyFiles'.
268 // Compatibility for this is implemented at the call site.
269 mark: 'markDirectories',
270 matchBase: 'baseNameMatch',
271 };
272 Object.keys(optionRenames).forEach(function (oldKey) {
273 var newKey = optionRenames[oldKey];
274 if (oldKey in config.globOptions) {
275 newGlobOptions[newKey] = config.globOptions[oldKey];
276 }
277 });
278 var invertedOptionRenames = {
279 nobrace: 'braceExpansion',
280 noglobstar: 'globstar',
281 noext: 'extglob',
282 nocase: 'caseSensitiveMatch',
283 };
284 Object.keys(invertedOptionRenames).forEach(function (oldKey) {
285 var newKey = invertedOptionRenames[oldKey];
286 if (oldKey in config.globOptions) {
287 newGlobOptions[newKey] = !config.globOptions[oldKey];
288 }
289 });
290 return Object.assign({}, defaultGlobOptions, newGlobOptions);
291}
292
293// Expands wildcards with matching (ie. existing) file names.
294// For example:

Callers 1

expandFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…