@spinajs/configuration
Advanced tools
Comparing version 2.0.305 to 2.0.306
@@ -37,2 +37,3 @@ "use strict"; | ||
const ajv_keywords_1 = __importDefault(require("ajv-keywords")); | ||
const PROTOCOL_REGEXP = /^([a-zA-Z0-9\-]+:\/\/)+(.+)$/gm; | ||
/** | ||
@@ -181,2 +182,11 @@ * HACK: | ||
const proxyFunc = (obj) => { | ||
const haveProtoVals = Object.values(obj).some((v) => { | ||
if (v instanceof configuration_common_1.ConfigVar) { | ||
return true; | ||
} | ||
return false; | ||
}); | ||
if (!haveProtoVals) { | ||
return obj; | ||
} | ||
return new Proxy(obj, { | ||
@@ -199,3 +209,2 @@ get: (obj, prop) => { | ||
const configProtocols = await di_1.DI.resolve(Array.ofType(configuration_common_1.ConfigVarProtocol)); | ||
const reg = /^([a-zA-Z0-9\-]+:\/\/)+(.+)$/gm; | ||
const iterate = async (obj) => { | ||
@@ -210,8 +219,8 @@ if (!obj) { | ||
await Promise.all((0, util_js_1.pickString)(obj).map(async ([key, val]) => { | ||
reg.lastIndex = 0; | ||
if (!reg.test(val)) { | ||
PROTOCOL_REGEXP.lastIndex = 0; | ||
if (!PROTOCOL_REGEXP.test(val)) { | ||
return; | ||
} | ||
reg.lastIndex = 0; | ||
const match = reg.exec(val); | ||
PROTOCOL_REGEXP.lastIndex = 0; | ||
const match = PROTOCOL_REGEXP.exec(val); | ||
const protocol = configProtocols.find((p) => p.Protocol === match[1]); | ||
@@ -218,0 +227,0 @@ if (!protocol) { |
@@ -31,2 +31,3 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { | ||
import { default as ajvKeywords } from 'ajv-keywords'; | ||
const PROTOCOL_REGEXP = /^([a-zA-Z0-9\-]+:\/\/)+(.+)$/gm; | ||
/** | ||
@@ -175,2 +176,11 @@ * HACK: | ||
const proxyFunc = (obj) => { | ||
const haveProtoVals = Object.values(obj).some((v) => { | ||
if (v instanceof ConfigVar) { | ||
return true; | ||
} | ||
return false; | ||
}); | ||
if (!haveProtoVals) { | ||
return obj; | ||
} | ||
return new Proxy(obj, { | ||
@@ -193,3 +203,2 @@ get: (obj, prop) => { | ||
const configProtocols = await DI.resolve(Array.ofType(ConfigVarProtocol)); | ||
const reg = /^([a-zA-Z0-9\-]+:\/\/)+(.+)$/gm; | ||
const iterate = async (obj) => { | ||
@@ -204,8 +213,8 @@ if (!obj) { | ||
await Promise.all(pickString(obj).map(async ([key, val]) => { | ||
reg.lastIndex = 0; | ||
if (!reg.test(val)) { | ||
PROTOCOL_REGEXP.lastIndex = 0; | ||
if (!PROTOCOL_REGEXP.test(val)) { | ||
return; | ||
} | ||
reg.lastIndex = 0; | ||
const match = reg.exec(val); | ||
PROTOCOL_REGEXP.lastIndex = 0; | ||
const match = PROTOCOL_REGEXP.exec(val); | ||
const protocol = configProtocols.find((p) => p.Protocol === match[1]); | ||
@@ -212,0 +221,0 @@ if (!protocol) { |
{ | ||
"name": "@spinajs/configuration", | ||
"version": "2.0.305", | ||
"version": "2.0.306", | ||
"description": "framework configuration module", | ||
@@ -55,7 +55,7 @@ "main": "lib/cjs/index.js", | ||
"dependencies": { | ||
"@spinajs/configuration-common": "^2.0.305", | ||
"@spinajs/di": "^2.0.305", | ||
"@spinajs/exceptions": "^2.0.305", | ||
"@spinajs/internal-logger": "^2.0.305", | ||
"@spinajs/util": "2.0.305", | ||
"@spinajs/configuration-common": "^2.0.306", | ||
"@spinajs/di": "^2.0.306", | ||
"@spinajs/exceptions": "^2.0.306", | ||
"@spinajs/internal-logger": "^2.0.306", | ||
"@spinajs/util": "2.0.306", | ||
"ajv": "^8.12.0", | ||
@@ -62,0 +62,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
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
277265
1955
+ Added@spinajs/util@2.0.306(transitive)
- Removed@spinajs/util@2.0.305(transitive)
Updated@spinajs/di@^2.0.306
Updated@spinajs/exceptions@^2.0.306
Updated@spinajs/util@2.0.306