From cc944421dfa04399b263def08c8cdfd3b3de6063 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Lenon?= Date: Mon, 7 Feb 2022 23:03:37 -0300 Subject: [PATCH] fix: only create a new global container if it does not exist --- package.json | 2 +- src/utils/global.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 777ba55..7e9bde1 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@secjs/ioc", - "version": "1.0.7", + "version": "1.0.8", "description": "", "license": "MIT", "author": "João Lenon", diff --git a/src/utils/global.ts b/src/utils/global.ts index 94c3bd6..4221b57 100644 --- a/src/utils/global.ts +++ b/src/utils/global.ts @@ -8,4 +8,4 @@ declare global { const _global = global as any -_global.Container = new Container() +if (!_global.Container) _global.Container = new Container()