Socket
Socket
Sign inDemoInstall

glob-extra

Package Overview
Dependencies
Maintainers
6
Versions
16
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

glob-extra - npm Package Compare versions

Comparing version 3.0.0 to 4.0.0

11

lib/defaults.js
'use strict';
const _ = require('lodash');
module.exports = (options) => {
return _.defaults(options || {}, {
const defaultOpts = {
expandOpts: {
root: null,
formats: []
});
},
globOpts: {
onlyFiles: false
}
};
module.exports = (name, options = {}) => _.defaults(options, defaultOpts[name]);
'use strict';
const path = require('path');
const Promise = require('bluebird');
const _ = require('lodash');
const glob = Promise.promisify(require('glob'));
const fg = require('fast-glob');
const {Minimatch} = require('minimatch');
const defaults = require('./defaults');
const utils = require('./utils');
const path = require('path');
const isMask = (pattern) => glob.hasMagic(pattern);
const getFilesByMask = (pattern, options) => fg(pattern, options);
const getFilesByMask = (pattern, options) => glob(pattern, options);
const expandPath = (basePath, options) => {

@@ -29,3 +28,4 @@ basePath = options.root ? path.resolve(options.root, basePath) : basePath;

exports.expandPaths = (paths, expandOpts, globOpts) => {
expandOpts = defaults(expandOpts);
expandOpts = defaults('expandOpts', expandOpts);
globOpts = _(defaults('globOpts', globOpts)).omitBy(_.isUndefined).value();

@@ -38,2 +38,14 @@ paths = [].concat(paths);

exports.isMask = isMask;
exports.isMask = (pattern) => {
if (!pattern) {
return false;
}
const {set} = new Minimatch(pattern);
if (set.length > 1) {
return true;
}
return set[0].some((v) => typeof v !== 'string');
};
{
"name": "glob-extra",
"version": "3.0.0",
"version": "4.0.0",
"description": "Utility which provides expanding of masks, dirs and files to absolute file paths.",

@@ -28,5 +28,7 @@ "bugs": "https://github.com/gemini-testing/glob-extra/issues",

"dependencies": {
"bluebird": "^3.5.1",
"fast-glob": "^2.2.3",
"glob": "^7.0.5",
"lodash": "^4.15.0",
"bluebird": "^3.5.1"
"minimatch": "^3.0.4"
},

@@ -33,0 +35,0 @@ "devDependencies": {

# glob-extra
Wrapper for utility [glob](https://github.com/isaacs/node-glob) with promises support which provides expanding of masks, dirs and files to absolute file paths.
Wrapper for utility [fast-glob](https://github.com/mrmlnc/fast-glob) with promises support which provides expanding of masks, dirs and files to absolute file paths.

@@ -5,0 +5,0 @@ [![NPM version](https://img.shields.io/npm/v/glob-extra.svg?style=flat)](https://www.npmjs.org/package/glob-extra)

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc