]> git.proxmox.com Git - mirror_xterm.js.git/blobdiff - src/addons/search/search.ts
Prevent webpack error
[mirror_xterm.js.git] / src / addons / search / search.ts
index b049eba7df7a2063c7b7e282d8cb01f825911457..1a9ac33706c4d1b274633250035cd57611f5e87d 100644 (file)
@@ -8,30 +8,30 @@ declare var exports: any;
 declare var module: any;
 declare var define: any;
 declare var require: any;
+declare var window: any;
 
 (function (addon) {
   if ('Terminal' in window) {
-    /*
+    /**
      * Plain browser environment
      */
-    addon((<any>window).Terminal);
+    addon(window.Terminal);
+  } else if (typeof exports === 'object' && typeof module === 'object') {
+    /**
+     * CommonJS environment
+     */
+    module.exports = addon(require('../../xterm'));
   } else if (typeof define == 'function') {
-    /*
+    /**
      * Require.js is available
      */
     define(['../../xterm'], addon);
-  } else if (typeof exports === 'object' && typeof module === 'object') {
-    /*
-     * CommonJS environment
-     */
-    var xterm = '../../xterm'; // Put in a variable do it's not pulled in by browserify
-    module.exports = addon(require(xterm));
   }
 })((Terminal: any) => {
   /**
    * Find the next instance of the term, then scroll to and select it. If it
    * doesn't exist, do nothing.
-   * @param term The term to search for.
+   * @param term Tne search term.
    * @return Whether a result was found.
    */
   Terminal.prototype.findNext = function(term: string): boolean {
@@ -44,7 +44,7 @@ declare var require: any;
   /**
    * Find the previous instance of the term, then scroll to and select it. If it
    * doesn't exist, do nothing.
-   * @param term The term to search for.
+   * @param term Tne search term.
    * @return Whether a result was found.
    */
   Terminal.prototype.findPrevious = function(term: string): boolean {