CoolFace
Datasetpublic

basant307/AI_Governance_Project

sourceHugging Faceapache-2.0updated 2mo agoView on Hugging Face
0likes45downloads
windows.js43 linesDownload Raw Back to isexe
1module.exports = isexe2isexe.sync = sync3 4var fs = require('fs')5 6function checkPathExt (path, options) {7  var pathext = options.pathExt !== undefined ?8    options.pathExt : process.env.PATHEXT9 10  if (!pathext) {11    return true12  }13 14  pathext = pathext.split(';')15  if (pathext.indexOf('') !== -1) {16    return true17  }18  for (var i = 0; i < pathext.length; i++) {19    var p = pathext[i].toLowerCase()20    if (p && path.substr(-p.length).toLowerCase() === p) {21      return true22    }23  }24  return false25}26 27function checkStat (stat, path, options) {28  if (!stat.isSymbolicLink() && !stat.isFile()) {29    return false30  }31  return checkPathExt(path, options)32}33 34function isexe (path, options, cb) {35  fs.stat(path, function (er, stat) {36    cb(er, er ? false : checkStat(stat, path, options))37  })38}39 40function sync (path, options) {41  return checkStat(fs.statSync(path), path, options)42}43 
basant307/AI_Governance_Project · CoolFace