MCPcopy Create free account
hub / github.com/callumalpass/tasknotes / identifyTaskNotesFromBasesData

Function identifyTaskNotesFromBasesData

src/bases/helpers.ts:346–367  ·  view source on GitHub ↗
(
	dataItems: BasesDataItem[],
	plugin?: TaskNotesPlugin,
	toTaskInfo?: (item: BasesDataItem, plugin?: TaskNotesPlugin) => TaskInfo | null
)

Source from the content-addressed store, hash-verified

344 * Identify TaskNotes from Bases data by converting all items to TaskInfo
345 */
346export async function identifyTaskNotesFromBasesData(
347 dataItems: BasesDataItem[],
348 plugin?: TaskNotesPlugin,
349 toTaskInfo?: (item: BasesDataItem, plugin?: TaskNotesPlugin) => TaskInfo | null
350): Promise<TaskInfo[]> {
351 const taskInfoConverter = toTaskInfo || createTaskInfoFromBasesData;
352 const taskNotes: TaskInfo[] = [];
353 for (const item of dataItems) {
354 if (!item?.path) continue;
355 try {
356 const taskInfo = taskInfoConverter(item, plugin);
357 if (taskInfo) taskNotes.push(taskInfo);
358 } catch (error) {
359 tasknotesLogger.warn("[TaskNotes][BasesPOC] Error converting Bases item to TaskInfo:", {
360 category: "validation",
361 operation: "converting-bases-item-taskinfo",
362 error: error,
363 });
364 }
365 }
366 return taskNotes;
367}
368
369/**
370 * Render TaskNotes using TaskCard component into a container

Callers 7

renderMethod · 0.90
copyCurrentViewTasksFunction · 0.90
renderMethod · 0.90
renderMethod · 0.90
refreshGroupedViewMethod · 0.90

Calls 1

warnMethod · 0.80

Tested by

no test coverage detected