17 lines
415 B
JavaScript
Raw Permalink Normal View History

2023-12-03 16:59:28 +04:00
'use strict';
2024-01-06 20:33:49 +04:00
const pathKey = (options = {}) => {
const environment = options.env || process.env;
const platform = options.platform || process.platform;
2023-12-03 16:59:28 +04:00
if (platform !== 'win32') {
return 'PATH';
}
2024-01-06 20:33:49 +04:00
return Object.keys(environment).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path';
2023-12-03 16:59:28 +04:00
};
2024-01-06 20:33:49 +04:00
module.exports = pathKey;
// TODO: Remove this for the next major release
module.exports.default = pathKey;