shim.js 318 B

12345678910111213
  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. };