Socket
Socket
Sign inDemoInstall

glob

Package Overview
Dependencies
5
Maintainers
1
Versions
148
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 3.1.10 to 3.1.11

LICENSE

47

glob.js

@@ -47,3 +47,2 @@ // Approach:

, assert = require("assert").ok
, EOF = {}

@@ -99,2 +98,5 @@ function glob (pattern, options, cb) {

this.EOF = {}
this._emitQueue = []
this.maxDepth = options.maxDepth || 1000

@@ -216,4 +218,4 @@ this.maxLength = options.maxLength || Infinity

EOF = this.found = all
this.emitMatch(EOF)
this.EOF = this.found = all
this.emitMatch(this.EOF)
}

@@ -250,29 +252,28 @@

this.emit("resume")
this._processEmitQueue()
//process.nextTick(this.emit.bind(this, "resume"))
}
Glob.prototype.emitMatch = function (m) {
if (!this.paused) {
this.emit(m === EOF ? "end" : "match", m)
return
}
this._emitQueue.push(m)
this._processEmitQueue()
}
if (!this._emitQueue) {
this._emitQueue = []
this.once("resume", function () {
var q = this._emitQueue
this._emitQueue = null
q.forEach(function (m) {
this.emitMatch(m)
}, this)
})
Glob.prototype._processEmitQueue = function (m) {
while (!this._processingEmitQueue &&
!this.paused) {
this._processingEmitQueue = true
var m = this._emitQueue.shift()
if (!m) {
this._processingEmitQueue = false
break
}
if (this.debug) {
console.error('emit!', m === this.EOF ? "end" : "match")
}
this.emit(m === this.EOF ? "end" : "match", m)
this._processingEmitQueue = false
}
this._emitQueue.push(m)
//this.once("resume", this.emitMatch.bind(this, m))
}
Glob.prototype._process = function (pattern, depth, index, cb_) {

@@ -279,0 +280,0 @@ assert(this instanceof Glob)

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

"description": "a little globber",
"version": "3.1.10",
"version": "3.1.11",
"repository": {

@@ -22,4 +22,4 @@ "type": "git",

"tap": "~0.2.3",
"mkdirp":"0",
"rimraf":"1"
"mkdirp": "0",
"rimraf": "1"
},

@@ -26,0 +26,0 @@ "scripts": {

@@ -8,4 +8,3 @@ // basic test

, globs =
[
"test/a/*/+(c|g)/./d"
["test/a/*/+(c|g)/./d"
,"test/a/**/[cg]/../[cg]"

@@ -57,3 +56,3 @@ ,"test/a/{b,c,d,e,f}/**/g"

})
cp.stdout.on("close", function () {
cp.on("close", function () {
echoOutput = flatten(out)

@@ -60,0 +59,0 @@ if (!echoOutput) echoOutput = []

@@ -5,3 +5,3 @@ // show that no match events happen while paused.

// just some gnarly pattern with lots of matches
, pattern = "test/a/symlink/a/b/c/a/b/c/a/b/c//a/b/c////a/b/c/**/b/c/**"
, pattern = "test/a/!(symlink)/**"
, glob = require("../")

@@ -61,3 +61,3 @@ , Glob = glob.Glob

})
cp.stdout.on("close", function () {
cp.on("close", function () {
bashResults = flatten(out)

@@ -79,2 +79,10 @@ if (!bashResults) return t.fail("Didn't get results from bash")

g.on("pause", function () {
console.error("pause")
})
g.on("resume", function () {
console.error("resume")
})
g.on("match", function (m) {

@@ -85,3 +93,3 @@ t.notOk(g.paused, "must not be paused")

t.ok(g.paused, "must be paused")
setTimeout(g.resume.bind(g), 1)
setTimeout(g.resume.bind(g), 10)
})

@@ -88,0 +96,0 @@

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc