env.js 867 B

12345678910111213141516171819202122232425
  1. 'use strict';
  2. var gOPD = require('gopd');
  3. var bind = require('function-bind');
  4. var unbound = gOPD && gOPD(function () {}, 'length');
  5. // @ts-expect-error ts(2555) TS is overly strict with .call
  6. var bound = gOPD && gOPD(bind.call(function () {}), 'length');
  7. var functionsHaveConfigurableLengths = !!(unbound && unbound.configurable);
  8. var functionsHaveWritableLengths = !!(unbound && unbound.writable);
  9. var boundFnsHaveConfigurableLengths = !!(bound && bound.configurable);
  10. var boundFnsHaveWritableLengths = !!(bound && bound.writable);
  11. /** @type {import('./env')} */
  12. module.exports = {
  13. __proto__: null,
  14. boundFnsHaveConfigurableLengths: boundFnsHaveConfigurableLengths,
  15. boundFnsHaveWritableLengths: boundFnsHaveWritableLengths,
  16. functionsHaveConfigurableLengths: functionsHaveConfigurableLengths,
  17. functionsHaveWritableLengths: functionsHaveWritableLengths
  18. };