Object.defineProperty(exports, "__esModule", { value: true });
const core_1 = require("@opentelemetry/core");
const shimmer = require("shimmer");

class SimpleModulePlugin extends core_1.BasePlugin {
    constructor() {
        super();
    }

    patch() {
        shimmer.wrap(this._moduleExports, 'name', orig => () => 'patched-' + orig.apply());
        shimmer.wrap(this._moduleExports, 'value', orig => () => orig.apply() + 1);
        return this._moduleExports;
    }

    unpatch() {
        shimmer.unwrap(this._moduleExports, 'name');
        shimmer.unwrap(this._moduleExports, 'value');
    }
}
exports.SimpleModulePlugin = SimpleModulePlugin;
const plugin = new SimpleModulePlugin();
plugin.supportedVersions = ['1.0.0'];
exports.plugin = plugin;
