Node-Red configuration
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.

promise-resolve.js 441B

12345678910111213
  1. 'use strict';
  2. var anObject = require('../internals/an-object');
  3. var isObject = require('../internals/is-object');
  4. var newPromiseCapability = require('../internals/new-promise-capability');
  5. module.exports = function (C, x) {
  6. anObject(C);
  7. if (isObject(x) && x.constructor === C) return x;
  8. var promiseCapability = newPromiseCapability.f(C);
  9. var resolve = promiseCapability.resolve;
  10. resolve(x);
  11. return promiseCapability.promise;
  12. };