src/middlewares/action-hook.js
function sanitizeHooks(hooks, service) {
	if (_.isString(hooks))
		return service && _.isFunction(service[hooks]) ? service[hooks] : null;

	if (Array.isArray(hooks)) {
		return _.compact(hooks.map(h => {
			if (_.isString(h))
				return service && _.isFunction(service[h]) ? service[h] : null;

			return h;
		}));
	}

	return hooks;
}
function sanitizeHooks(hooks, service) {
	if (_.isString(hooks))
		return service && _.isFunction(service[hooks]) ? service[hooks] : null;

	if (Array.isArray(hooks)) {
		return _.compact(hooks.map(h => {
			if (_.isString(h))
				return service && _.isFunction(service[h]) ? service[h] : null;

			return h;
		}));
	}

	return hooks;
}
function sanitizeHooks ( hooks , service ) { if ( _ . isString ( hooks ) ) return service && _ . isFunction ( service [ hooks ] ) ? service [ hooks ] : null ; if ( Array . isArray ( hooks ) ) { return _ . compact ( hooks . map ( h => { if ( _ . isString ( h ) ) return service && _ . isFunction ( service [ h ] ) ? service [ h ] : null ; return h ; } ) ) ; } return hooks ; }
Sanitize hooks. If the hook is a string, convert it to Service method calling.

@param {Function|String|Array<any>} hooks
@param {Service?} service
@returns
Sanitize hooks . If the hook is a string convert it to Service method calling .