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

Function convertInternalToUserProperties

src/utils/propertyMapping.ts:33–51  ·  view source on GitHub ↗
(
	internalNames: string[],
	plugin: TaskNotesPlugin
)

Source from the content-addressed store, hash-verified

31 * // Returns: ["task-status", "deadline", "tags"]
32 */
33export function convertInternalToUserProperties(
34 internalNames: string[],
35 plugin: TaskNotesPlugin
36): string[] {
37 return internalNames.map((name) => {
38 // Special properties pass through unchanged
39 if (isSpecialProperty(name)) {
40 return name;
41 }
42
43 // Check if it's a valid FieldMapping key
44 if (name in plugin.fieldMapper.getMapping()) {
45 return plugin.fieldMapper.toUserField(name as keyof FieldMapping);
46 }
47
48 // Unknown property, pass through unchanged
49 return name;
50 });
51}
52
53/**
54 * Check if a property ID represents a specific internal field.

Callers 9

updateTaskCardDisplayMethod · 0.90
renderTasksMethod · 0.90
createTaskCardWidgetFunction · 0.90
toDOMMethod · 0.90
getVisiblePropertiesFunction · 0.90
getPropertiesToShowFunction · 0.90

Calls 3

isSpecialPropertyFunction · 0.85
getMappingMethod · 0.65
toUserFieldMethod · 0.65

Tested by

no test coverage detected