@capillarytech/creatives-library 7.10.6 → 7.10.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -41,5 +41,21 @@ const isLabelsUsed = (content = '') => {
|
|
|
41
41
|
return !!tags.length;
|
|
42
42
|
};
|
|
43
43
|
|
|
44
|
+
/**
|
|
45
|
+
* If replaceAll() String method is unsupported in Browsers
|
|
46
|
+
*/
|
|
47
|
+
if(!String.prototype.replaceAll){
|
|
48
|
+
/**
|
|
49
|
+
*
|
|
50
|
+
* @param {String} search
|
|
51
|
+
* @param {String} replacement
|
|
52
|
+
* @returns {String} a string replacing all occurances of 'search' with 'replacement'
|
|
53
|
+
*/
|
|
54
|
+
String.prototype.replaceAll = function(search,replacement){
|
|
55
|
+
var str = this.valueOf();
|
|
56
|
+
const regularExp = new RegExp(search, 'g');
|
|
57
|
+
return str.replace(regularExp, replacement);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
44
60
|
|
|
45
61
|
export default creativeDetails;
|