This commit is contained in:
2020-04-17 19:43:19 +00:00
parent 40be5de9ef
commit 4c06f274ab
2 changed files with 75 additions and 15 deletions

View File

@@ -147,7 +147,29 @@ export default {
}
return ret;
}, ///////////////////////////////
},
///////////////////////////////
// Splice a string
//changes the content of a string by removing a range of
// characters and/or adding new characters.
//
// @param {String} source string
// @param {number} start Index at which to start changing the string.
// @param {number} delCount An integer indicating the number of old chars to remove.
// @param {string} newSubStr The String that is spliced in.
// @return {string} A new string with the spliced substring.
stringSplice: function(source, start, delCount, newSubStr) {
if (source == null || source == "") {
return "";
}
return (
source.slice(0, start) +
newSubStr +
this.slice(start + Math.abs(delCount))
);
},
///////////////////////////////
// ICON FOR *ALL* OBJECT TYPES
//(used for search results and event log / history)
//NOTE: Any object type could appear in event log, they all need to be supported where possible