Object.defineProperty(exports, "__esModule", { value: true });
const { BasePlugin } = require('../../../BasePlugin');
const shimmer = require("shimmer");

class SimpleModulePlugin extends BasePlugin {
    constructor() {
        super();
        this.moduleName = 'supported-module';
    }

    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 = ['^0.0.1'];
exports.plugin = plugin;
