From 6b0cacda2a9e6535029cb5ff6cf90adb933fb4ca Mon Sep 17 00:00:00 2001 From: Rico Huijbers Date: Fri, 18 Mar 2022 12:25:00 +0100 Subject: [PATCH] chore: get rid of an `instanceof` (#19448) We shouldn't be doing this, ever. ---- *By submitting this pull request, I confirm that my contribution is made under the terms of the Apache-2.0 license* --- packages/@aws-cdk/core/lib/stack-synthesizers/_shared.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/@aws-cdk/core/lib/stack-synthesizers/_shared.ts b/packages/@aws-cdk/core/lib/stack-synthesizers/_shared.ts index 91251259c111d..f0cc2d548fd81 100644 --- a/packages/@aws-cdk/core/lib/stack-synthesizers/_shared.ts +++ b/packages/@aws-cdk/core/lib/stack-synthesizers/_shared.ts @@ -95,7 +95,7 @@ function collectStackMetadata(stack: Stack) { } function findParentStack(node: IConstruct): Stack | undefined { - if (node instanceof Stack && node.nestedStackParent === undefined) { + if (Stack.isStack(node) && node.nestedStackParent === undefined) { return node; } @@ -183,4 +183,4 @@ export function stackTemplateFileAsset(stack: Stack, session: ISynthesisSession) packaging: FileAssetPackaging.FILE, sourceHash, }; -} \ No newline at end of file +}