Why Gemfury? Push, build, and install  RubyGems npm packages Python packages Maven artifacts PHP packages Go Modules Bower components Debian packages RPM packages NuGet packages

sentry / @nestjs/core   js

Repository URL to install this package:

Version: 7.0.10 

/ helpers / handler-metadata-storage.js

"use strict";
var _a;
Object.defineProperty(exports, "__esModule", { value: true });
const constants_1 = require("../injector/constants");
exports.HANDLER_METADATA_SYMBOL = Symbol.for('handler_metadata:cache');
class HandlerMetadataStorage {
    constructor() {
        this[_a] = new Map();
    }
    set(controller, methodName, metadata) {
        const metadataKey = this.getMetadataKey(controller, methodName);
        this[exports.HANDLER_METADATA_SYMBOL].set(metadataKey, metadata);
    }
    get(controller, methodName) {
        const metadataKey = this.getMetadataKey(controller, methodName);
        return this[exports.HANDLER_METADATA_SYMBOL].get(metadataKey);
    }
    getMetadataKey(controller, methodName) {
        const ctor = controller.constructor;
        const controllerKey = ctor && (ctor[constants_1.CONTROLLER_ID_KEY] || ctor.name);
        return controllerKey + methodName;
    }
}
exports.HandlerMetadataStorage = HandlerMetadataStorage;
_a = exports.HANDLER_METADATA_SYMBOL;