schnee effeckt und fehler Korektur

This commit is contained in:
2023-08-14 17:52:24 +02:00
parent 4a843d4936
commit 79af4e9907
6813 changed files with 343821 additions and 356128 deletions

57
node_modules/executable/index.js generated vendored
View File

@@ -1,47 +1,36 @@
'use strict';
const fs = require('fs');
const pify = require('pify');
var fs = require('fs');
function isExe(mode, gid, uid) {
const isExe = (mode, gid, uid) => {
if (process.platform === 'win32') {
return true;
}
return (mode & parseInt('0001', 8)) ||
(mode & parseInt('0010', 8)) && process.getgid && gid === process.getgid() ||
(mode & parseInt('0100', 8)) && process.getuid && uid === process.getuid();
}
const isGroup = gid ? process.getgid && gid === process.getgid() : true;
const isUser = uid ? process.getuid && uid === process.getuid() : true;
module.exports = function (name, cb) {
if (typeof name !== 'string') {
throw new Error('Filename required');
}
fs.stat(name, function (err, stats) {
if (err) {
cb(err);
return;
}
if (stats && stats.isFile() && isExe(stats.mode, stats.gid, stats.uid)) {
cb(null, true);
return;
}
cb(null, false);
});
return Boolean((mode & 0o0001) ||
((mode & 0o0010) && isGroup) ||
((mode & 0o0100) && isUser));
};
module.exports.sync = function (name) {
module.exports = name => {
if (typeof name !== 'string') {
throw new Error('Filename required');
return Promise.reject(new TypeError('Expected a string'));
}
var file = fs.statSync(name);
if (file && file.isFile() && isExe(file.mode, file.gid, file.uid)) {
return true;
}
return false;
return pify(fs.stat)(name).then(stats => stats && stats.isFile() && isExe(stats.mode, stats.gid, stats.uid));
};
module.exports.sync = name => {
if (typeof name !== 'string') {
throw new TypeError('Expected a string');
}
const stats = fs.statSync(name);
return stats && stats.isFile() && isExe(stats.mode, stats.gid, stats.uid);
};
module.exports.checkMode = isExe;