Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/MHSanaei/3x-ui.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHo3ein <ho3ein.sanaei@gmail.com>2023-12-10 17:42:52 +0300
committerGitHub <noreply@github.com>2023-12-10 17:42:52 +0300
commite3f1d3c892a1af48f27fdc36f273a55f38d13b40 (patch)
treeb11d0c1ed3c15c8f6f891a5e6df8e021d5db8ab6 /web/assets/js/util/utils.js
parent36cf7c0a8fda915b51e75958ce729fd9a61a5c90 (diff)
parent9fbe80f87f950673058f0001b3704251fa8b9243 (diff)
huge changes
Diffstat (limited to 'web/assets/js/util/utils.js')
-rw-r--r--web/assets/js/util/utils.js20
1 files changed, 19 insertions, 1 deletions
diff --git a/web/assets/js/util/utils.js b/web/assets/js/util/utils.js
index 781e13a8..8bab58ec 100644
--- a/web/assets/js/util/utils.js
+++ b/web/assets/js/util/utils.js
@@ -1,3 +1,21 @@
+class Msg {
+ constructor(success, msg, obj) {
+ this.success = false;
+ this.msg = "";
+ this.obj = null;
+
+ if (success != null) {
+ this.success = success;
+ }
+ if (msg != null) {
+ this.msg = msg;
+ }
+ if (obj != null) {
+ this.obj = obj;
+ }
+ }
+}
+
class HttpUtil {
static _handleMsg(msg) {
if (!(msg instanceof Msg)) {
@@ -158,7 +176,7 @@ class ObjectUtil {
}
}
} else {
- return obj.toString().toLowerCase().indexOf(key.toLowerCase()) >= 0;
+ return this.isEmpty(obj) ? false : obj.toString().toLowerCase().indexOf(key.toLowerCase()) >= 0;
}
return false;
}