@cloud-copilot/iam-lens
Version:
Visibility in IAM in and across AWS accounts
23 lines • 867 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getWorkerScriptPath = getWorkerScriptPath;
const fs_1 = require("fs");
const path_1 = require("path");
let root = (0, path_1.resolve)(__dirname, '../');
if (process.env.NODE_ENV === 'test') {
root = (0, path_1.resolve)(root, '..', 'dist', 'esm');
}
/**
* Get the path to a worker script, adjusted for the build output location.
*
* @param path the relative path to the worker script from the project src directory and with a .js extension
* @returns the absolute path to the worker script, or undefined if the worker script path does not exist
*/
function getWorkerScriptPath(path) {
const fullPath = (0, path_1.join)(root, path);
if (!(0, fs_1.existsSync)(fullPath)) {
return undefined;
}
return fullPath;
}
//# sourceMappingURL=workerScript.js.map