MCPcopy Create free account
hub / github.com/dagger/dagger / loadParentState

Function loadParentState

sdk/typescript/src/module/entrypoint/load.ts:120–141  ·  view source on GitHub ↗
(
  executor: Executor,
  object: DaggerObject,
  ctx: InvokeCtx,
)

Source from the content-addressed store, hash-verified

118 * @param ctx The context of the invocation.
119 */
120export async function loadParentState(
121 executor: Executor,
122 object: DaggerObject,
123 ctx: InvokeCtx,
124): Promise<Args> {
125 const parentState: Args = {}
126
127 for (const [key, value] of Object.entries(ctx.parentArgs)) {
128 const property = object.properties[key]
129 if (!property) {
130 throw new Error(`could not find parent property ${key}`)
131 }
132
133 if (!property.type) {
134 throw new Error(`could not find type for parent property ${key}`)
135 }
136
137 parentState[property.name] = await loadValue(executor, value, property.type)
138 }
139
140 return parentState
141}
142
143/**
144 * This function load the value as a Dagger type.

Callers 1

invokeFunction · 0.85

Calls 2

loadValueFunction · 0.85
entriesMethod · 0.45

Tested by

no test coverage detected