MCPcopy Index your code
hub / github.com/callumalpass/tasknotes / normalizeLifecycleEvent

Method normalizeLifecycleEvent

src/api/TaskNotesAPI.ts:2850–2870  ·  view source on GitHub ↗
(
		event: TaskNotesRuntimeLifecycleEventName,
		rawEvent: string,
		payload: unknown
	)

Source from the content-addressed store, hash-verified

2848 }
2849
2850 private normalizeLifecycleEvent(
2851 event: TaskNotesRuntimeLifecycleEventName,
2852 rawEvent: string,
2853 payload: unknown
2854 ): TaskNotesRuntimeLifecyclePayload {
2855 const record = isRecord(payload) ? payload : {};
2856 const extension = isRecord(record.extension)
2857 ? (record.extension as unknown as TaskNotesRuntimeLifecyclePayload["extension"])
2858 : undefined;
2859 return {
2860 event,
2861 timestamp:
2862 typeof record.timestamp === "string" ? record.timestamp : new Date().toISOString(),
2863 data: record.data ?? payload,
2864 settings: event === "settings.changed" ? this.getSettingsSnapshot() : undefined,
2865 extension,
2866 filePath: typeof record.filePath === "string" ? record.filePath : undefined,
2867 force: typeof record.force === "boolean" ? record.force : undefined,
2868 rawEvent,
2869 };
2870 }
2871
2872 private buildEventPayloadBase(
2873 payload: Partial<Omit<TaskNotesApiEventPayload, "event" | "timestamp">> & {

Callers 1

onLifecycleMethod · 0.95

Calls 2

getSettingsSnapshotMethod · 0.95
isRecordFunction · 0.70

Tested by

no test coverage detected