1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.createIndexDecorator = void 0;
|
4 | const index_service_1 = require("./index-service");
|
5 | function createIndexDecorator(options = {}) {
|
6 | let indexId;
|
7 | return ((...args) => {
|
8 | if (args.length >= 2) {
|
9 | const [target, propertyName] = args;
|
10 | const fieldOptions = { name: propertyName };
|
11 | indexId = (0, index_service_1.addFieldToIndex)(target, fieldOptions, options, indexId);
|
12 | return;
|
13 | }
|
14 | return (target, propertyName) => {
|
15 | const fieldOptions = Object.assign({ name: propertyName }, args[0]);
|
16 | indexId = (0, index_service_1.addFieldToIndex)(target, fieldOptions, options, indexId);
|
17 | };
|
18 | });
|
19 | }
|
20 | exports.createIndexDecorator = createIndexDecorator;
|
21 |
|
\ | No newline at end of file |