node/deps/npm/node_modules/path-key/index.js
npm CLI robot b7c82a3480
deps: upgrade npm to 9.6.6
PR-URL: https://github.com/nodejs/node/pull/47862
Reviewed-By: Debadree Chatterjee <debadree333@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: Tobias Nießen <tniessen@tnie.de>
Reviewed-By: Luke Karrys <luke@lukekarrys.com>
2023-05-07 10:37:34 +00:00

17 lines
415 B
JavaScript

'use strict';
const pathKey = (options = {}) => {
const environment = options.env || process.env;
const platform = options.platform || process.platform;
if (platform !== 'win32') {
return 'PATH';
}
return Object.keys(environment).reverse().find(key => key.toUpperCase() === 'PATH') || 'Path';
};
module.exports = pathKey;
// TODO: Remove this for the next major release
module.exports.default = pathKey;