1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | var __1 = require("../");
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | function Index(nameOrFieldsOrOptions, maybeFieldsOrOptions, maybeOptions) {
|
10 |
|
11 | var name = typeof nameOrFieldsOrOptions === "string" ? nameOrFieldsOrOptions : undefined;
|
12 | var fields = typeof nameOrFieldsOrOptions === "string" ? maybeFieldsOrOptions : nameOrFieldsOrOptions;
|
13 | var options = (typeof nameOrFieldsOrOptions === "object" && !Array.isArray(nameOrFieldsOrOptions)) ? nameOrFieldsOrOptions : maybeOptions;
|
14 | if (!options)
|
15 | options = (typeof maybeFieldsOrOptions === "object" && !Array.isArray(maybeFieldsOrOptions)) ? maybeFieldsOrOptions : maybeOptions;
|
16 | return function (clsOrObject, propertyName) {
|
17 | __1.getMetadataArgsStorage().indices.push({
|
18 | target: propertyName ? clsOrObject.constructor : clsOrObject,
|
19 | name: name,
|
20 | columns: propertyName ? [propertyName] : fields,
|
21 | synchronize: options && options.synchronize === false ? false : true,
|
22 | where: options ? options.where : undefined,
|
23 | unique: options && options.unique ? true : false,
|
24 | spatial: options && options.spatial ? true : false,
|
25 | fulltext: options && options.fulltext ? true : false,
|
26 | sparse: options && options.sparse ? true : false,
|
27 | background: options && options.background ? true : false,
|
28 | expireAfterSeconds: options && options.expireAfterSeconds ? options.expireAfterSeconds : undefined
|
29 | });
|
30 | };
|
31 | }
|
32 | exports.Index = Index;
|
33 |
|
34 |
|