2023-11-20 00:48:40 +03:00
|
|
|
export const StringExtensions = () => {
|
|
|
|
if ("".isEmpty === undefined) {
|
|
|
|
// eslint-disable-next-line no-extend-native
|
|
|
|
String.prototype.isEmpty = function () {
|
|
|
|
return this.length === 0;
|
|
|
|
};
|
|
|
|
}
|
|
|
|
if ("".isNotEmpty === undefined) {
|
|
|
|
// eslint-disable-next-line no-extend-native
|
|
|
|
String.prototype.isNotEmpty = function () {
|
|
|
|
return this.length !== 0;
|
|
|
|
};
|
|
|
|
}
|
2023-11-28 18:34:41 +03:00
|
|
|
if ("".lastElement === undefined) {
|
|
|
|
String.prototype.lastElement = function () {
|
|
|
|
return this[this.length - 1];
|
|
|
|
};
|
|
|
|
}
|
2023-11-20 00:48:40 +03:00
|
|
|
};
|