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.

13 lines
318 B

4 years ago
  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. util.promisify = polyfill;
  8. Object.defineProperty(util, 'promisify', { value: polyfill });
  9. }
  10. return polyfill;
  11. };