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