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.

shim.js 357B

1234567891011121314151617
  1. 'use strict';
  2. var util = require('util');
  3. var getPolyfill = require('./polyfill');
  4. module.exports = function shimUtilPromisify() {
  5. var polyfill = getPolyfill();
  6. if (polyfill !== util.promisify) {
  7. Object.defineProperty(util, 'promisify', {
  8. configurable: true,
  9. enumerable: true,
  10. value: polyfill,
  11. writable: true
  12. });
  13. }
  14. return polyfill;
  15. };