hooks.js
function nextPostHook(res) {
                    response = checkResponse(res, response);

                    if (currentPost + 1 < totalPost && self.__hooksEnabled !== false) {
                        currentPost += 1;

                        // Reference to current post hook
                        const currPost = posts[currentPost];
                        const hookMethod = currPost.displayName || currPost.name;
                        scope = getScope(self, name, res, hookMethod, 'post');

                        // Recursively call all the "post" hooks
                        return currPost.call(scope, response).then(nextPostHook, postHookErrorHandler);
                    }

                    /**
                     * All "post" hook process done.
                     * If the response has an "__override" property it will be our response
                     */
                    if (is.object(response) && {}.hasOwnProperty.call(response, '__override')) {
                        response = response.__override;
                    }

                    return resolveFn(response);
                }
function nextPostHook(res) {
                    response = checkResponse(res, response);

                    if (currentPost + 1 < totalPost && self.__hooksEnabled !== false) {
                        currentPost += 1;

                        // Reference to current post hook
                        const currPost = posts[currentPost];
                        const hookMethod = currPost.displayName || currPost.name;
                        scope = getScope(self, name, res, hookMethod, 'post');

                        // Recursively call all the "post" hooks
                        return currPost.call(scope, response).then(nextPostHook, postHookErrorHandler);
                    }

                    /**
                     * All "post" hook process done.
                     * If the response has an "__override" property it will be our response
                     */
                    if (is.object(response) && {}.hasOwnProperty.call(response, '__override')) {
                        response = response.__override;
                    }

                    return resolveFn(response);
                }
function nextPostHook ( res ) { response = checkResponse ( res , response ) ; if ( currentPost + 1 < totalPost && self . __hooksEnabled !== false ) { currentPost += 1 ; // Reference to current post hook const currPost = posts [ currentPost ] ; const hookMethod = currPost . displayName || currPost . name ; scope = getScope ( self , name , res , hookMethod , 'post' ) ; // Recursively call all the "post" hooks return currPost . call ( scope , response ) . then ( nextPostHook , postHookErrorHandler ) ; } /**
                     * All "post" hook process done.
                     * If the response has an "__override" property it will be our response
                     */ if ( is . object ( response ) && { } . hasOwnProperty . call ( response , '__override' ) ) { response = response . __override ; } return resolveFn ( response ) ; }
"post" hook handler
@param {*} res the response coming from the target method
or the reponse from any "post" hook
post hook handler