Some checks failed
Node.js CI / build (push) Failing after 2s
Node.js CI / e2e-tests (+(a11y|security|bugs)/**/*cy.js) (push) Failing after 2s
Node.js CI / e2e-tests (features/**/!(o|d|m)*.cy.js) (push) Failing after 2s
Node.js CI / e2e-tests (features/**/+(o|d)*.cy.js) (push) Failing after 2s
Node.js CI / e2e-tests (features/**/m*.cy.js) (push) Failing after 2s
CodeQL / Analyze (javascript) (push) Failing after 2m49s
Security scan for docker image / build (push) Failing after 54s
15 lines
530 B
JavaScript
Executable File
15 lines
530 B
JavaScript
Executable File
/*
|
|
* getAbsoluteFSPath
|
|
* @return {string} When run in NodeJS env, returns the absolute path to the current directory
|
|
* When run outside of NodeJS, will return an error message
|
|
*/
|
|
const getAbsoluteFSPath = function () {
|
|
// detect whether we are running in a browser or nodejs
|
|
if (typeof module !== "undefined" && module.exports) {
|
|
return require("path").resolve(__dirname)
|
|
}
|
|
throw new Error('getAbsoluteFSPath can only be called within a Nodejs environment');
|
|
}
|
|
|
|
module.exports = getAbsoluteFSPath
|