diff --git a/.vscode/settings.json b/.vscode/settings.json index b435746..ca039fc 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -1,10 +1,10 @@ { "editor.formatOnSave": true, "[javascript]": { - "editor.formatOnSave": false + "editor.formatOnSave": true }, "[typescript]": { - "editor.formatOnSave": false + "editor.formatOnSave": true }, "eslint.autoFixOnSave": true, "eslint.validate": [ @@ -26,4 +26,4 @@ "https://cdn.esm.sh": false, "https://deno.land": true } // also provides unstable type declarations in VS Code -} +} \ No newline at end of file diff --git a/packages/di/src/module/module.ts b/packages/di/src/module/module.ts index cd930ec..5efb963 100644 --- a/packages/di/src/module/module.ts +++ b/packages/di/src/module/module.ts @@ -41,10 +41,11 @@ export const Module = ( } const providers = (entries.providers || []) as WithProviders[]; - const factories = filterNonNull(providers).filter(v => !!v.useFactory); - for (const entry of factories) { - ProvidersMetadata.set(entry, entry); + for (const entry of providers) { + if (entry.useFactory) { + ProvidersMetadata.set(entry, entry); + } } for (const entry of filterNonNull(