From dec7334bfe3a078e1543e450858306212db69c7b Mon Sep 17 00:00:00 2001 From: Gregor Martynus Date: Sun, 2 Feb 2020 17:13:51 -0800 Subject: [PATCH] fix: do not throw if using deprecated Octokit default export without options --- index.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/index.js b/index.js index 6359ced7..ae98ff2f 100644 --- a/index.js +++ b/index.js @@ -21,7 +21,9 @@ const OctokitRest = Octokit.plugin(CORE_PLUGINS); function DeprecatedOctokit(options) { /* istanbul ignore next */ const warn = - options.log && options.log.warn ? options.log.warn : console.warn; + options && options.log && options.log.warn + ? options.log.warn + : console.warn; warn( '[@octokit/rest] `const Octokit = require("@octokit/rest")` is deprecated. Use `const { Octokit } = require("@octokit/rest")` instead' );