mirror of
https://github.com/MrUnknownDE/VRCX.git
synced 2026-05-07 06:56:04 +02:00
using isObject() instead of typeof
This commit is contained in:
+8
-7
@@ -305,7 +305,7 @@ if (window.CefSharp) {
|
|||||||
text: escapeTag(json.success.message)
|
text: escapeTag(json.success.message)
|
||||||
}).show();
|
}).show();
|
||||||
}
|
}
|
||||||
} else if (typeof json.error === 'object') {
|
} else if (isObject(json.error)) {
|
||||||
this.$throw(
|
this.$throw(
|
||||||
json.error.status_code || res.status,
|
json.error.status_code || res.status,
|
||||||
json.error.message,
|
json.error.message,
|
||||||
@@ -909,7 +909,7 @@ if (window.CefSharp) {
|
|||||||
if (ctx) {
|
if (ctx) {
|
||||||
var prop = {};
|
var prop = {};
|
||||||
for (var key in ctx) {
|
for (var key in ctx) {
|
||||||
if (typeof ctx[key] !== 'object') {
|
if (isObject(ctx[key]) === false) {
|
||||||
prop[key] = true;
|
prop[key] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -919,7 +919,7 @@ if (window.CefSharp) {
|
|||||||
ctx.location_ = this.parseLocation(ctx.location);
|
ctx.location_ = this.parseLocation(ctx.location);
|
||||||
}
|
}
|
||||||
for (var key in ctx) {
|
for (var key in ctx) {
|
||||||
if (typeof ctx[key] !== 'object') {
|
if (isObject(ctx[key]) === false) {
|
||||||
prop[key] = true;
|
prop[key] = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1665,15 +1665,16 @@ if (window.CefSharp) {
|
|||||||
details: {},
|
details: {},
|
||||||
seen: false,
|
seen: false,
|
||||||
created_at: '',
|
created_at: '',
|
||||||
|
//
|
||||||
...ref
|
...ref
|
||||||
};
|
};
|
||||||
this.notification[ctx.id] = ctx;
|
this.notification[ctx.id] = ctx;
|
||||||
}
|
}
|
||||||
if (typeof ctx.details !== 'object') {
|
if (isObject(ctx.details)) {
|
||||||
var details = {};
|
var details = {};
|
||||||
try {
|
try {
|
||||||
var json = JSON.parse(ctx.details);
|
var json = JSON.parse(ctx.details);
|
||||||
if (typeof json === 'object') {
|
if (isObject(json)) {
|
||||||
details = json;
|
details = json;
|
||||||
}
|
}
|
||||||
} catch (err) {
|
} catch (err) {
|
||||||
@@ -3399,11 +3400,11 @@ if (window.CefSharp) {
|
|||||||
var node = [];
|
var node = [];
|
||||||
for (var key in json) {
|
for (var key in json) {
|
||||||
var value = json[key];
|
var value = json[key];
|
||||||
if (typeof value === 'object') {
|
if (isObject(value)) {
|
||||||
if (Array.isArray(value)) {
|
if (Array.isArray(value)) {
|
||||||
node.push({
|
node.push({
|
||||||
children: value.map((val, idx) => {
|
children: value.map((val, idx) => {
|
||||||
if (typeof val === 'object') {
|
if (isObject(val)) {
|
||||||
return {
|
return {
|
||||||
children: buildTreeData(val),
|
children: buildTreeData(val),
|
||||||
key: idx
|
key: idx
|
||||||
|
|||||||
+1
-1
@@ -255,7 +255,7 @@ if (window.CefSharp) {
|
|||||||
text: escapeTag(json.success.message)
|
text: escapeTag(json.success.message)
|
||||||
}).show();
|
}).show();
|
||||||
}
|
}
|
||||||
} else if (typeof json.error === 'object') {
|
} else if (isObject(json.error)) {
|
||||||
this.$throw(
|
this.$throw(
|
||||||
json.error.status_code || res.status,
|
json.error.status_code || res.status,
|
||||||
json.error.message,
|
json.error.message,
|
||||||
|
|||||||
Reference in New Issue
Block a user