Pibd-21_Ievlewa_M.D._Intern.../node_modules/path-key/index.js

17 lines
415 B
JavaScript
Raw Permalink Normal View History

2023-12-03 19:52:09 +04:00
'use strict';
2023-12-22 00:41:43 +04:00
const pathKey = (options = {}) => {
const environment = options.env || process.env;
const platform = options.platform || process.platform;
2023-12-03 19:52:09 +04:00
if (platform !== 'win32') {
return 'PATH';
}
2023-12-22 00:41:43 +04:00
return Object.keys(environment).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path';
2023-12-03 19:52:09 +04:00
};
2023-12-22 00:41:43 +04:00
module.exports = pathKey;
// TODO: Remove this for the next major release
module.exports.default = pathKey;