MCPcopy Index your code
hub / github.com/hapijs/hapi / expose

Method expose

lib/server.js:226–248  ·  view source on GitHub ↗
(key, value, options = {})

Source from the content-addressed store, hash-verified

224 }
225
226 expose(key, value, options = {}) {
227
228 Hoek.assert(this.realm.plugin, 'Cannot call expose() outside of a plugin');
229
230 let plugin = this.realm.plugin;
231 if (plugin[0] === '@' &&
232 options.scope !== true) {
233
234 plugin = plugin.replace(/^@([^/]+)\//, ($0, $1) => {
235
236 return !options.scope ? '' : `${$1}__`;
237 });
238 }
239
240 this._core.plugins[plugin] = this._core.plugins[plugin] ?? {};
241
242 if (typeof key === 'string') {
243 this._core.plugins[plugin][key] = value;
244 }
245 else {
246 Hoek.merge(this._core.plugins[plugin], key);
247 }
248 }
249
250 ext(events, method, options) { // (event, method, options) -OR- (events)
251

Callers 3

server.jsFile · 0.80
afterFunction · 0.80
index.tsFile · 0.80

Calls 1

mergeMethod · 0.80

Tested by

no test coverage detected