| 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 | |