Fix tests: bug in type equality checking

This commit is contained in:
Aiosa 2024-10-21 12:59:21 +02:00
parent 82e1160508
commit e403e29312

View File

@ -302,7 +302,7 @@
return; return;
} }
//must re-check types since we perform in a queue of conversion requests //must re-check types since we perform in a queue of conversion requests
if (type !== this._type || (Array.isArray(type) && !type.includes(this._type))) { if ((typeof type === "string" && type !== this._type) || (Array.isArray(type) && !type.includes(this._type))) {
//ensures queue gets executed after finish //ensures queue gets executed after finish
this._convert(this._type, type); this._convert(this._type, type);
this._promise.then(data => resolver(data)); this._promise.then(data => resolver(data));
@ -317,7 +317,7 @@
return promise; return promise;
} }
if (type !== this._type || (Array.isArray(type) && !type.includes(this._type))) { if ((typeof type === "string" && type !== this._type) || (Array.isArray(type) && !type.includes(this._type))) {
this._convert(this._type, type); this._convert(this._type, type);
} }
return this._promise; return this._promise;