@nestjs/core 9.0.3 → 9.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { ClassProvider, FactoryProvider, Provider, ValueProvider } from '@nestjs/common';
|
|
2
|
+
export declare function isClassProvider<T = any>(provider: Provider): provider is ClassProvider<T>;
|
|
3
|
+
export declare function isValueProvider<T = any>(provider: Provider): provider is ValueProvider<T>;
|
|
4
|
+
export declare function isFactoryProvider<T = any>(provider: Provider): provider is FactoryProvider<T>;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.isFactoryProvider = exports.isValueProvider = exports.isClassProvider = void 0;
|
|
4
|
+
const shared_utils_1 = require("@nestjs/common/utils/shared.utils");
|
|
5
|
+
function isClassProvider(provider) {
|
|
6
|
+
return Boolean(provider === null || provider === void 0 ? void 0 : provider.useClass);
|
|
7
|
+
}
|
|
8
|
+
exports.isClassProvider = isClassProvider;
|
|
9
|
+
function isValueProvider(provider) {
|
|
10
|
+
const providerValue = provider === null || provider === void 0 ? void 0 : provider.useValue;
|
|
11
|
+
return !(0, shared_utils_1.isUndefined)(providerValue);
|
|
12
|
+
}
|
|
13
|
+
exports.isValueProvider = isValueProvider;
|
|
14
|
+
function isFactoryProvider(provider) {
|
|
15
|
+
return Boolean(provider.useFactory);
|
|
16
|
+
}
|
|
17
|
+
exports.isFactoryProvider = isFactoryProvider;
|
|
@@ -9,6 +9,7 @@ const random_string_generator_util_1 = require("@nestjs/common/utils/random-stri
|
|
|
9
9
|
const shared_utils_1 = require("@nestjs/common/utils/shared.utils");
|
|
10
10
|
const iterare_1 = require("iterare");
|
|
11
11
|
const constants_1 = require("./constants");
|
|
12
|
+
const provider_classifier_1 = require("./helpers/provider-classifier");
|
|
12
13
|
exports.INSTANCE_METADATA_SYMBOL = Symbol.for('instance_metadata:cache');
|
|
13
14
|
exports.INSTANCE_ID_SYMBOL = Symbol.for('instance_metadata:id');
|
|
14
15
|
class InstanceWrapper {
|
|
@@ -220,7 +221,7 @@ class InstanceWrapper {
|
|
|
220
221
|
.toArray();
|
|
221
222
|
}
|
|
222
223
|
mergeWith(provider) {
|
|
223
|
-
if (
|
|
224
|
+
if ((0, provider_classifier_1.isValueProvider)(provider)) {
|
|
224
225
|
this.metatype = null;
|
|
225
226
|
this.inject = null;
|
|
226
227
|
this.scope = common_1.Scope.DEFAULT;
|
|
@@ -230,11 +231,11 @@ class InstanceWrapper {
|
|
|
230
231
|
isPending: false,
|
|
231
232
|
});
|
|
232
233
|
}
|
|
233
|
-
else if (
|
|
234
|
+
else if ((0, provider_classifier_1.isClassProvider)(provider)) {
|
|
234
235
|
this.inject = null;
|
|
235
236
|
this.metatype = provider.useClass;
|
|
236
237
|
}
|
|
237
|
-
else if (
|
|
238
|
+
else if ((0, provider_classifier_1.isFactoryProvider)(provider)) {
|
|
238
239
|
this.metatype = provider.useFactory;
|
|
239
240
|
this.inject = provider.inject || [];
|
|
240
241
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nestjs/core",
|
|
3
|
-
"version": "9.0.
|
|
3
|
+
"version": "9.0.4",
|
|
4
4
|
"description": "Nest - modern, fast, powerful node.js web framework (@core)",
|
|
5
5
|
"author": "Kamil Mysliwiec",
|
|
6
6
|
"license": "MIT",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"uuid": "8.3.2"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@nestjs/common": "9.0.
|
|
39
|
+
"@nestjs/common": "9.0.4"
|
|
40
40
|
},
|
|
41
41
|
"peerDependencies": {
|
|
42
42
|
"@nestjs/common": "^9.0.0",
|