refactor: dedupe reader helpers

This commit is contained in:
Peter Steinberger
2026-04-07 04:31:30 +01:00
parent d9fbfa268f
commit 2f115bc645
10 changed files with 63 additions and 60 deletions

View File

@@ -7,6 +7,7 @@
*/
import type * as Lark from "@larksuiteoapi/node-sdk";
import { readStringValue } from "openclaw/plugin-sdk/text-runtime";
import { cleanBlocksForDescendant } from "./docx-table-ops.js";
import type { FeishuDocxBlock, FeishuDocxBlockChild } from "./docx-types.js";
@@ -25,7 +26,8 @@ function normalizeChildIds(children: string[] | string | undefined): string[] |
if (Array.isArray(children)) {
return children;
}
return typeof children === "string" ? [children] : undefined;
const child = readStringValue(children);
return child ? [child] : undefined;
}
function toDescendantBlock(block: FeishuDocxBlock): DocxDescendantCreateBlock {