Skip to content

Commit

Permalink
added RegExp.escape method
Browse files Browse the repository at this point in the history
  • Loading branch information
AlexKrupko committed Apr 27, 2017
1 parent 11c4ad4 commit db0f220
Show file tree
Hide file tree
Showing 7 changed files with 49 additions and 7 deletions.
12 changes: 11 additions & 1 deletion dist/ExtendedJS.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
* @copyright 2016 Avrora Team www.avrora.team
* @license MIT
* @tutorial http://extendedjs.avrora.team
* @version 1.0.8
* @version 1.0.9
*/

!function () {
Expand Down Expand Up @@ -544,6 +544,16 @@ var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol
return index >= 0;
};

/**
* Escapes special characters in passed string
*
* @param {String} string
* @return {String}
*/
RegExp.escape = function (string) {
return string.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
};

var _ajaxDefaults = {
method: 'GET', // request method
data: {}, // object with request data or FormData
Expand Down
12 changes: 11 additions & 1 deletion dist/ExtendedJS.lite.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
* @copyright 2016 Avrora Team www.avrora.team
* @license MIT
* @tutorial http://extendedjs.avrora.team
* @version 1.0.8.lite
* @version 1.0.9.lite
*/

!function () {
Expand Down Expand Up @@ -500,4 +500,14 @@

return index >= 0;
};

/**
* Escapes special characters in passed string
*
* @param {String} string
* @return {String}
*/
RegExp.escape = function (string) {
return string.replace(/[-[\]{}()*+?.,\\^$|#\s]/g, "\\$&");
};
}();
4 changes: 2 additions & 2 deletions dist/ExtendedJS.lite.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit db0f220

Please sign in to comment.