apollo-client-code-first-request
Version:
39 lines • 1.92 kB
JavaScript
;
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
exports.__esModule = true;
exports.IntersectionType = void 0;
var decorators_1 = require("../decorators");
var utils_1 = require("../utils");
var type_helpers_util_1 = require("./type-helpers.util");
function IntersectionType(classARef, classBRef) {
var parentAPropertyNames = utils_1.Metadata.getPropertyNames(classARef.prototype);
var parentBPropertyNames = utils_1.Metadata.getPropertyNames(classBRef.prototype);
var IntersectionObjectType = (function () {
function IntersectionObjectType() {
(0, type_helpers_util_1.inheritPropertyInitializers)(this, classARef);
(0, type_helpers_util_1.inheritPropertyInitializers)(this, classBRef);
}
return IntersectionObjectType;
}());
parentAPropertyNames.forEach(function (propertyName) {
var fieldInfo = utils_1.Metadata.getFieldInfo(classARef.prototype, propertyName);
(0, decorators_1.Field)(__assign(__assign({}, fieldInfo), (fieldInfo.isArray && { type: [fieldInfo.type] })))(IntersectionObjectType.prototype, propertyName);
});
parentBPropertyNames.forEach(function (propertyName) {
var fieldInfo = utils_1.Metadata.getFieldInfo(classBRef.prototype, propertyName);
(0, decorators_1.Field)(__assign(__assign({}, fieldInfo), (fieldInfo.isArray && { type: [fieldInfo.type] })))(IntersectionObjectType.prototype, propertyName);
});
return IntersectionObjectType;
}
exports.IntersectionType = IntersectionType;
//# sourceMappingURL=intersection-type.util.js.map