UNPKG

nestjs-appwrite

Version:

Easier Appwrite integration for your NestJS application.

17 lines (16 loc) 636 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Index = Index; require("reflect-metadata"); const type_metadata_storage_1 = require("../storage/type-metadata.storage"); function Index(options) { return (target, propertyKey) => { const propKey = propertyKey.toString(); const optionsCopy = { ...options, orders: Array.isArray(options.orders) ? options.orders : [options.orders], attributes: options.attributes ?? [propKey], }; type_metadata_storage_1.default.addIndexMetadata(target.constructor, propKey, optionsCopy); }; }