Comparing version 7.2.0 to 7.1.2
@@ -0,1 +1,3 @@ | ||
exports.alphasort = alphasort | ||
exports.alphasorti = alphasorti | ||
exports.setopts = setopts | ||
@@ -13,3 +15,2 @@ exports.ownProp = ownProp | ||
var fs = require("fs") | ||
var path = require("path") | ||
@@ -20,4 +21,8 @@ var minimatch = require("minimatch") | ||
function alphasorti (a, b) { | ||
return a.toLowerCase().localeCompare(b.toLowerCase()) | ||
} | ||
function alphasort (a, b) { | ||
return a.localeCompare(b, 'en') | ||
return a.localeCompare(b) | ||
} | ||
@@ -81,3 +86,2 @@ | ||
self.absolute = !!options.absolute | ||
self.fs = options.fs || fs | ||
@@ -152,3 +156,3 @@ self.maxLength = options.maxLength || Infinity | ||
if (!self.nosort) | ||
all = all.sort(alphasort) | ||
all = all.sort(self.nocase ? alphasorti : alphasort) | ||
@@ -155,0 +159,0 @@ // at *some* point we statted all of these |
11
glob.js
@@ -43,2 +43,3 @@ // Approach: | ||
var fs = require('fs') | ||
var rp = require('fs.realpath') | ||
@@ -54,2 +55,4 @@ var minimatch = require('minimatch') | ||
var common = require('./common.js') | ||
var alphasort = common.alphasort | ||
var alphasorti = common.alphasorti | ||
var setopts = common.setopts | ||
@@ -505,3 +508,3 @@ var ownProp = common.ownProp | ||
if (lstatcb) | ||
self.fs.lstat(abs, lstatcb) | ||
fs.lstat(abs, lstatcb) | ||
@@ -547,3 +550,3 @@ function lstatcb_ (er, lstat) { | ||
var self = this | ||
self.fs.readdir(abs, readdirCb(this, abs, cb)) | ||
fs.readdir(abs, readdirCb(this, abs, cb)) | ||
} | ||
@@ -752,3 +755,3 @@ | ||
if (statcb) | ||
self.fs.lstat(abs, statcb) | ||
fs.lstat(abs, statcb) | ||
@@ -759,3 +762,3 @@ function lstatcb_ (er, lstat) { | ||
// the target does not exist, then treat it as a file. | ||
return self.fs.stat(abs, function (er, stat) { | ||
return fs.stat(abs, function (er, stat) { | ||
if (er) | ||
@@ -762,0 +765,0 @@ self._stat2(f, abs, null, lstat, cb) |
@@ -5,3 +5,3 @@ { | ||
"description": "a little globber", | ||
"version": "7.2.0", | ||
"version": "7.1.2", | ||
"repository": { | ||
@@ -29,17 +29,11 @@ "type": "git", | ||
"devDependencies": { | ||
"memfs": "^3.2.0", | ||
"mkdirp": "0", | ||
"rimraf": "^2.2.8", | ||
"tap": "^15.0.6", | ||
"tap": "^7.1.2", | ||
"tick": "0.0.6" | ||
}, | ||
"tap": { | ||
"before": "test/00-setup.js", | ||
"after": "test/zz-cleanup.js", | ||
"jobs": 1 | ||
}, | ||
"scripts": { | ||
"prepublish": "npm run benchclean", | ||
"profclean": "rm -f v8.log profile.txt", | ||
"test": "tap", | ||
"test": "tap test/*.js --cov", | ||
"test-regen": "npm run profclean && TEST_REGEN=1 node test/00-setup.js", | ||
@@ -50,6 +44,3 @@ "bench": "bash benchmark.sh", | ||
}, | ||
"license": "ISC", | ||
"funding": { | ||
"url": "https://github.com/sponsors/isaacs" | ||
} | ||
"license": "ISC" | ||
} |
@@ -10,3 +10,3 @@ # Glob | ||
![a fun cartoon logo made of glob characters](logo/glob.png) | ||
![](oh-my-glob.gif) | ||
@@ -280,5 +280,2 @@ ## Usage | ||
the `match` event. | ||
* `fs` File-system object with Node's `fs` API. By default, the built-in | ||
`fs` module will be used. Set to a volume provided by a library like | ||
`memfs` to avoid using the "real" file-system. | ||
@@ -355,7 +352,2 @@ ## Comparisons to other fnmatch/glob implementations | ||
## Glob Logo | ||
Glob's logo was created by [Tanya Brassie](http://tanyabrassie.com/). Logo files can be found [here](https://github.com/isaacs/node-glob/tree/master/logo). | ||
The logo is licensed under a [Creative Commons Attribution-ShareAlike 4.0 International License](https://creativecommons.org/licenses/by-sa/4.0/). | ||
## Contributing | ||
@@ -380,3 +372,1 @@ | ||
``` | ||
![](oh-my-glob.gif) |
11
sync.js
module.exports = globSync | ||
globSync.GlobSync = GlobSync | ||
var fs = require('fs') | ||
var rp = require('fs.realpath') | ||
@@ -13,2 +14,4 @@ var minimatch = require('minimatch') | ||
var common = require('./common.js') | ||
var alphasort = common.alphasort | ||
var alphasorti = common.alphasorti | ||
var setopts = common.setopts | ||
@@ -249,3 +252,3 @@ var ownProp = common.ownProp | ||
try { | ||
lstat = this.fs.lstatSync(abs) | ||
lstat = fs.lstatSync(abs) | ||
} catch (er) { | ||
@@ -287,3 +290,3 @@ if (er.code === 'ENOENT') { | ||
try { | ||
return this._readdirEntries(abs, this.fs.readdirSync(abs)) | ||
return this._readdirEntries(abs, fs.readdirSync(abs)) | ||
} catch (er) { | ||
@@ -447,3 +450,3 @@ this._readdirError(abs, er) | ||
try { | ||
lstat = this.fs.lstatSync(abs) | ||
lstat = fs.lstatSync(abs) | ||
} catch (er) { | ||
@@ -458,3 +461,3 @@ if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) { | ||
try { | ||
stat = this.fs.statSync(abs) | ||
stat = fs.statSync(abs) | ||
} catch (er) { | ||
@@ -461,0 +464,0 @@ stat = lstat |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Copyleft License
License(Experimental) Copyleft license information was found.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Mixed license
License(Experimental) Package contains multiple licenses.
Found 1 instance in 1 package
Non-permissive License
License(Experimental) A license not known to be considered permissive was found.
Found 1 instance in 1 package
55474
4
7
0
100
1248
369
4