From 32dc7495a74ba160871147149deaa1a07ba4baa3 Mon Sep 17 00:00:00 2001 From: Douglas Christopher Wilson Date: Sat, 13 Jun 2015 02:09:54 -0400 Subject: [PATCH] Fix compatibility when token/format not called as method --- index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/index.js b/index.js index 82e0b7e..3ec1d2c 100644 --- a/index.js +++ b/index.js @@ -424,7 +424,7 @@ function createBufferStream(stream, interval) { */ function format(name, fmt) { - this[name] = fmt + morgan[name] = fmt return this } @@ -496,6 +496,6 @@ function recordStartTime() { */ function token(name, fn) { - this[name] = fn + morgan[name] = fn return this }