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.

define-global-property.js 388B

12345678910111213
  1. 'use strict';
  2. var globalThis = require('../internals/global-this');
  3. // eslint-disable-next-line es/no-object-defineproperty -- safe
  4. var defineProperty = Object.defineProperty;
  5. module.exports = function (key, value) {
  6. try {
  7. defineProperty(globalThis, key, { value: value, configurable: true, writable: true });
  8. } catch (error) {
  9. globalThis[key] = value;
  10. } return value;
  11. };