generate gjs documentation, run under gjs
[gnome.introspection-doc-generator] / String.js
index d30b494..716803a 100755 (executable)
--- a/String.js
+++ b/String.js
@@ -8,16 +8,18 @@
  * Fork - LGPL
  * <script type="text/javascript">
  */
+
 // usage:
 // Seed.include('String.js');
-XObject = imports.XObject.XObject;
+
+const XObject = imports.XObject.XObject;
 
 
-XObject.extend(String, 
+XObject.extend(String,
     {
-    
+
         /** @scope String */
-        
+
         /**
          * Escapes the passed string for ' and \
          * @param {String} string The string to escape
@@ -51,7 +53,8 @@ XObject.extend(String,
             }
             return result;
         },
-         /**
+
+        /**
          * Allows you to define a tokenized string and pass an arbitrary number of arguments to replace the tokens.  Each
          * token must be unique, and must increment in the format {0}, {1}, etc.  Example usage:
          * <pre><code>
@@ -71,7 +74,6 @@ XObject.extend(String,
                 return args[i];
             });
         },
-        
 
         /**
          * Allows you to define a tokenized string and pass an arbitrary number of arguments to replace the tokens.  Each
@@ -93,7 +95,7 @@ XObject.extend(String,
                 return this.htmlEncode(args[i]);
             });
         },
-        
+
         /**
          * Convert certain characters (&, <, >, and ') to their HTML character equivalents for literal display in web pages.
          * @param {String} value The string to encode
@@ -104,8 +106,6 @@ XObject.extend(String,
                 String(value).replace(/&/g, "&amp;"
                     ).replace(/>/g, "&gt;").replace(/</g, "&lt;").replace(/"/g, "&quot;");
         }
-        
-        
     }
 );
 
@@ -125,35 +125,32 @@ XObject.extend(String,
      * @param {String} other The new value to use if the string already equals the first value passed in
      * @return {String} The new value
      */
-     
+
 XObject.extend(String.prototype,  {
-        
+
         toggle : function(value, other){
             return this == value ? other : value;
         },
-        
+
         trim : function (toTrim) {
             var out = this.ltrim(toTrim);
             out = out.rtrim(toTrim);
             return out;
         },
-        
+
         ltrim : function (toTrim) {
             if (this.substr(0, toTrim.length) == toTrim) {
                 return this.slice(toTrim.length);
             }
-            
+
             return this;
         },
-        
+
         rtrim : function (toTrim) {
             if (this.substr(this.length - toTrim.length) == toTrim) {
                 return this.slice(0, this.length - toTrim.length);
             }
-       
+
             return this;
         }
-    
-   
-});
\ No newline at end of file
+});