Socket
Socket
Sign inDemoInstall

glob

Package Overview
Dependencies
4
Maintainers
1
Versions
151
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.2.7 to 3.2.8

74

glob.js

@@ -217,23 +217,6 @@ // Approach:

if (this.mark) {
// at *some* point we statted all of these
all = all.map(function (m) {
var sc = this.cache[m]
if (!sc)
return m
var isDir = (Array.isArray(sc) || sc === 2)
if (isDir && m.slice(-1) !== "/") {
return m + "/"
}
if (!isDir && m.slice(-1) === "/") {
return m.replace(/\/+$/, "")
}
return m
}, this)
}
this.log("emitting end", all)
this.EOF = this.found = all
this.emitMatch(this.EOF)
this.emitMatch(this.EOF, -1)
}

@@ -274,12 +257,43 @@

Glob.prototype.emitMatch = function (m) {
if (!this.stat || this.statCache[m] || m === this.EOF) {
this._emitQueue.push(m)
this._processEmitQueue()
Glob.prototype._mark = function (p) {
var c = this.cache[p]
var m = p
if (c) {
var isDir = c === 2 || Array.isArray(c)
var slash = p.slice(-1) === '/'
if (isDir && !slash)
m += '/'
else if (!isDir && slash)
m = m.slice(0, -1)
if (m !== p) {
this.statCache[m] = this.statCache[p]
this.cache[m] = this.cache[p]
}
}
return m
}
Glob.prototype._pushMatch = function(m, index) {
if (this.mark && m !== this.EOF)
m = this._mark(m)
if (m !== this.EOF) {
this.matches[index] = this.matches[index] || {}
this.matches[index][m] = true
}
this._emitQueue.push(m)
this._processEmitQueue()
}
Glob.prototype.emitMatch = function (m, index) {
if ((!this.stat && !this.mark) || this.statCache[m] || m === this.EOF) {
this._pushMatch(m, index)
} else {
this._stat(m, function(exists, isDir) {
if (exists) {
this._emitQueue.push(m)
this._processEmitQueue()
}
if (exists)
this._pushMatch(m, index)
})

@@ -358,5 +372,3 @@ }

this.matches[index] = this.matches[index] || {}
this.matches[index][prefix] = true
this.emitMatch(prefix)
this.emitMatch(prefix, index)
}

@@ -475,5 +487,3 @@ return cb()

this.matches[index] = this.matches[index] || {}
this.matches[index][e] = true
this.emitMatch(e)
this.emitMatch(e, index)
}, this)

@@ -480,0 +490,0 @@ return cb.call(this)

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

"description": "a little globber",
"version": "3.2.7",
"version": "3.2.8",
"repository": {

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

@@ -21,2 +21,4 @@ var test = require("tap").test

t.end()
}).on('match', function(m) {
t.similar(m, /\/$/)
})

@@ -40,2 +42,4 @@ })

t.end()
}).on('match', function(m) {
t.similar(m, /[^\/]$/)
})

@@ -58,2 +62,4 @@ })

t.end()
}).on('match', function(m) {
t.similar(m, /\/$/)
})

@@ -76,3 +82,5 @@ })

t.end()
}).on('match', function(m) {
t.similar(m, /\/$/)
})
})
SocketSocket SOC 2 Logo

Product

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

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc