diff --git a/HISTORY.md b/HISTORY.md index ac31c736..9beda147 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -7,6 +7,7 @@ unreleased * deps: depd@~2.0.0 - Replace internal `eval` usage with `Function` constructor - Use instance methods on `process` to check for listeners + * refactored deprecation message for `default` format to fix issue when using `esm` module 1.9.1 / 2018-09-10 ================== diff --git a/index.js b/index.js index 4680eaec..10269cc3 100644 --- a/index.js +++ b/index.js @@ -161,8 +161,8 @@ morgan.format('common', ':remote-addr - :remote-user [:date[clf]] ":method :url * Default format. */ +// @deprecated morgan.format('default', ':remote-addr - :remote-user [:date] ":method :url HTTP/:http-version" :status :res[content-length] ":referrer" ":user-agent"') -deprecate.property(morgan, 'default', 'default format: use combined format') /** * Short format. @@ -445,6 +445,10 @@ function format (name, fmt) { */ function getFormatFunction (name) { + if (name === 'default') { + deprecate('default format: use combined format') + } + // lookup format var fmt = morgan[name] || name || morgan.default diff --git a/package.json b/package.json index 7775fe66..86aa0f1b 100644 --- a/package.json +++ b/package.json @@ -22,7 +22,7 @@ "on-headers": "~1.0.1" }, "devDependencies": { - "eslint": "5.9.0", + "eslint": "5.10.0", "eslint-config-standard": "12.0.0", "eslint-plugin-import": "2.14.0", "eslint-plugin-markdown": "1.0.0-rc.0",