feat: ✨ Created a mini nodeJS server with NewMan for testing without PostMan GUI.
This will mimic a run in a CD/CI environment or docker container.
This commit is contained in:
63
node_modules/bluebird/js/main/direct_resolve.js
generated
vendored
Normal file
63
node_modules/bluebird/js/main/direct_resolve.js
generated
vendored
Normal file
@@ -0,0 +1,63 @@
|
||||
"use strict";
|
||||
var util = require("./util.js");
|
||||
var isPrimitive = util.isPrimitive;
|
||||
|
||||
module.exports = function(Promise) {
|
||||
var returner = function () {
|
||||
return this;
|
||||
};
|
||||
var thrower = function () {
|
||||
throw this;
|
||||
};
|
||||
var returnUndefined = function() {};
|
||||
var throwUndefined = function() {
|
||||
throw undefined;
|
||||
};
|
||||
|
||||
var wrapper = function (value, action) {
|
||||
if (action === 1) {
|
||||
return function () {
|
||||
throw value;
|
||||
};
|
||||
} else if (action === 2) {
|
||||
return function () {
|
||||
return value;
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Promise.prototype["return"] =
|
||||
Promise.prototype.thenReturn = function (value) {
|
||||
if (value === undefined) return this.then(returnUndefined);
|
||||
|
||||
if (isPrimitive(value)) {
|
||||
return this._then(
|
||||
wrapper(value, 2),
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined
|
||||
);
|
||||
} else if (value instanceof Promise) {
|
||||
value._ignoreRejections();
|
||||
}
|
||||
return this._then(returner, undefined, undefined, value, undefined);
|
||||
};
|
||||
|
||||
Promise.prototype["throw"] =
|
||||
Promise.prototype.thenThrow = function (reason) {
|
||||
if (reason === undefined) return this.then(throwUndefined);
|
||||
|
||||
if (isPrimitive(reason)) {
|
||||
return this._then(
|
||||
wrapper(reason, 1),
|
||||
undefined,
|
||||
undefined,
|
||||
undefined,
|
||||
undefined
|
||||
);
|
||||
}
|
||||
return this._then(thrower, undefined, undefined, reason, undefined);
|
||||
};
|
||||
};
|
Reference in New Issue
Block a user