"use strict";

let semver = require("semver");
let winston = require("winston");

let settings = require("./settings");
let eePkg = null;

const EMOJI_EXTENDED = "nodebb-plugin-emoji-extended";
const REQUIRED_VERSION = settings.pkg.peerDependencies[EMOJI_EXTENDED];
const REQUIRED_PACKAGE = "'" + EMOJI_EXTENDED + "@" + REQUIRED_VERSION + "'";

try { eePkg = require(EMOJI_EXTENDED + "/package.json"); } catch (e) {}

if (eePkg == null) {
  winston.error("[plugins/" + settings.id + "] " + REQUIRED_PACKAGE + " not installed.");
} else if (semver.satisfies(eePkg.version, REQUIRED_VERSION)) {
  safeInit();
} else {
  var foundPackage = "'" + EMOJI_EXTENDED + "@" + eePkg.version + "'";
  winston.error("[plugins/" + settings.id + "] " + foundPackage + " found, but " + REQUIRED_PACKAGE + " required.");
}

function safeInit() {
  var setsCtrl = require(EMOJI_EXTENDED + "/lib/sets/controller");

  setsCtrl.register(require("./set/main"), "exodo");
}

@@ -8,19 +8,19 @@
 rict%22;%0A%0A
-let
+var
  semver 
@@ -40,19 +40,19 @@
 mver%22);%0A
-let
+var
  winston
@@ -75,19 +75,19 @@
 ton%22);%0A%0A
-let
+var
  setting
@@ -117,11 +117,11 @@
 %22);%0A
-let
+var
  eeP
@@ -132,21 +132,19 @@
  null;%0A%0A
-const
+var
  EMOJI_E
@@ -185,21 +185,19 @@
 ended%22;%0A
-const
+var
  REQUIRE
@@ -259,13 +259,11 @@
 D%5D;%0A
-const
+var
  REQ

Revert "Update controller.js"