First version

This commit is contained in:
Senad Uka
2023-07-05 11:02:15 +02:00
parent f21c24b599
commit 8eabf79994
4052 changed files with 723968 additions and 232443 deletions

20
CTOAsYouGo/node_modules/glob/sync.js generated vendored
View File

@@ -1,7 +1,6 @@
module.exports = globSync
globSync.GlobSync = GlobSync
var fs = require('fs')
var rp = require('fs.realpath')
var minimatch = require('minimatch')
var Minimatch = minimatch.Minimatch
@@ -11,8 +10,6 @@ var path = require('path')
var assert = require('assert')
var isAbsolute = require('path-is-absolute')
var common = require('./common.js')
var alphasort = common.alphasort
var alphasorti = common.alphasorti
var setopts = common.setopts
var ownProp = common.ownProp
var childrenIgnored = common.childrenIgnored
@@ -51,7 +48,7 @@ function GlobSync (pattern, options) {
}
GlobSync.prototype._finish = function () {
assert(this instanceof GlobSync)
assert.ok(this instanceof GlobSync)
if (this.realpath) {
var self = this
this.matches.forEach(function (matchset, index) {
@@ -75,7 +72,7 @@ GlobSync.prototype._finish = function () {
GlobSync.prototype._process = function (pattern, index, inGlobStar) {
assert(this instanceof GlobSync)
assert.ok(this instanceof GlobSync)
// Get the first [n] parts of pattern that are all strings.
var n = 0
@@ -112,7 +109,10 @@ GlobSync.prototype._process = function (pattern, index, inGlobStar) {
var read
if (prefix === null)
read = '.'
else if (isAbsolute(prefix) || isAbsolute(pattern.join('/'))) {
else if (isAbsolute(prefix) ||
isAbsolute(pattern.map(function (p) {
return typeof p === 'string' ? p : '[*]'
}).join('/'))) {
if (!prefix || !isAbsolute(prefix))
prefix = '/' + prefix
read = prefix
@@ -248,7 +248,7 @@ GlobSync.prototype._readdirInGlobStar = function (abs) {
var lstat
var stat
try {
lstat = fs.lstatSync(abs)
lstat = this.fs.lstatSync(abs)
} catch (er) {
if (er.code === 'ENOENT') {
// lstat failed, doesn't exist
@@ -285,7 +285,7 @@ GlobSync.prototype._readdir = function (abs, inGlobStar) {
}
try {
return this._readdirEntries(abs, fs.readdirSync(abs))
return this._readdirEntries(abs, this.fs.readdirSync(abs))
} catch (er) {
this._readdirError(abs, er)
return null
@@ -444,7 +444,7 @@ GlobSync.prototype._stat = function (f) {
if (!stat) {
var lstat
try {
lstat = fs.lstatSync(abs)
lstat = this.fs.lstatSync(abs)
} catch (er) {
if (er && (er.code === 'ENOENT' || er.code === 'ENOTDIR')) {
this.statCache[abs] = false
@@ -454,7 +454,7 @@ GlobSync.prototype._stat = function (f) {
if (lstat && lstat.isSymbolicLink()) {
try {
stat = fs.statSync(abs)
stat = this.fs.statSync(abs)
} catch (er) {
stat = lstat
}