nl_tokens: Apply hooks on a message in reduce fashion . Hooks may return a new message . If it s not the case the previous message is used for the next reduce step .
pl_tokens: function reduceHooks ( hooks ) { return msg => { let tmp return hooks . reduce ( ( prev , <mask> ) => { tmp = hook ( prev ) if ( tmp === undefined || tmp === null ) { return prev } return tmp } , msg ) } }