inversify
Version:
A powerful and lightweight inversion of control container for JavaScript and Node.js apps powered by TypeScript.
21 lines (20 loc) • 839 B
JavaScript
import guid from "../utils/guid";
var Request = (function () {
function Request(serviceIdentifier, parentContext, parentRequest, bindings, target) {
if (target === void 0) { target = null; }
this.guid = guid();
this.serviceIdentifier = serviceIdentifier;
this.parentContext = parentContext;
this.parentRequest = parentRequest;
this.target = target;
this.childRequests = [];
this.bindings = (Array.isArray(bindings) ? bindings : ((bindings) ? [bindings] : []));
}
Request.prototype.addChildRequest = function (serviceIdentifier, bindings, target) {
var child = new Request(serviceIdentifier, this.parentContext, this, bindings, target);
this.childRequests.push(child);
return child;
};
return Request;
}());
export default Request;