From 74d09c0d79d003438ed91bb342638e4145b9fd17 Mon Sep 17 00:00:00 2001 From: Jakub Jankiewicz Date: Wed, 18 Dec 2024 22:49:58 +0100 Subject: [PATCH] fix figlet helper figlet use const to define the main entry point, so we can't use root.figlet --- js/figlet.js | 18 ++---------------- 1 file changed, 2 insertions(+), 16 deletions(-) diff --git a/js/figlet.js b/js/figlet.js index eb750169..8ab3e658 100644 --- a/js/figlet.js +++ b/js/figlet.js @@ -15,21 +15,7 @@ */ /* global define */ (function(factory, undefined) { - var root; - if (typeof window !== 'undefined') { - root = window; - } else if (typeof self !== 'undefined') { - root = self; - } else if (typeof global !== 'undefined') { - root = global; - } else { - throw new Error('Unknow context'); - } - if (typeof define === 'function' && define.amd) { - // AMD. Register as an anonymous module. - // istanbul ignore next - define(['jquery', 'jquery.terminal', 'figlet'], factory); - } else if (typeof module === 'object' && module.exports) { + if (typeof module === 'object' && module.exports) { // Node/CommonJS module.exports = function(root, jQuery) { if (jQuery === undefined) { @@ -57,7 +43,7 @@ } else { // Browser // istanbul ignore next - factory(root.jQuery, root.figlet); + factory(jQuery, figlet); } })(function($, figlet) { if (!$) {