@backland/schema
Version:
TypeScript schema declaration and validation library with static type inference
34 lines (33 loc) • 1.05 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.initGraphType = initGraphType;
var _lazyCreateGraphTypeInitPayload = require("./lazyCreateGraphTypeInitPayload");
// FIXME should fix deep instantiation types and remove `any's`
function initGraphType(self, args) {
var _lazyCreateGraphTypeI = (0, _lazyCreateGraphTypeInitPayload.lazyCreateGraphTypeInitPayload)(args, function (payload) {
self.beforeInitialize.forEach(function (next) {
payload = next(payload);
});
self.touched = true;
return payload;
}),
initializer = _lazyCreateGraphTypeI.initializer,
idFromArgs = _lazyCreateGraphTypeI.idFromArgs;
Object.defineProperty(self, '__lazyGetter', {
get: function get() {
return initializer(self);
}
});
Object.defineProperty(self, 'definition', {
enumerable: true,
get: function get() {
return initializer(self).definition;
}
});
if (idFromArgs) {
self.identify(idFromArgs);
}
}
//# sourceMappingURL=initGraphType.js.map