aboutsummaryrefslogtreecommitdiffstats
path: root/node_modules/isexe
diff options
context:
space:
mode:
Diffstat (limited to 'node_modules/isexe')
-rw-r--r--node_modules/isexe/LICENSE.md55
-rw-r--r--node_modules/isexe/README.md80
-rw-r--r--node_modules/isexe/dist/commonjs/index.d.ts14
-rw-r--r--node_modules/isexe/dist/commonjs/index.js56
-rw-r--r--node_modules/isexe/dist/commonjs/index.min.js2
-rw-r--r--node_modules/isexe/dist/commonjs/options.d.ts32
-rw-r--r--node_modules/isexe/dist/commonjs/options.js3
-rw-r--r--node_modules/isexe/dist/commonjs/package.json3
-rw-r--r--node_modules/isexe/dist/commonjs/posix.d.ts18
-rw-r--r--node_modules/isexe/dist/commonjs/posix.js67
-rw-r--r--node_modules/isexe/dist/commonjs/win32.d.ts18
-rw-r--r--node_modules/isexe/dist/commonjs/win32.js63
-rw-r--r--node_modules/isexe/dist/esm/index.d.ts14
-rw-r--r--node_modules/isexe/dist/esm/index.js16
-rw-r--r--node_modules/isexe/dist/esm/index.min.js2
-rw-r--r--node_modules/isexe/dist/esm/options.d.ts32
-rw-r--r--node_modules/isexe/dist/esm/options.js2
-rw-r--r--node_modules/isexe/dist/esm/package.json3
-rw-r--r--node_modules/isexe/dist/esm/posix.d.ts18
-rw-r--r--node_modules/isexe/dist/esm/posix.js62
-rw-r--r--node_modules/isexe/dist/esm/win32.d.ts18
-rw-r--r--node_modules/isexe/dist/esm/win32.js58
-rw-r--r--node_modules/isexe/package.json78
23 files changed, 714 insertions, 0 deletions
diff --git a/node_modules/isexe/LICENSE.md b/node_modules/isexe/LICENSE.md
new file mode 100644
index 0000000..c5402b9
--- /dev/null
+++ b/node_modules/isexe/LICENSE.md
@@ -0,0 +1,55 @@
+# Blue Oak Model License
+
+Version 1.0.0
+
+## Purpose
+
+This license gives everyone as much permission to work with
+this software as possible, while protecting contributors
+from liability.
+
+## Acceptance
+
+In order to receive this license, you must agree to its
+rules. The rules of this license are both obligations
+under that agreement and conditions to your license.
+You must not do anything with this software that triggers
+a rule that you cannot or will not follow.
+
+## Copyright
+
+Each contributor licenses you to do everything with this
+software that would otherwise infringe that contributor's
+copyright in it.
+
+## Notices
+
+You must ensure that everyone who gets a copy of
+any part of this software from you, with or without
+changes, also gets the text of this license or a link to
+<https://blueoakcouncil.org/license/1.0.0>.
+
+## Excuse
+
+If anyone notifies you in writing that you have not
+complied with [Notices](#notices), you can keep your
+license by taking all practical steps to comply within 30
+days after the notice. If you do not do so, your license
+ends immediately.
+
+## Patent
+
+Each contributor licenses you to do everything with this
+software that would otherwise infringe any patent claims
+they can license or become able to license.
+
+## Reliability
+
+No contributor can revoke this license.
+
+## No Liability
+
+***As far as the law allows, this software comes as is,
+without any warranty or condition, and no contributor
+will be liable to anyone for any damages related to this
+software or this license, under any kind of legal claim.***
diff --git a/node_modules/isexe/README.md b/node_modules/isexe/README.md
new file mode 100644
index 0000000..e050d21
--- /dev/null
+++ b/node_modules/isexe/README.md
@@ -0,0 +1,80 @@
+# isexe
+
+Minimal module to check if a file is executable, and a normal file.
+
+Uses `fs.stat` and tests against the `PATHEXT` environment variable on
+Windows.
+
+## USAGE
+
+```js
+// default export is a minified version that doesn't need to
+// load more than one file. Load the 'isexe/raw' export if
+// you want the non-minified version for some reason.
+import { isexe, sync } from 'isexe'
+// or require() works too
+// const { isexe } = require('isexe')
+isexe('some-file-name').then(
+ isExe => {
+ if (isExe) {
+ console.error('this thing can be run')
+ } else {
+ console.error('cannot be run')
+ }
+ },
+ err => {
+ console.error('probably file doesnt exist or something')
+ },
+)
+
+// same thing but synchronous, throws errors
+isExe = sync('some-file-name')
+
+// treat errors as just "not executable"
+const isExe = await isexe('maybe-missing-file', { ignoreErrors: true })
+const isExe = sync('maybe-missing-file', { ignoreErrors: true })
+```
+
+## API
+
+### `isexe(path, [options]) => Promise<boolean>`
+
+Check if the path is executable.
+
+Will raise whatever errors may be raised by `fs.stat`, unless
+`options.ignoreErrors` is set to true.
+
+### `sync(path, [options]) => boolean`
+
+Same as `isexe` but returns the value and throws any errors raised.
+
+## Platform Specific Implementations
+
+If for some reason you want to use the implementation for a
+specific platform, you can do that.
+
+```js
+import { win32, posix } from 'isexe'
+win32.isexe(...)
+win32.sync(...)
+// etc
+
+// or:
+import { isexe, sync } from 'isexe/posix'
+```
+
+The default exported implementation will be chosen based on
+`process.platform`.
+
+### Options
+
+```ts
+import type IsexeOptions from 'isexe'
+```
+
+- `ignoreErrors` Treat all errors as "no, this is not
+ executable", but don't raise them.
+- `uid` Number to use as the user id on posix
+- `gid` Number to use as the group id on posix
+- `pathExt` List of path extensions to use instead of `PATHEXT`
+ environment variable on Windows.
diff --git a/node_modules/isexe/dist/commonjs/index.d.ts b/node_modules/isexe/dist/commonjs/index.d.ts
new file mode 100644
index 0000000..223bf78
--- /dev/null
+++ b/node_modules/isexe/dist/commonjs/index.d.ts
@@ -0,0 +1,14 @@
+import * as posix from './posix.js';
+import * as win32 from './win32.js';
+export * from './options.js';
+export { win32, posix };
+/**
+ * Determine whether a path is executable on the current platform.
+ */
+export declare const isexe: (path: string, options?: import("./options.js").IsexeOptions) => Promise<boolean>;
+/**
+ * Synchronously determine whether a path is executable on the
+ * current platform.
+ */
+export declare const sync: (path: string, options?: import("./options.js").IsexeOptions) => boolean;
+//# sourceMappingURL=index.d.ts.map \ No newline at end of file
diff --git a/node_modules/isexe/dist/commonjs/index.js b/node_modules/isexe/dist/commonjs/index.js
new file mode 100644
index 0000000..71882e7
--- /dev/null
+++ b/node_modules/isexe/dist/commonjs/index.js
@@ -0,0 +1,56 @@
+"use strict";
+var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ var desc = Object.getOwnPropertyDescriptor(m, k);
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
+ desc = { enumerable: true, get: function() { return m[k]; } };
+ }
+ Object.defineProperty(o, k2, desc);
+}) : (function(o, m, k, k2) {
+ if (k2 === undefined) k2 = k;
+ o[k2] = m[k];
+}));
+var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
+}) : function(o, v) {
+ o["default"] = v;
+});
+var __importStar = (this && this.__importStar) || (function () {
+ var ownKeys = function(o) {
+ ownKeys = Object.getOwnPropertyNames || function (o) {
+ var ar = [];
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
+ return ar;
+ };
+ return ownKeys(o);
+ };
+ return function (mod) {
+ if (mod && mod.__esModule) return mod;
+ var result = {};
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
+ __setModuleDefault(result, mod);
+ return result;
+ };
+})();
+var __exportStar = (this && this.__exportStar) || function(m, exports) {
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
+};
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.sync = exports.isexe = exports.posix = exports.win32 = void 0;
+const posix = __importStar(require("./posix.js"));
+exports.posix = posix;
+const win32 = __importStar(require("./win32.js"));
+exports.win32 = win32;
+__exportStar(require("./options.js"), exports);
+const platform = process.env._ISEXE_TEST_PLATFORM_ || process.platform;
+const impl = platform === 'win32' ? win32 : posix;
+/**
+ * Determine whether a path is executable on the current platform.
+ */
+exports.isexe = impl.isexe;
+/**
+ * Synchronously determine whether a path is executable on the
+ * current platform.
+ */
+exports.sync = impl.sync;
+//# sourceMappingURL=index.js.map \ No newline at end of file
diff --git a/node_modules/isexe/dist/commonjs/index.min.js b/node_modules/isexe/dist/commonjs/index.min.js
new file mode 100644
index 0000000..7cb0271
--- /dev/null
+++ b/node_modules/isexe/dist/commonjs/index.min.js
@@ -0,0 +1,2 @@
+"use strict";var a=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports);var _=a(i=>{"use strict";Object.defineProperty(i,"__esModule",{value:!0});i.sync=i.isexe=void 0;var M=require("node:fs"),x=require("node:fs/promises"),q=async(t,e={})=>{let{ignoreErrors:r=!1}=e;try{return d(await(0,x.stat)(t),e)}catch(s){let n=s;if(r||n.code==="EACCES")return!1;throw n}};i.isexe=q;var m=(t,e={})=>{let{ignoreErrors:r=!1}=e;try{return d((0,M.statSync)(t),e)}catch(s){let n=s;if(r||n.code==="EACCES")return!1;throw n}};i.sync=m;var d=(t,e)=>t.isFile()&&A(t,e),A=(t,e)=>{let r=e.uid??process.getuid?.(),s=e.groups??process.getgroups?.()??[],n=e.gid??process.getgid?.()??s[0];if(r===void 0||n===void 0)throw new Error("cannot get uid or gid");let u=new Set([n,...s]),c=t.mode,S=t.uid,P=t.gid,f=parseInt("100",8),l=parseInt("010",8),j=parseInt("001",8),C=f|l;return!!(c&j||c&l&&u.has(P)||c&f&&S===r||c&C&&r===0)}});var g=a(o=>{"use strict";Object.defineProperty(o,"__esModule",{value:!0});o.sync=o.isexe=void 0;var T=require("node:fs"),I=require("node:fs/promises"),D=require("node:path"),F=async(t,e={})=>{let{ignoreErrors:r=!1}=e;try{return y(await(0,I.stat)(t),t,e)}catch(s){let n=s;if(r||n.code==="EACCES")return!1;throw n}};o.isexe=F;var L=(t,e={})=>{let{ignoreErrors:r=!1}=e;try{return y((0,T.statSync)(t),t,e)}catch(s){let n=s;if(r||n.code==="EACCES")return!1;throw n}};o.sync=L;var B=(t,e)=>{let{pathExt:r=process.env.PATHEXT||""}=e,s=r.split(D.delimiter);if(s.indexOf("")!==-1)return!0;for(let n of s){let u=n.toLowerCase(),c=t.substring(t.length-u.length).toLowerCase();if(u&&c===u)return!0}return!1},y=(t,e,r)=>t.isFile()&&B(e,r)});var p=a(h=>{"use strict";Object.defineProperty(h,"__esModule",{value:!0})});var v=exports&&exports.__createBinding||(Object.create?(function(t,e,r,s){s===void 0&&(s=r);var n=Object.getOwnPropertyDescriptor(e,r);(!n||("get"in n?!e.__esModule:n.writable||n.configurable))&&(n={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,s,n)}):(function(t,e,r,s){s===void 0&&(s=r),t[s]=e[r]})),G=exports&&exports.__setModuleDefault||(Object.create?(function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}):function(t,e){t.default=e}),w=exports&&exports.__importStar||(function(){var t=function(e){return t=Object.getOwnPropertyNames||function(r){var s=[];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(s[s.length]=n);return s},t(e)};return function(e){if(e&&e.__esModule)return e;var r={};if(e!=null)for(var s=t(e),n=0;n<s.length;n++)s[n]!=="default"&&v(r,e,s[n]);return G(r,e),r}})(),X=exports&&exports.__exportStar||function(t,e){for(var r in t)r!=="default"&&!Object.prototype.hasOwnProperty.call(e,r)&&v(e,t,r)};Object.defineProperty(exports,"__esModule",{value:!0});exports.sync=exports.isexe=exports.posix=exports.win32=void 0;var E=w(_());exports.posix=E;var O=w(g());exports.win32=O;X(p(),exports);var H=process.env._ISEXE_TEST_PLATFORM_||process.platform,b=H==="win32"?O:E;exports.isexe=b.isexe;exports.sync=b.sync;
+//# sourceMappingURL=index.min.js.map
diff --git a/node_modules/isexe/dist/commonjs/options.d.ts b/node_modules/isexe/dist/commonjs/options.d.ts
new file mode 100644
index 0000000..c30a29b
--- /dev/null
+++ b/node_modules/isexe/dist/commonjs/options.d.ts
@@ -0,0 +1,32 @@
+export interface IsexeOptions {
+ /**
+ * Ignore errors arising from attempting to get file access status
+ * Note that EACCES is always ignored, because that just means
+ * it's not executable. If this is not set, then attempting to check
+ * the executable-ness of a nonexistent file will raise ENOENT, for
+ * example.
+ */
+ ignoreErrors?: boolean;
+ /**
+ * effective uid when checking executable mode flags on posix
+ * Defaults to process.getuid()
+ */
+ uid?: number;
+ /**
+ * effective gid when checking executable mode flags on posix
+ * Defaults to process.getgid()
+ */
+ gid?: number;
+ /**
+ * effective group ID list to use when checking executable mode flags
+ * on posix
+ * Defaults to process.getgroups()
+ */
+ groups?: number[];
+ /**
+ * The ;-delimited path extension list for win32 implementation.
+ * Defaults to process.env.PATHEXT
+ */
+ pathExt?: string;
+}
+//# sourceMappingURL=options.d.ts.map \ No newline at end of file
diff --git a/node_modules/isexe/dist/commonjs/options.js b/node_modules/isexe/dist/commonjs/options.js
new file mode 100644
index 0000000..0dfad07
--- /dev/null
+++ b/node_modules/isexe/dist/commonjs/options.js
@@ -0,0 +1,3 @@
+"use strict";
+Object.defineProperty(exports, "__esModule", { value: true });
+//# sourceMappingURL=options.js.map \ No newline at end of file
diff --git a/node_modules/isexe/dist/commonjs/package.json b/node_modules/isexe/dist/commonjs/package.json
new file mode 100644
index 0000000..5bbefff
--- /dev/null
+++ b/node_modules/isexe/dist/commonjs/package.json
@@ -0,0 +1,3 @@
+{
+ "type": "commonjs"
+}
diff --git a/node_modules/isexe/dist/commonjs/posix.d.ts b/node_modules/isexe/dist/commonjs/posix.d.ts
new file mode 100644
index 0000000..04874a1
--- /dev/null
+++ b/node_modules/isexe/dist/commonjs/posix.d.ts
@@ -0,0 +1,18 @@
+/**
+ * This is the Posix implementation of isexe, which uses the file
+ * mode and uid/gid values.
+ *
+ * @module
+ */
+import { IsexeOptions } from './options.js';
+/**
+ * Determine whether a path is executable according to the mode and
+ * current (or specified) user and group IDs.
+ */
+export declare const isexe: (path: string, options?: IsexeOptions) => Promise<boolean>;
+/**
+ * Synchronously determine whether a path is executable according to
+ * the mode and current (or specified) user and group IDs.
+ */
+export declare const sync: (path: string, options?: IsexeOptions) => boolean;
+//# sourceMappingURL=posix.d.ts.map \ No newline at end of file
diff --git a/node_modules/isexe/dist/commonjs/posix.js b/node_modules/isexe/dist/commonjs/posix.js
new file mode 100644
index 0000000..c6b9f63
--- /dev/null
+++ b/node_modules/isexe/dist/commonjs/posix.js
@@ -0,0 +1,67 @@
+"use strict";
+/**
+ * This is the Posix implementation of isexe, which uses the file
+ * mode and uid/gid values.
+ *
+ * @module
+ */
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.sync = exports.isexe = void 0;
+const node_fs_1 = require("node:fs");
+const promises_1 = require("node:fs/promises");
+/**
+ * Determine whether a path is executable according to the mode and
+ * current (or specified) user and group IDs.
+ */
+const isexe = async (path, options = {}) => {
+ const { ignoreErrors = false } = options;
+ try {
+ return checkStat(await (0, promises_1.stat)(path), options);
+ }
+ catch (e) {
+ const er = e;
+ if (ignoreErrors || er.code === 'EACCES')
+ return false;
+ throw er;
+ }
+};
+exports.isexe = isexe;
+/**
+ * Synchronously determine whether a path is executable according to
+ * the mode and current (or specified) user and group IDs.
+ */
+const sync = (path, options = {}) => {
+ const { ignoreErrors = false } = options;
+ try {
+ return checkStat((0, node_fs_1.statSync)(path), options);
+ }
+ catch (e) {
+ const er = e;
+ if (ignoreErrors || er.code === 'EACCES')
+ return false;
+ throw er;
+ }
+};
+exports.sync = sync;
+const checkStat = (stat, options) => stat.isFile() && checkMode(stat, options);
+const checkMode = (stat, options) => {
+ const myUid = options.uid ?? process.getuid?.();
+ const myGroups = options.groups ?? process.getgroups?.() ?? [];
+ const myGid = options.gid ?? process.getgid?.() ?? myGroups[0];
+ if (myUid === undefined || myGid === undefined) {
+ throw new Error('cannot get uid or gid');
+ }
+ const groups = new Set([myGid, ...myGroups]);
+ const mod = stat.mode;
+ const uid = stat.uid;
+ const gid = stat.gid;
+ const u = parseInt('100', 8);
+ const g = parseInt('010', 8);
+ const o = parseInt('001', 8);
+ const ug = u | g;
+ return !!(mod & o ||
+ (mod & g && groups.has(gid)) ||
+ (mod & u && uid === myUid) ||
+ (mod & ug && myUid === 0));
+};
+//# sourceMappingURL=posix.js.map \ No newline at end of file
diff --git a/node_modules/isexe/dist/commonjs/win32.d.ts b/node_modules/isexe/dist/commonjs/win32.d.ts
new file mode 100644
index 0000000..e3f68d1
--- /dev/null
+++ b/node_modules/isexe/dist/commonjs/win32.d.ts
@@ -0,0 +1,18 @@
+/**
+ * This is the Windows implementation of isexe, which uses the file
+ * extension and PATHEXT setting.
+ *
+ * @module
+ */
+import { IsexeOptions } from './options.js';
+/**
+ * Determine whether a path is executable based on the file extension
+ * and PATHEXT environment variable (or specified pathExt option)
+ */
+export declare const isexe: (path: string, options?: IsexeOptions) => Promise<boolean>;
+/**
+ * Synchronously determine whether a path is executable based on the file
+ * extension and PATHEXT environment variable (or specified pathExt option)
+ */
+export declare const sync: (path: string, options?: IsexeOptions) => boolean;
+//# sourceMappingURL=win32.d.ts.map \ No newline at end of file
diff --git a/node_modules/isexe/dist/commonjs/win32.js b/node_modules/isexe/dist/commonjs/win32.js
new file mode 100644
index 0000000..c1524a1
--- /dev/null
+++ b/node_modules/isexe/dist/commonjs/win32.js
@@ -0,0 +1,63 @@
+"use strict";
+/**
+ * This is the Windows implementation of isexe, which uses the file
+ * extension and PATHEXT setting.
+ *
+ * @module
+ */
+Object.defineProperty(exports, "__esModule", { value: true });
+exports.sync = exports.isexe = void 0;
+const node_fs_1 = require("node:fs");
+const promises_1 = require("node:fs/promises");
+const node_path_1 = require("node:path");
+/**
+ * Determine whether a path is executable based on the file extension
+ * and PATHEXT environment variable (or specified pathExt option)
+ */
+const isexe = async (path, options = {}) => {
+ const { ignoreErrors = false } = options;
+ try {
+ return checkStat(await (0, promises_1.stat)(path), path, options);
+ }
+ catch (e) {
+ const er = e;
+ if (ignoreErrors || er.code === 'EACCES')
+ return false;
+ throw er;
+ }
+};
+exports.isexe = isexe;
+/**
+ * Synchronously determine whether a path is executable based on the file
+ * extension and PATHEXT environment variable (or specified pathExt option)
+ */
+const sync = (path, options = {}) => {
+ const { ignoreErrors = false } = options;
+ try {
+ return checkStat((0, node_fs_1.statSync)(path), path, options);
+ }
+ catch (e) {
+ const er = e;
+ if (ignoreErrors || er.code === 'EACCES')
+ return false;
+ throw er;
+ }
+};
+exports.sync = sync;
+const checkPathExt = (path, options) => {
+ const { pathExt = process.env.PATHEXT || '' } = options;
+ const peSplit = pathExt.split(node_path_1.delimiter);
+ if (peSplit.indexOf('') !== -1) {
+ return true;
+ }
+ for (const pes of peSplit) {
+ const p = pes.toLowerCase();
+ const ext = path.substring(path.length - p.length).toLowerCase();
+ if (p && ext === p) {
+ return true;
+ }
+ }
+ return false;
+};
+const checkStat = (stat, path, options) => stat.isFile() && checkPathExt(path, options);
+//# sourceMappingURL=win32.js.map \ No newline at end of file
diff --git a/node_modules/isexe/dist/esm/index.d.ts b/node_modules/isexe/dist/esm/index.d.ts
new file mode 100644
index 0000000..223bf78
--- /dev/null
+++ b/node_modules/isexe/dist/esm/index.d.ts
@@ -0,0 +1,14 @@
+import * as posix from './posix.js';
+import * as win32 from './win32.js';
+export * from './options.js';
+export { win32, posix };
+/**
+ * Determine whether a path is executable on the current platform.
+ */
+export declare const isexe: (path: string, options?: import("./options.js").IsexeOptions) => Promise<boolean>;
+/**
+ * Synchronously determine whether a path is executable on the
+ * current platform.
+ */
+export declare const sync: (path: string, options?: import("./options.js").IsexeOptions) => boolean;
+//# sourceMappingURL=index.d.ts.map \ No newline at end of file
diff --git a/node_modules/isexe/dist/esm/index.js b/node_modules/isexe/dist/esm/index.js
new file mode 100644
index 0000000..1e309ac
--- /dev/null
+++ b/node_modules/isexe/dist/esm/index.js
@@ -0,0 +1,16 @@
+import * as posix from './posix.js';
+import * as win32 from './win32.js';
+export * from './options.js';
+export { win32, posix };
+const platform = process.env._ISEXE_TEST_PLATFORM_ || process.platform;
+const impl = platform === 'win32' ? win32 : posix;
+/**
+ * Determine whether a path is executable on the current platform.
+ */
+export const isexe = impl.isexe;
+/**
+ * Synchronously determine whether a path is executable on the
+ * current platform.
+ */
+export const sync = impl.sync;
+//# sourceMappingURL=index.js.map \ No newline at end of file
diff --git a/node_modules/isexe/dist/esm/index.min.js b/node_modules/isexe/dist/esm/index.min.js
new file mode 100644
index 0000000..f3a6fc3
--- /dev/null
+++ b/node_modules/isexe/dist/esm/index.min.js
@@ -0,0 +1,2 @@
+var y=Object.defineProperty;var u=(t,r)=>{for(var e in r)y(t,e,{get:r[e],enumerable:!0})};var i={};u(i,{isexe:()=>C,sync:()=>A});import{statSync as w}from"node:fs";import{stat as S}from"node:fs/promises";var C=async(t,r={})=>{let{ignoreErrors:e=!1}=r;try{return d(await S(t),r)}catch(s){let o=s;if(e||o.code==="EACCES")return!1;throw o}},A=(t,r={})=>{let{ignoreErrors:e=!1}=r;try{return d(w(t),r)}catch(s){let o=s;if(e||o.code==="EACCES")return!1;throw o}},d=(t,r)=>t.isFile()&&T(t,r),T=(t,r)=>{let e=r.uid??process.getuid?.(),s=r.groups??process.getgroups?.()??[],o=r.gid??process.getgid?.()??s[0];if(e===void 0||o===void 0)throw new Error("cannot get uid or gid");let c=new Set([o,...s]),n=t.mode,l=t.uid,E=t.gid,f=parseInt("100",8),p=parseInt("010",8),x=parseInt("001",8),h=f|p;return!!(n&x||n&p&&c.has(E)||n&f&&l===e||n&h&&e===0)};var a={};u(a,{isexe:()=>F,sync:()=>L});import{statSync as k}from"node:fs";import{stat as I}from"node:fs/promises";import{delimiter as _}from"node:path";var F=async(t,r={})=>{let{ignoreErrors:e=!1}=r;try{return m(await I(t),t,r)}catch(s){let o=s;if(e||o.code==="EACCES")return!1;throw o}},L=(t,r={})=>{let{ignoreErrors:e=!1}=r;try{return m(k(t),t,r)}catch(s){let o=s;if(e||o.code==="EACCES")return!1;throw o}},P=(t,r)=>{let{pathExt:e=process.env.PATHEXT||""}=r,s=e.split(_);if(s.indexOf("")!==-1)return!0;for(let o of s){let c=o.toLowerCase(),n=t.substring(t.length-c.length).toLowerCase();if(c&&n===c)return!0}return!1},m=(t,r,e)=>t.isFile()&&P(r,e);var v=process.env._ISEXE_TEST_PLATFORM_||process.platform,g=v==="win32"?a:i,R=g.isexe,U=g.sync;export{R as isexe,i as posix,U as sync,a as win32};
+//# sourceMappingURL=index.min.js.map
diff --git a/node_modules/isexe/dist/esm/options.d.ts b/node_modules/isexe/dist/esm/options.d.ts
new file mode 100644
index 0000000..c30a29b
--- /dev/null
+++ b/node_modules/isexe/dist/esm/options.d.ts
@@ -0,0 +1,32 @@
+export interface IsexeOptions {
+ /**
+ * Ignore errors arising from attempting to get file access status
+ * Note that EACCES is always ignored, because that just means
+ * it's not executable. If this is not set, then attempting to check
+ * the executable-ness of a nonexistent file will raise ENOENT, for
+ * example.
+ */
+ ignoreErrors?: boolean;
+ /**
+ * effective uid when checking executable mode flags on posix
+ * Defaults to process.getuid()
+ */
+ uid?: number;
+ /**
+ * effective gid when checking executable mode flags on posix
+ * Defaults to process.getgid()
+ */
+ gid?: number;
+ /**
+ * effective group ID list to use when checking executable mode flags
+ * on posix
+ * Defaults to process.getgroups()
+ */
+ groups?: number[];
+ /**
+ * The ;-delimited path extension list for win32 implementation.
+ * Defaults to process.env.PATHEXT
+ */
+ pathExt?: string;
+}
+//# sourceMappingURL=options.d.ts.map \ No newline at end of file
diff --git a/node_modules/isexe/dist/esm/options.js b/node_modules/isexe/dist/esm/options.js
new file mode 100644
index 0000000..e9ded40
--- /dev/null
+++ b/node_modules/isexe/dist/esm/options.js
@@ -0,0 +1,2 @@
+export {};
+//# sourceMappingURL=options.js.map \ No newline at end of file
diff --git a/node_modules/isexe/dist/esm/package.json b/node_modules/isexe/dist/esm/package.json
new file mode 100644
index 0000000..3dbc1ca
--- /dev/null
+++ b/node_modules/isexe/dist/esm/package.json
@@ -0,0 +1,3 @@
+{
+ "type": "module"
+}
diff --git a/node_modules/isexe/dist/esm/posix.d.ts b/node_modules/isexe/dist/esm/posix.d.ts
new file mode 100644
index 0000000..04874a1
--- /dev/null
+++ b/node_modules/isexe/dist/esm/posix.d.ts
@@ -0,0 +1,18 @@
+/**
+ * This is the Posix implementation of isexe, which uses the file
+ * mode and uid/gid values.
+ *
+ * @module
+ */
+import { IsexeOptions } from './options.js';
+/**
+ * Determine whether a path is executable according to the mode and
+ * current (or specified) user and group IDs.
+ */
+export declare const isexe: (path: string, options?: IsexeOptions) => Promise<boolean>;
+/**
+ * Synchronously determine whether a path is executable according to
+ * the mode and current (or specified) user and group IDs.
+ */
+export declare const sync: (path: string, options?: IsexeOptions) => boolean;
+//# sourceMappingURL=posix.d.ts.map \ No newline at end of file
diff --git a/node_modules/isexe/dist/esm/posix.js b/node_modules/isexe/dist/esm/posix.js
new file mode 100644
index 0000000..f1af6d5
--- /dev/null
+++ b/node_modules/isexe/dist/esm/posix.js
@@ -0,0 +1,62 @@
+/**
+ * This is the Posix implementation of isexe, which uses the file
+ * mode and uid/gid values.
+ *
+ * @module
+ */
+import { statSync } from 'node:fs';
+import { stat } from 'node:fs/promises';
+/**
+ * Determine whether a path is executable according to the mode and
+ * current (or specified) user and group IDs.
+ */
+export const isexe = async (path, options = {}) => {
+ const { ignoreErrors = false } = options;
+ try {
+ return checkStat(await stat(path), options);
+ }
+ catch (e) {
+ const er = e;
+ if (ignoreErrors || er.code === 'EACCES')
+ return false;
+ throw er;
+ }
+};
+/**
+ * Synchronously determine whether a path is executable according to
+ * the mode and current (or specified) user and group IDs.
+ */
+export const sync = (path, options = {}) => {
+ const { ignoreErrors = false } = options;
+ try {
+ return checkStat(statSync(path), options);
+ }
+ catch (e) {
+ const er = e;
+ if (ignoreErrors || er.code === 'EACCES')
+ return false;
+ throw er;
+ }
+};
+const checkStat = (stat, options) => stat.isFile() && checkMode(stat, options);
+const checkMode = (stat, options) => {
+ const myUid = options.uid ?? process.getuid?.();
+ const myGroups = options.groups ?? process.getgroups?.() ?? [];
+ const myGid = options.gid ?? process.getgid?.() ?? myGroups[0];
+ if (myUid === undefined || myGid === undefined) {
+ throw new Error('cannot get uid or gid');
+ }
+ const groups = new Set([myGid, ...myGroups]);
+ const mod = stat.mode;
+ const uid = stat.uid;
+ const gid = stat.gid;
+ const u = parseInt('100', 8);
+ const g = parseInt('010', 8);
+ const o = parseInt('001', 8);
+ const ug = u | g;
+ return !!(mod & o ||
+ (mod & g && groups.has(gid)) ||
+ (mod & u && uid === myUid) ||
+ (mod & ug && myUid === 0));
+};
+//# sourceMappingURL=posix.js.map \ No newline at end of file
diff --git a/node_modules/isexe/dist/esm/win32.d.ts b/node_modules/isexe/dist/esm/win32.d.ts
new file mode 100644
index 0000000..e3f68d1
--- /dev/null
+++ b/node_modules/isexe/dist/esm/win32.d.ts
@@ -0,0 +1,18 @@
+/**
+ * This is the Windows implementation of isexe, which uses the file
+ * extension and PATHEXT setting.
+ *
+ * @module
+ */
+import { IsexeOptions } from './options.js';
+/**
+ * Determine whether a path is executable based on the file extension
+ * and PATHEXT environment variable (or specified pathExt option)
+ */
+export declare const isexe: (path: string, options?: IsexeOptions) => Promise<boolean>;
+/**
+ * Synchronously determine whether a path is executable based on the file
+ * extension and PATHEXT environment variable (or specified pathExt option)
+ */
+export declare const sync: (path: string, options?: IsexeOptions) => boolean;
+//# sourceMappingURL=win32.d.ts.map \ No newline at end of file
diff --git a/node_modules/isexe/dist/esm/win32.js b/node_modules/isexe/dist/esm/win32.js
new file mode 100644
index 0000000..2c75e67
--- /dev/null
+++ b/node_modules/isexe/dist/esm/win32.js
@@ -0,0 +1,58 @@
+/**
+ * This is the Windows implementation of isexe, which uses the file
+ * extension and PATHEXT setting.
+ *
+ * @module
+ */
+import { statSync } from 'node:fs';
+import { stat } from 'node:fs/promises';
+import { delimiter } from 'node:path';
+/**
+ * Determine whether a path is executable based on the file extension
+ * and PATHEXT environment variable (or specified pathExt option)
+ */
+export const isexe = async (path, options = {}) => {
+ const { ignoreErrors = false } = options;
+ try {
+ return checkStat(await stat(path), path, options);
+ }
+ catch (e) {
+ const er = e;
+ if (ignoreErrors || er.code === 'EACCES')
+ return false;
+ throw er;
+ }
+};
+/**
+ * Synchronously determine whether a path is executable based on the file
+ * extension and PATHEXT environment variable (or specified pathExt option)
+ */
+export const sync = (path, options = {}) => {
+ const { ignoreErrors = false } = options;
+ try {
+ return checkStat(statSync(path), path, options);
+ }
+ catch (e) {
+ const er = e;
+ if (ignoreErrors || er.code === 'EACCES')
+ return false;
+ throw er;
+ }
+};
+const checkPathExt = (path, options) => {
+ const { pathExt = process.env.PATHEXT || '' } = options;
+ const peSplit = pathExt.split(delimiter);
+ if (peSplit.indexOf('') !== -1) {
+ return true;
+ }
+ for (const pes of peSplit) {
+ const p = pes.toLowerCase();
+ const ext = path.substring(path.length - p.length).toLowerCase();
+ if (p && ext === p) {
+ return true;
+ }
+ }
+ return false;
+};
+const checkStat = (stat, path, options) => stat.isFile() && checkPathExt(path, options);
+//# sourceMappingURL=win32.js.map \ No newline at end of file
diff --git a/node_modules/isexe/package.json b/node_modules/isexe/package.json
new file mode 100644
index 0000000..31c05fa
--- /dev/null
+++ b/node_modules/isexe/package.json
@@ -0,0 +1,78 @@
+{
+ "name": "isexe",
+ "version": "4.0.0",
+ "description": "Minimal module to check if a file is executable.",
+ "main": "./dist/commonjs/index.min.js",
+ "module": "./dist/esm/index.min.js",
+ "types": "./dist/commonjs/index.d.ts",
+ "files": [
+ "dist"
+ ],
+ "tshy": {
+ "selfLink": false,
+ "exports": {
+ "./raw": "./src/index.ts",
+ "./package.json": "./package.json",
+ ".": {
+ "import": {
+ "types": "./dist/esm/index.d.ts",
+ "default": "./dist/esm/index.min.js"
+ },
+ "require": {
+ "types": "./dist/commonjs/index.d.ts",
+ "default": "./dist/commonjs/index.min.js"
+ }
+ }
+ }
+ },
+ "exports": {
+ "./raw": {
+ "import": {
+ "types": "./dist/esm/index.d.ts",
+ "default": "./dist/esm/index.js"
+ },
+ "require": {
+ "types": "./dist/commonjs/index.d.ts",
+ "default": "./dist/commonjs/index.js"
+ }
+ },
+ "./package.json": "./package.json",
+ ".": {
+ "import": {
+ "types": "./dist/esm/index.d.ts",
+ "default": "./dist/esm/index.min.js"
+ },
+ "require": {
+ "types": "./dist/commonjs/index.d.ts",
+ "default": "./dist/commonjs/index.min.js"
+ }
+ }
+ },
+ "devDependencies": {
+ "@types/node": "^25.2.1",
+ "esbuild": "^0.27.3",
+ "prettier": "^3.8.1",
+ "tap": "^21.5.1",
+ "tshy": "^3.1.3",
+ "typedoc": "^0.28.16"
+ },
+ "scripts": {
+ "preversion": "npm test",
+ "postversion": "npm publish",
+ "prepublishOnly": "git push origin --follow-tags",
+ "prepare": "tshy && bash build.sh",
+ "pretest": "npm run prepare",
+ "presnap": "npm run prepare",
+ "test": "tap",
+ "snap": "tap",
+ "format": "prettier --write .",
+ "typedoc": "typedoc"
+ },
+ "author": "Isaac Z. Schlueter <i@izs.me> (http://blog.izs.me/)",
+ "license": "BlueOak-1.0.0",
+ "repository": "https://github.com/isaacs/isexe",
+ "engines": {
+ "node": ">=20"
+ },
+ "type": "module"
+}