From b8503e781cfe62c80582ff36ae467435baa35ba1 Mon Sep 17 00:00:00 2001 From: Alex Pletnov Date: Sun, 30 Oct 2016 21:26:08 +0200 Subject: [PATCH] Don't expect encoding-indexes to return object with indexes & don't require them if they are already present (#61) - Resolves #60 * Don't require encoding-indexes if they are already present * Don't expect encoding-indexes to return object with indexes --- lib/encoding.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/encoding.js b/lib/encoding.js index 2ec7414..b5c8904 100644 --- a/lib/encoding.js +++ b/lib/encoding.js @@ -6,9 +6,9 @@ * @fileoverview Global |this| required for resolving indexes in node. * @suppress {globalThis} */ -if (typeof module !== "undefined" && module.exports) { - this["encoding-indexes"] = - require("./encoding-indexes.js")["encoding-indexes"]; +if (typeof module !== "undefined" && module.exports && + !this["encoding-indexes"]) { + require("./encoding-indexes.js"); } (function(global) {