UNPKG

@methodus/server

Version:
29 lines 1.18 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const excludedProps = ['constructor']; require("reflect-metadata"); const config_1 = require("../config"); const fp_1 = require("../fp"); const correlator = require('correlation-id'); let methodMetadataKey = 'methodus'; let metadataKey = 'params'; function mergeMetadata(methodus) { let config = config_1.MethodusConfigurations.get(); let methodinformation = config.classes.get(methodus.name); return Object.assign({}, methodus, methodinformation); } /** the @MethodMock decorator registers the model with the odm * @param {Verbs} verb - the HTTP verb for the route. * @param {string} route - express route string. * @param {Function[]} middlewares - an array of middlewares to apply to this function} */ function MethodMock(mockedResult) { return (target, propertyKey, descriptor) => { var methodus = fp_1.fp.maybeMethodus(target); methodus._mocks = methodus._mocks || {}; methodus._mocks[propertyKey] = mockedResult; return descriptor; }; } exports.MethodMock = MethodMock; //# sourceMappingURL=method-mock.js.map