UNPKG

@enonic/mock-xp

Version:

Mock Enonic XP API JavaScript Library

22 lines (21 loc) 646 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.LibContext = void 0; var LibContext = (function () { function LibContext(_a) { var server = _a.server; this.server = server; } LibContext.prototype.get = function () { return this.server.context.get(); }; LibContext.prototype.run = function (context, callback) { var serverContext = this.server.context; this.server.setContext(context); var res = callback(); this.server.context = serverContext; return res; }; return LibContext; }()); exports.LibContext = LibContext;