Skip to content

Commit 605f669

Browse files
committed
fix figlet helper
figlet use const to define the main entry point so we can't use root.figlet
1 parent f806763 commit 605f669

File tree

1 file changed

+2
-16
lines changed

1 file changed

+2
-16
lines changed

js/figlet.js

+2-16
Original file line numberDiff line numberDiff line change
@@ -15,21 +15,7 @@
1515
*/
1616
/* global define */
1717
(function(factory, undefined) {
18-
var root;
19-
if (typeof window !== 'undefined') {
20-
root = window;
21-
} else if (typeof self !== 'undefined') {
22-
root = self;
23-
} else if (typeof global !== 'undefined') {
24-
root = global;
25-
} else {
26-
throw new Error('Unknow context');
27-
}
28-
if (typeof define === 'function' && define.amd) {
29-
// AMD. Register as an anonymous module.
30-
// istanbul ignore next
31-
define(['jquery', 'jquery.terminal', 'figlet'], factory);
32-
} else if (typeof module === 'object' && module.exports) {
18+
if (typeof module === 'object' && module.exports) {
3319
// Node/CommonJS
3420
module.exports = function(root, jQuery) {
3521
if (jQuery === undefined) {
@@ -57,7 +43,7 @@
5743
} else {
5844
// Browser
5945
// istanbul ignore next
60-
factory(root.jQuery, root.figlet);
46+
factory(jQuery, figlet);
6147
}
6248
})(function($, figlet) {
6349
if (!$) {

0 commit comments

Comments
 (0)