From 9a55623370d1b67b35f055e7ad6ea668e9aa5766 Mon Sep 17 00:00:00 2001 From: garrettmills Date: Sun, 16 Jul 2023 14:45:09 -0500 Subject: [PATCH] Modify isAwareOfContainerLifecycle to include function-type instances --- src/di/Container.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/di/Container.ts b/src/di/Container.ts index 6b4a412..fd09594 100644 --- a/src/di/Container.ts +++ b/src/di/Container.ts @@ -48,7 +48,7 @@ export interface AwareOfContainerLifecycle { export function isAwareOfContainerLifecycle(what: unknown): what is AwareOfContainerLifecycle { return Boolean( - typeof what === 'object' + (typeof what === 'object' || typeof what === 'function') && what !== null && hasOwnProperty(what, 'awareOfContainerLifecycle') && what.awareOfContainerLifecycle,