Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions lib/str.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/* eslint-disable no-control-regex */
import _ from 'underscore';
import {AllHtmlEntities} from 'html-entities';
import replaceAll from 'string.prototype.replaceall';
import {CONST} from './CONST';

const Str = {
Expand Down Expand Up @@ -1049,6 +1050,18 @@ const Str = {
isDomainEmail(email) {
return this.startsWith(email, '+@');
},

/**
* Polyfill for String.prototype.replaceAll
*
* @param {String} text
* @param {String|RegExp} searchValue
* @param {String|Function} replaceValue
* @returns {String}
*/
replaceAll(text, searchValue, replaceValue) {
Comment thread
techievivek marked this conversation as resolved.
return replaceAll(text, searchValue, replaceValue);
},
};

export default Str;
Loading