🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

picomatch

Package Overview
Dependencies
Maintainers
2
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

picomatch - npm Package Compare versions

Comparing version

to
2.0.6

1

lib/constants.js

@@ -96,2 +96,3 @@ 'use strict';

REGEX_SPECIAL_CHARS_GLOBAL: /([-*+?.^${}(|)[\]])/g,
REGEX_REMOVE_BACKSLASH: /(?:\[.*?[^\\]\]|\\(?=.))/g,

@@ -98,0 +99,0 @@ // Replace globs with equivalent patterns to reduce parsing time.

2

lib/parse.js

@@ -625,3 +625,3 @@ 'use strict';

if (next === '<' && parseInt(process.version.slice(1), 10) < 10) {
if (next === '<' && !utils.supportsLookbehinds()) {
throw new Error('Node.js v10 or higher is required for regex lookbehinds');

@@ -628,0 +628,0 @@ }

'use strict';
const utils = require('./utils');
const {

@@ -209,6 +211,6 @@ CHAR_ASTERISK, /* * */

if (opts.unescape === true) {
if (glob) glob = removeBackslashes(glob);
if (glob) glob = utils.removeBackslashes(glob);
if (base && backslashes === true) {
base = removeBackslashes(base);
base = utils.removeBackslashes(base);
}

@@ -219,7 +221,1 @@ }

};
function removeBackslashes(str) {
return str.replace(/(?:\[.*?(?<!\\)\]|\\(?=.))/g, match => {
return match === '\\' ? '' : match;
});
}

@@ -7,3 +7,4 @@ 'use strict';

REGEX_SPECIAL_CHARS,
REGEX_SPECIAL_CHARS_GLOBAL
REGEX_SPECIAL_CHARS_GLOBAL,
REGEX_REMOVE_BACKSLASH
} = require('./constants');

@@ -17,2 +18,16 @@

exports.removeBackslashes = str => {
return str.replace(REGEX_REMOVE_BACKSLASH, match => {
return match === '\\' ? '' : match;
});
}
exports.supportsLookbehinds = () => {
let segs = process.version.slice(1).split('.');
if (segs.length === 3 && +segs[0] >= 8 && +segs[1] >= 10) {
return true;
}
return false;
};
exports.isWindows = options => {

@@ -19,0 +34,0 @@ if (options && typeof options.windows === 'boolean') {

{
"name": "picomatch",
"description": "Blazing fast and accurate glob matcher written in JavaScript, with no dependencies and full support for standard and extended Bash glob features, including braces, extglobs, POSIX brackets, and regular expressions.",
"version": "2.0.5",
"version": "2.0.6",
"homepage": "https://github.com/micromatch/picomatch",

@@ -65,2 +65,2 @@ "author": "Jon Schlinkert (https://github.com/jonschlinkert)",

}
}
}