Version 1
[yaffs-website] / node_modules / underscore.string / replaceAll.js
diff --git a/node_modules/underscore.string/replaceAll.js b/node_modules/underscore.string/replaceAll.js
new file mode 100644 (file)
index 0000000..93f6c0d
--- /dev/null
@@ -0,0 +1,8 @@
+var makeString = require('./helper/makeString');
+
+module.exports = function replaceAll(str, find, replace, ignorecase) {
+  var flags = (ignorecase === true)?'gi':'g';
+  var reg = new RegExp(find, flags);
+
+  return makeString(str).replace(reg, replace);
+};