Replace ko.utils.stringStartsWith with native String.startsWith

This commit is contained in:
djmaze 2021-09-28 13:20:54 +02:00
parent 2d4ce14b1c
commit 7d97ae3145
2 changed files with 1 additions and 8 deletions

View file

@ -89,13 +89,6 @@ ko.utils = {
string.trim() :
string.toString().replace(/^[\s\xa0]+|[\s\xa0]+$/g, ''),
stringStartsWith: (string, startsWith) => {
string = string || "";
if (startsWith.length > string.length)
return false;
return string.substring(0, startsWith.length) === startsWith;
},
domNodeIsContainedBy: (node, containedByNode) =>
containedByNode.contains(node.nodeType !== 1 ? node.parentNode : node),