fix(est): apply head cost classification safely

This commit is contained in:
2026-11-07 16:39:55 +09:00
parent 9eae77d8f2
commit 5e72aff136
7 changed files with 68 additions and 18 deletions
+8 -1
View File
@@ -178,14 +178,21 @@ const EstNative = (() => {
const group = (kind === 103 ? heads : costs).get(code);
if (!group) throw Error(`하위 자료 없음: ${id}`);
active.add(id);
const refreshHeadRows =
kind === 103
? (request.refreshHeadRows || [])
.filter((index) => index >= group.start && index < group.start + group.rows.length)
.map((index) => index - group.start)
: [];
const result =
kind === 103
? EstRows.head(group.rows, options, resolve)
? EstRows.head(group.rows, options, resolve, refreshHeadRows)
: EstText.calculate(
group.rows,
options,
options.SourceRefresh || options.ResourceTracing ? resolve : () => null,
);
if (refreshHeadRows.length) request.onHeadRefresh?.(result.refreshErrors);
const title = {
...tables[sourceTables[kind]].find((row) => row.Code === code),
...result.titles[0],