Fixed getLogs filter deserialization (#805).
This commit is contained in:
parent
000aaaf4e8
commit
393c0c74a9
@ -50,6 +50,7 @@ function serializeTopics(topics: Array<string | Array<string>>): string {
|
|||||||
sorted.sort();
|
sorted.sort();
|
||||||
|
|
||||||
return sorted.join("|");
|
return sorted.join("|");
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
return checkTopic(topic);
|
return checkTopic(topic);
|
||||||
}
|
}
|
||||||
@ -58,10 +59,15 @@ function serializeTopics(topics: Array<string | Array<string>>): string {
|
|||||||
|
|
||||||
function deserializeTopics(data: string): Array<string | Array<string>> {
|
function deserializeTopics(data: string): Array<string | Array<string>> {
|
||||||
if (data === "") { return [ ]; }
|
if (data === "") { return [ ]; }
|
||||||
|
|
||||||
return data.split(/&/g).map((topic) => {
|
return data.split(/&/g).map((topic) => {
|
||||||
return topic.split("|").map((topic) => {
|
if (topic === "") { return [ ]; }
|
||||||
|
|
||||||
|
const comps = topic.split("|").map((topic) => {
|
||||||
return ((topic === "null") ? null: topic);
|
return ((topic === "null") ? null: topic);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
return ((comps.length === 1) ? comps[0]: comps);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user