Nodejs String Escape escaped()

Here you can find the source of escaped()

Method Source Code

String.prototype.escaped = function () {
   return this.replace(/&/gim, "&amp;").replace(/</gim, "&lt;").replace(/>/gim, "&gt;").replace(/"/gim, "&quot;").replace(/'/gim, "&#39;");
}

Related

  1. escapeOnce()
    String.prototype.escapeOnce = function () {
      return this.replace(/"/g, '&quot;').replace(/>/g, '&gt;').replace(/</g, '&lt;').replace(/&(?!([a-zA-Z]+|#\d+);)/g, '&amp;');
    };
    
  2. escapeQuotes()
    String.prototype.escapeQuotes = function()
      var m = {"\"": "\\\"", "'": "\\'"};
      return String(this.replace("\\", "\\\\")).replace(/["']/g, function(s)
        return m[s];
      });
    
  3. escapeSecure()
    String.prototype.escapeSecure = function () {
      var returnStr, tmpStr;
      tmpStr = $(this);
      tmpStr.find("script").remove();
      returnStr = tmpStr.html();
      return returnStr;
    };
    
  4. escapeSelector( find )
    String.prototype.escapeSelector = function( find )
      find = new RegExp( '([' + (find || '\[\]:') + '])' );
      return this.replace(find, '\\$1');
    };
    Array.prototype.powerSet = function()
      var i = 1,
          j = 0,
    ...
    
  5. escapeURL()
    String.prototype.escapeURL = function() {
      return escape(this)