nl_tokens: Prepare message and return as string
pl_tokens: function parse ( messageType , args ) { const options = getOptions ( messageType ) ; /** Interpreter */ if ( typeof options . interpreter === "function" ) { for ( const <mask> in args ) { /** Let string be without additional ' ' */ if ( typeof args [ index ] === "string" ) { continue ; } args [ index ] = options . interpreter ( args [ index ] ) ; } } /** Label */ if ( options . labels ) { args . unshift ( ` ${ messageType . toUpperCase ( ) } ` ) ; } /** Timestamp */ if ( options . timestamp ) { switch ( typeof options . timestamp ) { case "boolean" : args . unshift ( ` ${ new Date ( ) . toLocaleString ( ) } ` ) ; break ; case "string" : args . unshift ( ` ${ moment ( ) . format ( options . timestamp ) } ` ) ; break ; default : throw new Error ( ` ${ typeof options . timestamp } ` ) ; } } return args . join ( " " ) ; }