| 
									
										
										
										
											2014-12-26 18:54:20 -05:00
										 |  |  | 'use strict'; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-03-11 21:44:37 -05:00
										 |  |  | const util = require('util'); | 
					
						
							| 
									
										
										
										
											2019-06-10 19:05:27 +03:00
										 |  |  | const winston = require('winston'); | 
					
						
							| 
									
										
										
										
											2020-11-20 16:06:26 -05:00
										 |  |  | const plugins = require('.'); | 
					
						
							| 
									
										
										
										
											2021-03-13 10:12:30 -05:00
										 |  |  | const utils = require('../utils'); | 
					
						
							| 
									
										
										
										
											2014-12-26 18:54:20 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-01-27 17:36:58 -05:00
										 |  |  | const Hooks = module.exports; | 
					
						
							| 
									
										
										
										
											2016-07-27 22:17:02 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-20 16:06:26 -05:00
										 |  |  | Hooks.deprecatedHooks = { | 
					
						
							| 
									
										
										
										
											2021-11-18 16:42:18 -05:00
										 |  |  | 	'filter:email.send': 'static:email.send', // 👋 @ 1.19.0
 | 
					
						
							|  |  |  | 	'filter:router.page': 'response:router.page', // 👋 @ 2.0.0
 | 
					
						
							| 
									
										
										
										
											2020-11-20 16:06:26 -05:00
										 |  |  | }; | 
					
						
							| 
									
										
										
										
											2020-10-01 09:45:27 -06:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-20 16:06:26 -05:00
										 |  |  | Hooks.internals = { | 
					
						
							|  |  |  | 	_register: function (data) { | 
					
						
							|  |  |  | 		plugins.loadedHooks[data.hook] = plugins.loadedHooks[data.hook] || []; | 
					
						
							|  |  |  | 		plugins.loadedHooks[data.hook].push(data); | 
					
						
							|  |  |  | 	}, | 
					
						
							|  |  |  | }; | 
					
						
							| 
									
										
										
										
											2015-08-25 17:48:18 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-20 16:06:26 -05:00
										 |  |  | const hookTypeToMethod = { | 
					
						
							|  |  |  | 	filter: fireFilterHook, | 
					
						
							|  |  |  | 	action: fireActionHook, | 
					
						
							|  |  |  | 	static: fireStaticHook, | 
					
						
							|  |  |  | 	response: fireResponseHook, | 
					
						
							|  |  |  | }; | 
					
						
							| 
									
										
										
										
											2014-12-26 18:54:20 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-20 16:06:26 -05:00
										 |  |  | /* | 
					
						
							|  |  |  | 	`data` is an object consisting of (* is required): | 
					
						
							|  |  |  | 		`data.hook`*, the name of the NodeBB hook | 
					
						
							|  |  |  | 		`data.method`*, the method called in that plugin (can be an array of functions) | 
					
						
							|  |  |  | 		`data.priority`, the relative priority of the method when it is eventually called (default: 10) | 
					
						
							|  |  |  | */ | 
					
						
							|  |  |  | Hooks.register = function (id, data) { | 
					
						
							|  |  |  | 	if (!data.hook || !data.method) { | 
					
						
							| 
									
										
										
										
											2021-02-03 23:59:08 -07:00
										 |  |  | 		winston.warn(`[plugins/${id}] registerHook called with invalid data.hook/method`, data); | 
					
						
							| 
									
										
										
										
											2020-11-20 16:06:26 -05:00
										 |  |  | 		return; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	// `hasOwnProperty` needed for hooks with no alternative (set to null)
 | 
					
						
							|  |  |  | 	if (Hooks.deprecatedHooks.hasOwnProperty(data.hook)) { | 
					
						
							|  |  |  | 		const deprecated = Hooks.deprecatedHooks[data.hook]; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		if (deprecated) { | 
					
						
							|  |  |  | 			winston.warn(`[plugins/${id}] Hook "${data.hook}" is deprecated, please use "${deprecated}" instead.`); | 
					
						
							| 
									
										
										
										
											2019-07-22 00:30:47 -04:00
										 |  |  | 		} else { | 
					
						
							| 
									
										
										
										
											2020-11-20 16:06:26 -05:00
										 |  |  | 			winston.warn(`[plugins/${id}] Hook "${data.hook}" is deprecated, there is no alternative.`); | 
					
						
							| 
									
										
										
										
											2014-12-26 18:54:20 -05:00
										 |  |  | 		} | 
					
						
							| 
									
										
										
										
											2020-11-20 16:06:26 -05:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2014-12-26 18:54:20 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-20 16:06:26 -05:00
										 |  |  | 	data.id = id; | 
					
						
							|  |  |  | 	if (!data.priority) { | 
					
						
							|  |  |  | 		data.priority = 10; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	if (Array.isArray(data.method) && data.method.every(method => typeof method === 'function' || typeof method === 'string')) { | 
					
						
							|  |  |  | 		// Go go gadget recursion!
 | 
					
						
							| 
									
										
										
										
											2021-02-04 00:01:39 -07:00
										 |  |  | 		data.method.forEach((method) => { | 
					
						
							| 
									
										
										
										
											2020-11-20 16:06:26 -05:00
										 |  |  | 			const singularData = { ...data, method: method }; | 
					
						
							|  |  |  | 			Hooks.register(id, singularData); | 
					
						
							| 
									
										
										
										
											2017-02-28 16:42:10 +03:00
										 |  |  | 		}); | 
					
						
							| 
									
										
										
										
											2020-11-20 16:06:26 -05:00
										 |  |  | 	} else if (typeof data.method === 'string' && data.method.length > 0) { | 
					
						
							| 
									
										
										
										
											2021-02-04 00:01:39 -07:00
										 |  |  | 		const method = data.method.split('.').reduce((memo, prop) => { | 
					
						
							| 
									
										
										
										
											2020-11-20 16:06:26 -05:00
										 |  |  | 			if (memo && memo[prop]) { | 
					
						
							|  |  |  | 				return memo[prop]; | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 			// Couldn't find method by path, aborting
 | 
					
						
							|  |  |  | 			return null; | 
					
						
							|  |  |  | 		}, plugins.libraries[data.id]); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		// Write the actual method reference to the hookObj
 | 
					
						
							|  |  |  | 		data.method = method; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 		Hooks.internals._register(data); | 
					
						
							|  |  |  | 	} else if (typeof data.method === 'function') { | 
					
						
							|  |  |  | 		Hooks.internals._register(data); | 
					
						
							|  |  |  | 	} else { | 
					
						
							| 
									
										
										
										
											2021-02-03 23:59:08 -07:00
										 |  |  | 		winston.warn(`[plugins/${id}] Hook method mismatch: ${data.hook} => ${data.method}`); | 
					
						
							| 
									
										
										
										
											2020-11-20 16:06:26 -05:00
										 |  |  | 	} | 
					
						
							|  |  |  | }; | 
					
						
							| 
									
										
										
										
											2017-02-28 16:42:10 +03:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-20 16:06:26 -05:00
										 |  |  | Hooks.unregister = function (id, hook, method) { | 
					
						
							| 
									
										
										
										
											2021-02-04 00:06:15 -07:00
										 |  |  | 	const hooks = plugins.loadedHooks[hook] || []; | 
					
						
							| 
									
										
										
										
											2021-02-04 00:01:39 -07:00
										 |  |  | 	plugins.loadedHooks[hook] = hooks.filter(hookData => hookData && hookData.id !== id && hookData.method !== method); | 
					
						
							| 
									
										
										
										
											2020-11-20 16:06:26 -05:00
										 |  |  | }; | 
					
						
							| 
									
										
										
										
											2019-07-22 00:30:47 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-20 16:06:26 -05:00
										 |  |  | Hooks.fire = async function (hook, params) { | 
					
						
							|  |  |  | 	const hookList = plugins.loadedHooks[hook]; | 
					
						
							|  |  |  | 	const hookType = hook.split(':')[0]; | 
					
						
							| 
									
										
										
										
											2021-03-10 21:43:37 -05:00
										 |  |  | 	if (global.env === 'development' && hook !== 'action:plugins.firehook' && hook !== 'filter:plugins.firehook') { | 
					
						
							| 
									
										
										
										
											2021-02-03 23:59:08 -07:00
										 |  |  | 		winston.verbose(`[plugins/fireHook] ${hook}`); | 
					
						
							| 
									
										
										
										
											2020-11-20 16:06:26 -05:00
										 |  |  | 	} | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 	if (!hookTypeToMethod[hookType]) { | 
					
						
							| 
									
										
										
										
											2021-02-03 23:59:08 -07:00
										 |  |  | 		winston.warn(`[plugins] Unknown hookType: ${hookType}, hook : ${hook}`); | 
					
						
							| 
									
										
										
										
											2020-11-20 16:06:26 -05:00
										 |  |  | 		return; | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2021-09-21 13:48:16 -04:00
										 |  |  | 	let deleteCaller = false; | 
					
						
							| 
									
										
										
										
											2021-08-30 10:23:38 -04:00
										 |  |  | 	if (params && typeof params === 'object' && !params.hasOwnProperty('caller')) { | 
					
						
							|  |  |  | 		const als = require('../als'); | 
					
						
							|  |  |  | 		params.caller = als.getStore(); | 
					
						
							| 
									
										
										
										
											2021-09-21 13:48:16 -04:00
										 |  |  | 		deleteCaller = true; | 
					
						
							| 
									
										
										
										
											2021-08-30 10:23:38 -04:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2020-11-20 16:06:26 -05:00
										 |  |  | 	const result = await hookTypeToMethod[hookType](hook, hookList, params); | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-03-10 21:43:37 -05:00
										 |  |  | 	if (hook !== 'action:plugins.firehook' && hook !== 'filter:plugins.firehook') { | 
					
						
							|  |  |  | 		const payload = await Hooks.fire('filter:plugins.firehook', { hook: hook, params: result || params }); | 
					
						
							|  |  |  | 		Hooks.fire('action:plugins.firehook', payload); | 
					
						
							| 
									
										
										
										
											2020-11-20 16:06:26 -05:00
										 |  |  | 	} | 
					
						
							|  |  |  | 	if (result !== undefined) { | 
					
						
							| 
									
										
										
										
											2021-09-21 13:51:24 -04:00
										 |  |  | 		if (deleteCaller && result && result.caller) { | 
					
						
							| 
									
										
										
										
											2021-09-21 13:48:16 -04:00
										 |  |  | 			delete result.caller; | 
					
						
							|  |  |  | 		} | 
					
						
							| 
									
										
										
										
											2020-11-20 16:06:26 -05:00
										 |  |  | 		return result; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | Hooks.hasListeners = function (hook) { | 
					
						
							|  |  |  | 	return !!(plugins.loadedHooks[hook] && plugins.loadedHooks[hook].length > 0); | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | async function fireFilterHook(hook, hookList, params) { | 
					
						
							|  |  |  | 	if (!Array.isArray(hookList) || !hookList.length) { | 
					
						
							|  |  |  | 		return params; | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2021-03-13 12:03:06 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | 	async function fireMethod(hookObj, params) { | 
					
						
							| 
									
										
										
										
											2020-11-20 16:06:26 -05:00
										 |  |  | 		if (typeof hookObj.method !== 'function') { | 
					
						
							|  |  |  | 			if (global.env === 'development') { | 
					
						
							| 
									
										
										
										
											2021-02-03 23:59:08 -07:00
										 |  |  | 				winston.warn(`[plugins] Expected method for hook '${hook}' in plugin '${hookObj.id}' not found, skipping.`); | 
					
						
							| 
									
										
										
										
											2020-11-20 16:06:26 -05:00
										 |  |  | 			} | 
					
						
							| 
									
										
										
										
											2021-03-13 12:03:06 -05:00
										 |  |  | 			return params; | 
					
						
							| 
									
										
										
										
											2019-07-22 00:30:47 -04:00
										 |  |  | 		} | 
					
						
							| 
									
										
										
										
											2021-03-13 12:03:06 -05:00
										 |  |  | 
 | 
					
						
							|  |  |  | 		if (hookObj.method.constructor && hookObj.method.constructor.name === 'AsyncFunction') { | 
					
						
							|  |  |  | 			return await hookObj.method(params); | 
					
						
							| 
									
										
										
										
											2021-03-13 10:12:30 -05:00
										 |  |  | 		} | 
					
						
							| 
									
										
										
										
											2021-03-13 12:03:06 -05:00
										 |  |  | 		return new Promise((resolve, reject) => { | 
					
						
							| 
									
										
										
										
											2021-04-29 10:47:23 -04:00
										 |  |  | 			let resolved = false; | 
					
						
							|  |  |  | 			function _resolve(result) { | 
					
						
							|  |  |  | 				if (resolved) { | 
					
						
							|  |  |  | 					winston.warn(`[plugins] ${hook} already resolved in plugin ${hookObj.id}`); | 
					
						
							|  |  |  | 					return; | 
					
						
							|  |  |  | 				} | 
					
						
							|  |  |  | 				resolved = true; | 
					
						
							|  |  |  | 				resolve(result); | 
					
						
							|  |  |  | 			} | 
					
						
							| 
									
										
										
										
											2021-03-13 12:03:06 -05:00
										 |  |  | 			const returned = hookObj.method(params, (err, result) => { | 
					
						
							| 
									
										
										
										
											2021-04-29 10:47:23 -04:00
										 |  |  | 				if (err) reject(err); else _resolve(result); | 
					
						
							| 
									
										
										
										
											2021-03-13 12:03:06 -05:00
										 |  |  | 			}); | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | 			if (utils.isPromise(returned)) { | 
					
						
							|  |  |  | 				returned.then( | 
					
						
							| 
									
										
										
										
											2021-04-29 10:47:23 -04:00
										 |  |  | 					payload => _resolve(payload), | 
					
						
							| 
									
										
										
										
											2021-03-13 12:03:06 -05:00
										 |  |  | 					err => reject(err) | 
					
						
							|  |  |  | 				); | 
					
						
							| 
									
										
										
										
											2021-04-28 15:00:43 -04:00
										 |  |  | 				return; | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 			if (returned) { | 
					
						
							| 
									
										
										
										
											2021-04-29 10:47:23 -04:00
										 |  |  | 				_resolve(returned); | 
					
						
							| 
									
										
										
										
											2021-03-13 12:03:06 -05:00
										 |  |  | 			} | 
					
						
							|  |  |  | 		}); | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2021-04-28 15:00:43 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-03-13 12:03:06 -05:00
										 |  |  | 	for (const hookObj of hookList) { | 
					
						
							|  |  |  | 		// eslint-disable-next-line
 | 
					
						
							|  |  |  | 		params = await fireMethod(hookObj, params); | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	return params; | 
					
						
							| 
									
										
										
										
											2020-11-20 16:06:26 -05:00
										 |  |  | } | 
					
						
							|  |  |  | 
 | 
					
						
							|  |  |  | async function fireActionHook(hook, hookList, params) { | 
					
						
							|  |  |  | 	if (!Array.isArray(hookList) || !hookList.length) { | 
					
						
							|  |  |  | 		return; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	for (const hookObj of hookList) { | 
					
						
							|  |  |  | 		if (typeof hookObj.method !== 'function') { | 
					
						
							|  |  |  | 			if (global.env === 'development') { | 
					
						
							| 
									
										
										
										
											2021-02-03 23:59:08 -07:00
										 |  |  | 				winston.warn(`[plugins] Expected method for hook '${hook}' in plugin '${hookObj.id}' not found, skipping.`); | 
					
						
							| 
									
										
										
										
											2020-11-20 16:06:26 -05:00
										 |  |  | 			} | 
					
						
							|  |  |  | 		} else { | 
					
						
							| 
									
										
										
										
											2021-03-11 21:44:37 -05:00
										 |  |  | 			// eslint-disable-next-line
 | 
					
						
							| 
									
										
										
										
											2020-11-20 16:06:26 -05:00
										 |  |  | 			await hookObj.method(params); | 
					
						
							| 
									
										
										
										
											2014-12-26 18:54:20 -05:00
										 |  |  | 		} | 
					
						
							| 
									
										
										
										
											2020-11-20 16:06:26 -05:00
										 |  |  | 	} | 
					
						
							|  |  |  | } | 
					
						
							| 
									
										
										
										
											2014-12-26 18:54:20 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-20 16:06:26 -05:00
										 |  |  | async function fireStaticHook(hook, hookList, params) { | 
					
						
							|  |  |  | 	if (!Array.isArray(hookList) || !hookList.length) { | 
					
						
							|  |  |  | 		return; | 
					
						
							|  |  |  | 	} | 
					
						
							|  |  |  | 	// don't bubble errors from these hooks, so bad plugins don't stop startup
 | 
					
						
							|  |  |  | 	const noErrorHooks = ['static:app.load', 'static:assets.prepare', 'static:app.preload']; | 
					
						
							| 
									
										
										
										
											2015-04-28 15:09:17 -04:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-03-11 21:44:37 -05:00
										 |  |  | 	for (const hookObj of hookList) { | 
					
						
							|  |  |  | 		if (typeof hookObj.method !== 'function') { | 
					
						
							|  |  |  | 			if (global.env === 'development') { | 
					
						
							|  |  |  | 				winston.warn(`[plugins] Expected method for hook '${hook}' in plugin '${hookObj.id}' not found, skipping.`); | 
					
						
							| 
									
										
										
										
											2020-11-20 16:06:26 -05:00
										 |  |  | 			} | 
					
						
							| 
									
										
										
										
											2021-03-11 21:44:37 -05:00
										 |  |  | 		} else { | 
					
						
							|  |  |  | 			let hookFn = hookObj.method; | 
					
						
							|  |  |  | 			if (hookFn.constructor && hookFn.constructor.name !== 'AsyncFunction') { | 
					
						
							|  |  |  | 				hookFn = util.promisify(hookFn); | 
					
						
							| 
									
										
										
										
											2014-12-26 18:54:20 -05:00
										 |  |  | 			} | 
					
						
							| 
									
										
										
										
											2021-03-11 22:56:14 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-03-11 21:44:37 -05:00
										 |  |  | 			try { | 
					
						
							|  |  |  | 				// eslint-disable-next-line
 | 
					
						
							| 
									
										
										
										
											2021-03-11 22:56:14 -05:00
										 |  |  | 				await timeout(hookFn(params), 5000, 'timeout'); | 
					
						
							| 
									
										
										
										
											2021-03-11 21:44:37 -05:00
										 |  |  | 			} catch (err) { | 
					
						
							| 
									
										
										
										
											2021-03-11 22:56:14 -05:00
										 |  |  | 				if (err && err.message === 'timeout') { | 
					
						
							|  |  |  | 					winston.warn(`[plugins] Callback timed out, hook '${hook}' in plugin '${hookObj.id}'`); | 
					
						
							|  |  |  | 				} else { | 
					
						
							|  |  |  | 					winston.error(`[plugins] Error executing '${hook}' in plugin '${hookObj.id}'\n${err.stack}`); | 
					
						
							|  |  |  | 					if (!noErrorHooks.includes(hook)) { | 
					
						
							|  |  |  | 						throw err; | 
					
						
							|  |  |  | 					} | 
					
						
							| 
									
										
										
										
											2021-03-11 21:44:37 -05:00
										 |  |  | 				} | 
					
						
							| 
									
										
										
										
											2019-06-10 19:05:27 +03:00
										 |  |  | 			} | 
					
						
							| 
									
										
										
										
											2019-10-10 22:03:41 -04:00
										 |  |  | 		} | 
					
						
							| 
									
										
										
										
											2021-03-11 21:44:37 -05:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2020-11-20 16:06:26 -05:00
										 |  |  | } | 
					
						
							| 
									
										
										
										
											2014-12-26 18:54:20 -05:00
										 |  |  | 
 | 
					
						
							| 
									
										
										
										
											2021-03-11 22:56:14 -05:00
										 |  |  | // https://advancedweb.hu/how-to-add-timeout-to-a-promise-in-javascript/
 | 
					
						
							|  |  |  | const timeout = (prom, time, error) => { | 
					
						
							|  |  |  | 	let timer; | 
					
						
							|  |  |  | 	return Promise.race([ | 
					
						
							|  |  |  | 		prom, | 
					
						
							|  |  |  | 		new Promise((resolve, reject) => { | 
					
						
							|  |  |  | 			timer = setTimeout(reject, time, new Error(error)); | 
					
						
							|  |  |  | 		}), | 
					
						
							|  |  |  | 	]).finally(() => clearTimeout(timer)); | 
					
						
							|  |  |  | }; | 
					
						
							|  |  |  | 
 | 
					
						
							| 
									
										
										
										
											2020-11-20 16:06:26 -05:00
										 |  |  | async function fireResponseHook(hook, hookList, params) { | 
					
						
							|  |  |  | 	if (!Array.isArray(hookList) || !hookList.length) { | 
					
						
							|  |  |  | 		return; | 
					
						
							|  |  |  | 	} | 
					
						
							| 
									
										
										
										
											2021-03-11 21:44:37 -05:00
										 |  |  | 	for (const hookObj of hookList) { | 
					
						
							| 
									
										
										
										
											2020-11-20 16:06:26 -05:00
										 |  |  | 		if (typeof hookObj.method !== 'function') { | 
					
						
							|  |  |  | 			if (global.env === 'development') { | 
					
						
							| 
									
										
										
										
											2021-02-03 23:59:08 -07:00
										 |  |  | 				winston.warn(`[plugins] Expected method for hook '${hook}' in plugin '${hookObj.id}' not found, skipping.`); | 
					
						
							| 
									
										
										
										
											2020-11-20 16:06:26 -05:00
										 |  |  | 			} | 
					
						
							| 
									
										
										
										
											2021-03-11 21:44:37 -05:00
										 |  |  | 		} else { | 
					
						
							|  |  |  | 			// Skip remaining hooks if headers have been sent
 | 
					
						
							|  |  |  | 			if (params.res.headersSent) { | 
					
						
							|  |  |  | 				return; | 
					
						
							|  |  |  | 			} | 
					
						
							|  |  |  | 			// eslint-disable-next-line
 | 
					
						
							|  |  |  | 			await hookObj.method(params); | 
					
						
							| 
									
										
										
										
											2019-01-19 14:49:22 -05:00
										 |  |  | 		} | 
					
						
							| 
									
										
										
										
											2021-03-11 21:44:37 -05:00
										 |  |  | 	} | 
					
						
							| 
									
										
										
										
											2020-11-20 16:06:26 -05:00
										 |  |  | } |