package.internals.safe-get-built-in.js Maven / Gradle / Ivy
'use strict';
var global = require('../internals/global');
var DESCRIPTORS = require('../internals/descriptors');
// eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
// Avoid NodeJS experimental warning
module.exports = function (name) {
if (!DESCRIPTORS) return global[name];
var descriptor = getOwnPropertyDescriptor(global, name);
return descriptor && descriptor.value;
};
© 2015 - 2024 Weber Informatics LLC | Privacy Policy