@spinajs/configuration
Advanced tools
Comparing version 2.0.60 to 2.0.61
@@ -17,3 +17,3 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
import { InternalLogger } from '@spinajs/internal-logger'; | ||
import { InvalidOperation } from '@spinajs/exceptions'; | ||
import { InvalidArgument, InvalidOperation } from '@spinajs/exceptions'; | ||
import { ConfigurationSource, Configuration, } from '@spinajs/configuration-common'; | ||
@@ -89,2 +89,7 @@ import { Autoinject, Container, Injectable } from '@spinajs/di'; | ||
if (this.CustomConfigPaths) { | ||
// when using DI for resolving, options are injected and not type checked | ||
// double check for this | ||
if (!Array.isArray(this.CustomConfigPaths)) { | ||
throw new InvalidArgument(`ConfigurationConfigPaths should be an array`); | ||
} | ||
this.CustomConfigPaths.forEach((p) => { | ||
@@ -160,2 +165,6 @@ InternalLogger.trace(`Custom config path at: ${p}`, 'Configuration'); | ||
const config = this.get(s.$configurationModule); | ||
if (!config) { | ||
InternalLogger.warn(`Cannot validate configuration for module ${s.$configurationModule}, configuration is not set`, 'Configuration'); | ||
return; | ||
} | ||
const result = this.Validator.validate(s, config); | ||
@@ -162,0 +171,0 @@ if (!result) { |
@@ -35,6 +35,6 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
// project paths - last to allow overwrite @spinajs conf | ||
normalize(join(resolve(process.cwd()), 'src', 'lib/config')), | ||
normalize(join(resolve(process.cwd()), 'src', 'dist/config')), | ||
normalize(join(resolve(process.cwd()), 'src', 'build/config')), | ||
normalize(join(resolve(process.cwd()), 'src', 'config')), | ||
normalize(join(resolve(process.cwd()), 'lib/config')), | ||
normalize(join(resolve(process.cwd()), 'dist/config')), | ||
normalize(join(resolve(process.cwd()), 'build/config')), | ||
normalize(join(resolve(process.cwd()), 'config')), | ||
]; | ||
@@ -41,0 +41,0 @@ this.BasePath = ''; |
{ | ||
"name": "@spinajs/configuration", | ||
"version": "2.0.60", | ||
"version": "2.0.61", | ||
"description": "framework configuration module", | ||
@@ -49,6 +49,6 @@ "exports": "./lib/index.js", | ||
"dependencies": { | ||
"@spinajs/configuration-common": "^2.0.60", | ||
"@spinajs/di": "^2.0.60", | ||
"@spinajs/exceptions": "^2.0.60", | ||
"@spinajs/internal-logger": "^2.0.60", | ||
"@spinajs/configuration-common": "^2.0.61", | ||
"@spinajs/di": "^2.0.61", | ||
"@spinajs/exceptions": "^2.0.61", | ||
"@spinajs/internal-logger": "^2.0.61", | ||
"ajv": "^8.12.0", | ||
@@ -55,0 +55,0 @@ "ajv-formats": "^2.1.1", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
49524
671