MCPcopy
hub / github.com/callumalpass/tasknotes / mapFromFrontmatter

Method mapFromFrontmatter

src/core/FieldMapper.ts:63–81  ·  view source on GitHub ↗

* Convert frontmatter object using mapping to internal task data. * User-defined fields (settings.userFields) are written as top-level properties * on the returned object, keyed by their frontmatter key (e.g. "start_date").

(
		frontmatter: unknown,
		filePath: string,
		storeTitleInFilename?: boolean
	)

Source from the content-addressed store, hash-verified

61 * on the returned object, keyed by their frontmatter key (e.g. "start_date").
62 */
63 mapFromFrontmatter(
64 frontmatter: unknown,
65 filePath: string,
66 storeTitleInFilename?: boolean
67 ): Partial<TaskInfo> {
68 const frontmatterRecord =
69 frontmatter !== null && typeof frontmatter === "object" && !Array.isArray(frontmatter)
70 ? (frontmatter as Record<string, unknown>)
71 : undefined;
72 return mapTaskFromFrontmatter(
73 this.mapping,
74 frontmatterRecord,
75 filePath,
76 storeTitleInFilename,
77 this.userFields,
78 this.statuses,
79 this.priorities
80 );
81 }
82
83 /**
84 * Convert internal task data to frontmatter using mapping.

Callers 15

extractTaskInfoFunction · 0.95
getProjectSuggestionsMethod · 0.80
getItemTextMethod · 0.80
renderSuggestionMethod · 0.80
runFunction · 0.80
getFileSuggestionsFunction · 0.80
triggerNotificationMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected