Node-Red configuration
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

safe-get-built-in.js 487B

12345678910111213
  1. 'use strict';
  2. var globalThis = require('../internals/global-this');
  3. var DESCRIPTORS = require('../internals/descriptors');
  4. // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe
  5. var getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
  6. // Avoid NodeJS experimental warning
  7. module.exports = function (name) {
  8. if (!DESCRIPTORS) return globalThis[name];
  9. var descriptor = getOwnPropertyDescriptor(globalThis, name);
  10. return descriptor && descriptor.value;
  11. };