MCPcopy
hub / github.com/directus/directus / resolveFn

Function resolveFn

packages/utils/shared/apply-options-data.ts:24–34  ·  view source on GitHub ↗
(skipUndefined: boolean)

Source from the content-addressed store, hash-verified

22}
23
24function resolveFn(skipUndefined: boolean): (path: string, scope: Scope) => any {
25 return (path, scope) => {
26 const value = get(scope, path);
27
28 if (value !== undefined || !skipUndefined) {
29 return typeof value === 'object' ? JSON.stringify(value) : value;
30 } else {
31 return `{{ ${path} }}`;
32 }
33 };
34}
35
36function renderMustache<T extends JsonValue>(item: T, scope: Scope, skipUndefined: boolean): Mustache<T> {
37 if (typeof item === 'string') {

Callers 1

renderMustacheFunction · 0.85

Calls 1

getFunction · 0.70

Tested by

no test coverage detected