Fix types mismatch

pull/73/head
MillenniumEarl 2021-03-02 16:18:47 +01:00
parent 8a7b1b4066
commit 8359958874
1 changed files with 12 additions and 7 deletions

View File

@ -35,7 +35,7 @@ interface ICategoryResource {
* Represents the set of tags present on the platform-
*/
interface ILatestResource {
prefixes: ICategoryResource[],
prefixes: { [s: string]: ICategoryResource[] },
tags: TPrefixDict,
options: string
}
@ -129,13 +129,18 @@ function assignLatestPlatformData(data: ILatestResource): void {
const scrapedData = {};
// Parse and assign the values that are NOT tags
for (const p of data.prefixes) {
// Prepare the dict
const dict: TPrefixDict = {};
for (const e of p.prefixes) dict[e.id] = e.name.replace("'", "'");
for (const [key, value] of Object.entries(data.prefixes)) {
for (const res of value) {
// Prepare the dict
const dict: TPrefixDict = {};
// Save the property
scrapedData[p.name] = dict;
for (const e of res.prefixes) {
dict[e.id] = e.name.replace("'", "'");
}
// Save the property
scrapedData[res.name] = dict;
}
}
// Save the values