Skip to content

Commit 9310ff4

Browse files
committed
Added ensureEndsWith helper function
1 parent f82e3b6 commit 9310ff4

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

Abp/Framework/scripts/abp.js

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -655,6 +655,19 @@
655655
return str.substr(0, maxLength - postfix.length) + postfix;
656656
};
657657

658+
abp.utils.ensureEndsWith = function (str, c) {
659+
if (!str) {
660+
return str;
661+
}
662+
663+
if (str.endsWith(c))
664+
{
665+
return str;
666+
}
667+
668+
return str + c;
669+
};
670+
658671
abp.utils.isFunction = function (obj) {
659672
if ($) {
660673
//Prefer to use jQuery if possible

0 commit comments

Comments
 (0)