8 lines
298 B
TypeScript
8 lines
298 B
TypeScript
export function restoreTextResourceContent(draft?: Record<string, any>): string[] {
|
|
const content = draft?.content;
|
|
if (typeof content === "string") return [content];
|
|
// Empty arrays and strings both represent an intentional edit.
|
|
if (Array.isArray(content)) return content;
|
|
return [];
|
|
}
|