1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.BelongsTo = void 0;
|
4 | const belongs_to_association_1 = require("./belongs-to-association");
|
5 | const association_service_1 = require("../shared/association-service");
|
6 | function 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 | }
|
14 | exports.BelongsTo = BelongsTo;
|
15 |
|
\ | No newline at end of file |