MCPcopy Create free account
hub / github.com/aws/constructs / tryGetContext

Method tryGetContext

src/construct.ts:292–297  ·  view source on GitHub ↗

* Retrieves a value from tree context. * * Context is usually initialized at the root, but can be overridden at any point in the tree. * * @param key The context key * @returns The context value or `undefined` if there is no context value for this key.

(key: string)

Source from the content-addressed store, hash-verified

290 * @returns The context value or `undefined` if there is no context value for this key.
291 */
292 public tryGetContext(key: string): any {
293 const value = this._context?.[key];
294 if (value !== undefined) { return value; }
295
296 return this.scope && this.scope.node.tryGetContext(key);
297 }
298
299 /**
300 * An immutable array of metadata objects associated with this construct.

Callers 1

construct.test.tsFile · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected