MCPcopy Create free account
hub / github.com/chhoumann/quickadd / applyUriValueParameters

Method applyUriValueParameters

src/main.ts:372–393  ·  view source on GitHub ↗
(
		choiceExecutor: ChoiceExecutor,
		parameters: UriParameters,
	)

Source from the content-addressed store, hash-verified

370 }
371
372 private applyUriValueParameters(
373 choiceExecutor: ChoiceExecutor,
374 parameters: UriParameters,
375 ): void {
376 Object.entries(parameters)
377 .filter(([key]) => key.startsWith("value-"))
378 .forEach(([key, value]) => {
379 const variableName = key.slice(6);
380 // Never let an incoming URI populate a reserved internal variable
381 // (e.g. the capture-target file path): obsidian:// links are reachable
382 // by any webpage/app, so honouring `value-__qa.…` would let an external
383 // caller drive internal plumbing. There is no legitimate URI use for
384 // these keys.
385 if (
386 variableName &&
387 typeof value === "string" &&
388 !isReservedVariableKey(variableName)
389 ) {
390 choiceExecutor.variables.set(variableName, value);
391 }
392 });
393 }
394
395 private fireUriSuccess(targets: CallbackTargets, file?: TFile): void {
396 const params: Record<string, string> = { status: "success" };

Callers 2

onloadMethod · 0.95
runUriChoiceLegacyMethod · 0.95

Calls 2

isReservedVariableKeyFunction · 0.90
setMethod · 0.45

Tested by

no test coverage detected