nestjs-config-extended 1.2.6 → 1.2.7
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.
|
@@ -33,13 +33,13 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
33
33
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
34
34
|
exports.ExtendedConfigService = void 0;
|
|
35
35
|
const common_1 = require("@nestjs/common");
|
|
36
|
-
const util_1 = require("util");
|
|
37
36
|
const lodash_get_1 = __importDefault(require("lodash.get"));
|
|
38
37
|
const lodash_has_1 = __importDefault(require("lodash.has"));
|
|
39
38
|
const object_util_1 = require("./util/object.util");
|
|
40
39
|
const config_constants_1 = require("./config.constants");
|
|
41
40
|
const exceptions_1 = require("./exceptions");
|
|
42
41
|
const loader_util_1 = require("./util/loader.util");
|
|
42
|
+
const is_undefined_util_1 = require("./util/is-undefined.util");
|
|
43
43
|
let ExtendedConfigService = class ExtendedConfigService {
|
|
44
44
|
constructor(options, scheduler, logger, preLoadedValues) {
|
|
45
45
|
this.options = options;
|
|
@@ -96,13 +96,13 @@ let ExtendedConfigService = class ExtendedConfigService {
|
|
|
96
96
|
get(propertyPath, defaultValue) {
|
|
97
97
|
if (this.isCacheEnabled) {
|
|
98
98
|
const cachedValue = this.getFromCache(propertyPath);
|
|
99
|
-
if (!
|
|
99
|
+
if (!is_undefined_util_1.isUndefined(cachedValue)) {
|
|
100
100
|
return cachedValue;
|
|
101
101
|
}
|
|
102
102
|
}
|
|
103
103
|
else {
|
|
104
104
|
const processEnvValue = this.getFromProcessEnv(propertyPath);
|
|
105
|
-
if (!
|
|
105
|
+
if (!is_undefined_util_1.isUndefined(processEnvValue)) {
|
|
106
106
|
return processEnvValue;
|
|
107
107
|
}
|
|
108
108
|
}
|
|
@@ -181,7 +181,7 @@ let ExtendedConfigService = class ExtendedConfigService {
|
|
|
181
181
|
}
|
|
182
182
|
}
|
|
183
183
|
configureScheduler(strategy) {
|
|
184
|
-
const { reloadable, identifier, schedule, scheduleTimezone, disable
|
|
184
|
+
const { reloadable, identifier, schedule, scheduleTimezone, disable } = strategy;
|
|
185
185
|
if (!disable && schedule && reloadable) {
|
|
186
186
|
if (!this.scheduler.validate(schedule)) {
|
|
187
187
|
throw new exceptions_1.InvalidScheduleException(identifier);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function isUndefined(obj: unknown): obj is undefined;
|