From ccce516b49a282bb930f9fc9dbf938090950c451 Mon Sep 17 00:00:00 2001 From: Tom MacWright Date: Thu, 1 Mar 2018 22:19:53 -0800 Subject: [PATCH] feat: documentation.js now requires node v6 or newer. (#1034) BREAKING CHANGE: documentation.js requires node v6 or newer. --- .babelrc | 2 +- __tests__/lib/infer/kind.js | 2 +- package.json | 2 +- src/serve/server.js | 2 +- yarn.lock | 6 +++--- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/.babelrc b/.babelrc index d4ef2f468..8edf363c5 100644 --- a/.babelrc +++ b/.babelrc @@ -2,7 +2,7 @@ "presets": [ ["env", { "targets": { - "node": 4 + "node": 6 }, "include": ["transform-regenerator"] }], diff --git a/__tests__/lib/infer/kind.js b/__tests__/lib/infer/kind.js index da7707dce..854bfc953 100644 --- a/__tests__/lib/infer/kind.js +++ b/__tests__/lib/infer/kind.js @@ -56,7 +56,7 @@ test('inferKind', function() { foo(); }) ).kind - ).toBe('function'); + ).toBe('constant'); expect( inferKind(toComment('/** Exported interface */' + 'interface myinter {}')) diff --git a/package.json b/package.json index 005fb189f..6ccb74420 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,7 @@ "lodash": "^4.17.4", "mdast-util-inject": "^1.1.0", "micromatch": "^3.1.5", - "mime": "^1.4.1", + "mime": "^2.2.0", "module-deps-sortable": "4.0.6", "parse-filepath": "^1.0.2", "pify": "^3.0.0", diff --git a/src/serve/server.js b/src/serve/server.js index b7a5fe7eb..950110748 100644 --- a/src/serve/server.js +++ b/src/serve/server.js @@ -75,7 +75,7 @@ class Server extends EventEmitter { const file = this._files[i]; const filePath = file.relative.split(sep).join('/'); if (filePath === path) { - response.writeHead(200, { 'Content-Type': mime.lookup(path) }); + response.writeHead(200, { 'Content-Type': mime.getType(path) }); response.end(file.contents); return; } diff --git a/yarn.lock b/yarn.lock index fd525d13f..a1873dbac 100644 --- a/yarn.lock +++ b/yarn.lock @@ -4395,9 +4395,9 @@ mime-types@~2.1.17: dependencies: mime-db "~1.30.0" -mime@^1.4.1: - version "1.6.0" - resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" +mime@^2.2.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-2.2.0.tgz#161e541965551d3b549fa1114391e3a3d55b923b" mimic-fn@^1.0.0: version "1.1.0"