17 lines
415 B
JavaScript
Raw Normal View History

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