Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

minimatch

Package Overview
Dependencies
Maintainers
1
Versions
110
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

minimatch - npm Package Compare versions

Comparing version 0.2.7 to 0.2.8

29

minimatch.js

@@ -920,2 +920,5 @@ ;(function (require, exports, module, platform) {

if (p === GLOBSTAR) {
if (options.debug)
console.error('GLOBSTAR', [pattern, p, f])
// "**"

@@ -932,3 +935,4 @@ // a/**/b/**/c would match the following:

// This is recursively awful.
// a/b/x/y/z/c
//
// a/**/b/**/c matching a/b/x/y/z/c
// - a matches a

@@ -946,2 +950,4 @@ // - doublestar

if (pr === pl) {
if (options.debug)
console.error('** at the end')
// a ** at the end will just swallow the rest.

@@ -963,6 +969,6 @@ // We have found a match.

var swallowee = file[fr]
if (swallowee === "." || swallowee === ".." ||
(!options.dot && swallowee.charAt(0) === ".")) {
// console.error("dot detected!")
break WHILE
if (options.debug) {
console.error('\nglobstar while',
file, fr, pattern, pr, swallowee)
}

@@ -972,6 +978,19 @@

if (this.matchOne(file.slice(fr), pattern.slice(pr), partial)) {
if (options.debug)
console.error('globstar found match!', fr, fl, swallowee)
// found a match.
return true
} else {
// can't swallow "." or ".." ever.
// can only swallow ".foo" when explicitly asked.
if (swallowee === "." || swallowee === ".." ||
(!options.dot && swallowee.charAt(0) === ".")) {
if (options.debug)
console.error("dot detected!", file, fr, pattern, pr)
break WHILE
}
// ** swallows a segment, and continue.
if (options.debug)
console.error('globstar swallow a segment, and continue')
fr ++

@@ -978,0 +997,0 @@ }

2

package.json

@@ -5,3 +5,3 @@ {

"description": "a glob matcher in javascript",
"version": "0.2.7",
"version": "0.2.8",
"repository": {

@@ -8,0 +8,0 @@ "type": "git",

@@ -234,2 +234,26 @@ // http://www.bashcookbook.com/bashinfo/source/bash-1.14.7/tests/glob-test

// https://github.com/isaacs/minimatch/issues/5
, function () {
files = [ 'a/b/.x/c'
, 'a/b/.x/c/d'
, 'a/b/.x/c/d/e'
, 'a/b/.x'
, 'a/b/.x/'
, 'a/.x/b'
, '.x'
, '.x/'
, '.x/a'
, '.x/a/b'
, 'a/.x/b/.x/c'
, '.x/.x' ]
}
, ["**/.x/**", [ '.x/'
, '.x/a'
, '.x/a/b'
, 'a/.x/b'
, 'a/b/.x/'
, 'a/b/.x/c'
, 'a/b/.x/c/d'
, 'a/b/.x/c/d/e' ] ]
].forEach(function (c) {

@@ -236,0 +260,0 @@ if (typeof c === "function") return c()

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