diff options
author | Anton Luka Šijanec <sijanecantonluka@gmail.com> | 2020-02-08 16:41:06 +0100 |
---|---|---|
committer | Anton Luka Šijanec <sijanecantonluka@gmail.com> | 2020-02-08 16:41:06 +0100 |
commit | f87697e22f289cc96fc4e79da81575115b3e89a2 (patch) | |
tree | 57870d84a853db60c80e254beb423c838d910fbe /node_modules/xss/lib/util.js | |
parent | changed version to 1.0.7-beta (diff) | |
download | beziapp-f87697e22f289cc96fc4e79da81575115b3e89a2.tar beziapp-f87697e22f289cc96fc4e79da81575115b3e89a2.tar.gz beziapp-f87697e22f289cc96fc4e79da81575115b3e89a2.tar.bz2 beziapp-f87697e22f289cc96fc4e79da81575115b3e89a2.tar.lz beziapp-f87697e22f289cc96fc4e79da81575115b3e89a2.tar.xz beziapp-f87697e22f289cc96fc4e79da81575115b3e89a2.tar.zst beziapp-f87697e22f289cc96fc4e79da81575115b3e89a2.zip |
Diffstat (limited to '')
-rw-r--r-- | node_modules/xss/lib/util.js | 34 |
1 files changed, 34 insertions, 0 deletions
diff --git a/node_modules/xss/lib/util.js b/node_modules/xss/lib/util.js new file mode 100644 index 0000000..1dcd7fa --- /dev/null +++ b/node_modules/xss/lib/util.js @@ -0,0 +1,34 @@ +module.exports = { + indexOf: function(arr, item) { + var i, j; + if (Array.prototype.indexOf) { + return arr.indexOf(item); + } + for (i = 0, j = arr.length; i < j; i++) { + if (arr[i] === item) { + return i; + } + } + return -1; + }, + forEach: function(arr, fn, scope) { + var i, j; + if (Array.prototype.forEach) { + return arr.forEach(fn, scope); + } + for (i = 0, j = arr.length; i < j; i++) { + fn.call(scope, arr[i], i, arr); + } + }, + trim: function(str) { + if (String.prototype.trim) { + return str.trim(); + } + return str.replace(/(^\s*)|(\s*$)/g, ""); + }, + spaceIndex: function(str) { + var reg = /\s|\n|\t/; + var match = reg.exec(str); + return match ? match.index : -1; + } +}; |