MCPcopy Create free account
hub / github.com/dailydotdev/apps / frameFor

Function frameFor

packages/world-cli/src/dev.js:113–135  ·  view source on GitHub ↗
(report, target)

Source from the content-addressed store, hash-verified

111};
112
113const frameFor = (report, target) => {
114 const payload = report.ok
115 ? report.scope === "realm"
116 ? { tiers: report.tiers }
117 : { variants: report.variants }
118 : null;
119
120 return {
121 scope: target.scope,
122 realm: target.realm,
123 niche: target.niche ?? null,
124 family: target.family,
125 opsVersion: report.opsVersion ?? 1,
126 level: report.level ?? target.level ?? null,
127 sourceHash: report.sourceHash ?? null,
128 payloadHash: payload ? hashSource(JSON.stringify(payload)) : null,
129 budget: report.budget ?? null,
130 usage: report.usage ?? null,
131 warnings: report.warnings ?? [],
132 errors: report.errors ?? [],
133 ...(payload ? { payload } : null),
134 };
135};
136
137const withoutPayload = ({ payload: _payload, ...report }) => report;
138

Callers 1

installFunction · 0.85

Calls 1

hashSourceFunction · 0.90

Tested by

no test coverage detected