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

Function buildBlockingUpdates

src/modals/taskEditChanges.ts:221–254  ·  view source on GitHub ↗
(input: TaskEditChangeInput)

Source from the content-addressed store, hash-verified

219}
220
221function buildBlockingUpdates(input: TaskEditChangeInput): {
222 blockingUpdates: BlockingUpdates;
223 unresolvedBlockingEntries: string[];
224} {
225 const resolvedBlocking = new Map<string, TaskDependency>();
226 const unresolvedBlockingEntries: string[] = [];
227
228 input.blockingItems.forEach((item) => {
229 if (item.path) {
230 resolvedBlocking.set(item.path, { ...item.dependency });
231 } else {
232 unresolvedBlockingEntries.push(item.dependency.uid);
233 }
234 });
235
236 const newBlockingPaths = Array.from(resolvedBlocking.keys());
237 const originalPaths = new Set(input.initialBlockingPaths);
238 const newPathSet = new Set(newBlockingPaths);
239 const added = newBlockingPaths.filter((path) => !originalPaths.has(path));
240 const removed = input.initialBlockingPaths.filter((path) => !newPathSet.has(path));
241 const raw: Record<string, TaskDependency> = {};
242
243 for (const path of added) {
244 const dependency = resolvedBlocking.get(path);
245 if (dependency) {
246 raw[path] = { ...dependency };
247 }
248 }
249
250 return {
251 blockingUpdates: { added, removed, raw },
252 unresolvedBlockingEntries,
253 };
254}
255
256function applyRecurringInstanceChanges(
257 input: TaskEditChangeInput,

Callers 1

buildTaskEditChangesFunction · 0.85

Calls 3

hasMethod · 0.80
setMethod · 0.65
getMethod · 0.65

Tested by

no test coverage detected