UNPKG

738 BJavaScriptView Raw
1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.BelongsTo = void 0;
4const belongs_to_association_1 = require("./belongs-to-association");
5const association_service_1 = require("../shared/association-service");
6function BelongsTo(associatedClassGetter, optionsOrForeignKey) {
7 return (target, propertyName) => {
8 const options = (0, association_service_1.getPreparedAssociationOptions)(optionsOrForeignKey);
9 if (!options.as)
10 options.as = propertyName;
11 (0, association_service_1.addAssociation)(target, new belongs_to_association_1.BelongsToAssociation(associatedClassGetter, options));
12 };
13}
14exports.BelongsTo = BelongsTo;
15//# sourceMappingURL=belongs-to.js.map
\No newline at end of file