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

Method tryGetContext

src/construct.ts:276–281  ·  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

274 * @returns The context value or `undefined` if there is no context value for this key.
275 */
276 public tryGetContext(key: string): any {
277 const value = this._context?.[key];
278 if (value !== undefined) { return value; }
279
280 return this.scope && this.scope.node.tryGetContext(key);
281 }
282
283 /**
284 * 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