Skip to content

Commit

Permalink
fix figlet helper
Browse files Browse the repository at this point in the history
figlet use const to define the main entry point,
so we can't use root.figlet
  • Loading branch information
jcubic committed Dec 18, 2024
1 parent f806763 commit 74d09c0
Showing 1 changed file with 2 additions and 16 deletions.
18 changes: 2 additions & 16 deletions js/figlet.js
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -57,7 +43,7 @@
} else {
// Browser
// istanbul ignore next
factory(root.jQuery, root.figlet);
factory(jQuery, figlet);
}
})(function($, figlet) {
if (!$) {
Expand Down

0 comments on commit 74d09c0

Please sign in to comment.