shim.js 372 B

12345678910111213141516
  1. 'use strict';
  2. const getPolyfill = require('./polyfill');
  3. module.exports = () => {
  4. const polyfill = getPolyfill();
  5. if (polyfill !== process.allowedNodeEnvironmentFlags) {
  6. Object.defineProperty(process, 'allowedNodeEnvironmentFlags', {
  7. writable: true,
  8. enumerable: true,
  9. configurable: true,
  10. value: polyfill
  11. });
  12. }
  13. return polyfill;
  14. };