Socket
Socket
Sign inDemoInstall

fast-glob

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fast-glob - npm Package Compare versions

Comparing version 3.2.1 to 3.2.2

13

out/providers/filters/deep.js

@@ -30,6 +30,7 @@ "use strict";

}
if (this._isSkippedByPositivePatterns(entry, matcher)) {
const filepath = utils.path.removeLeadingDotSegment(entry.path);
if (this._isSkippedByPositivePatterns(filepath, matcher)) {
return false;
}
return this._isSkippedByNegativePatterns(entry, negativeRe);
return this._isSkippedByNegativePatterns(filepath, negativeRe);
}

@@ -47,9 +48,9 @@ _isSkippedByDeep(entryDepth) {

}
_isSkippedByPositivePatterns(entry, matcher) {
return !this._settings.baseNameMatch && !matcher.match(entry.path);
_isSkippedByPositivePatterns(entryPath, matcher) {
return !this._settings.baseNameMatch && !matcher.match(entryPath);
}
_isSkippedByNegativePatterns(entry, negativeRe) {
return !utils.pattern.matchAny(entry.path, negativeRe);
_isSkippedByNegativePatterns(entryPath, negativeRe) {
return !utils.pattern.matchAny(entryPath, negativeRe);
}
}
exports.default = DeepFilter;

@@ -50,3 +50,4 @@ "use strict";

}
_isMatchToPatterns(filepath, patternsRe) {
_isMatchToPatterns(entryPath, patternsRe) {
const filepath = utils.path.removeLeadingDotSegment(entryPath);
return utils.pattern.matchAny(filepath, patternsRe);

@@ -53,0 +54,0 @@ }

@@ -8,1 +8,2 @@ import { Pattern } from '../types';

export declare function escape(pattern: Pattern): Pattern;
export declare function removeLeadingDotSegment(entry: string): string;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const path = require("path");
const LEADING_DOT_SEGMENT_CHARACTERS_COUNT = 2; // ./ or .\\
const UNESCAPED_GLOB_SYMBOLS_RE = /(\\?)([()*?[\]{|}]|^!|[!+@](?=\())/g;

@@ -20,1 +21,13 @@ /**

exports.escape = escape;
function removeLeadingDotSegment(entry) {
// We do not use `startsWith` because this is 10x slower than current implementation for some cases.
// eslint-disable-next-line @typescript-eslint/prefer-string-starts-ends-with
if (entry.charAt(0) === '.') {
const secondCharactery = entry.charAt(1);
if (secondCharactery === '/' || secondCharactery === '\\') {
return entry.slice(LEADING_DOT_SEGMENT_CHARACTERS_COUNT);
}
}
return entry;
}
exports.removeLeadingDotSegment = removeLeadingDotSegment;

@@ -110,5 +110,4 @@ "use strict";

function matchAny(entry, patternsRe) {
const filepath = entry.replace(/^\.[/\\]/, '');
return patternsRe.some((patternRe) => patternRe.test(filepath));
return patternsRe.some((patternRe) => patternRe.test(entry));
}
exports.matchAny = matchAny;
{
"name": "fast-glob",
"version": "3.2.1",
"version": "3.2.2",
"description": "It's a very fast and efficient glob library for Node.js",

@@ -5,0 +5,0 @@ "license": "MIT",

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