chore: inline function
This commit is contained in:
parent
ebbf6651c9
commit
a44c691c5c
|
@ -17,13 +17,13 @@ export type SearchIndexItem = {
|
||||||
|
|
||||||
const rootMods = new Map(generated.map(item => [item.id, item]));
|
const rootMods = new Map(generated.map(item => [item.id, item]));
|
||||||
|
|
||||||
function walk(item: GeneratedSearchIndexItem) {
|
// link inlining here
|
||||||
|
for (const item of generated) {
|
||||||
if (item.inlining) {
|
if (item.inlining) {
|
||||||
for (const id of item.inlining) {
|
for (const id of item.inlining) {
|
||||||
const inline = rootMods.get(id);
|
const inline = rootMods.get(id);
|
||||||
if (inline) {
|
if (inline) {
|
||||||
inline.parentId = item.id;
|
inline.parentId = item.id;
|
||||||
rootMods.delete(id);
|
|
||||||
} else {
|
} else {
|
||||||
console.log('[Settings Search Index] Failed to inline', id);
|
console.log('[Settings Search Index] Failed to inline', id);
|
||||||
}
|
}
|
||||||
|
@ -31,9 +31,5 @@ function walk(item: GeneratedSearchIndexItem) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
for (const item of generated) {
|
|
||||||
walk(item);
|
|
||||||
}
|
|
||||||
|
|
||||||
export const searchIndexes: SearchIndexItem[] = generated;
|
export const searchIndexes: SearchIndexItem[] = generated;
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue