Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@spinajs/configuration-common

Package Overview
Dependencies
Maintainers
0
Versions
276
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spinajs/configuration-common - npm Package Compare versions

Comparing version 2.0.288 to 2.0.289

12

lib/cjs/index.d.ts

@@ -113,2 +113,12 @@ import { AsyncService, Class } from '@spinajs/di';

}
/**
* wrapper for lazy load config vars from protocols
* it allow to calculate vars only when needed / all modules are resolved
*/
export declare class ConfigVar {
protected lazyVal: () => any;
protected cache: any;
constructor(lazyVal: () => any);
get(): any;
}
export declare abstract class ConfigVarProtocol extends AsyncService {

@@ -126,4 +136,4 @@ /**

*/
abstract getVar(path: string, configuration: any): Promise<unknown>;
abstract getVar(path: string, configuration: any): Promise<string | number | boolean | ConfigVar | {}>;
}
//# sourceMappingURL=index.d.ts.map

@@ -17,3 +17,3 @@ "use strict";

Object.defineProperty(exports, "__esModule", { value: true });
exports.ConfigVarProtocol = exports.ConfigurationSource = exports.Configuration = void 0;
exports.ConfigVarProtocol = exports.ConfigVar = exports.ConfigurationSource = exports.Configuration = void 0;
const di_1 = require("@spinajs/di");

@@ -27,2 +27,18 @@ __exportStar(require("./variables.js"), exports);

exports.ConfigurationSource = ConfigurationSource;
/**
* wrapper for lazy load config vars from protocols
* it allow to calculate vars only when needed / all modules are resolved
*/
class ConfigVar {
constructor(lazyVal) {
this.lazyVal = lazyVal;
}
get() {
if (!this.cache) {
this.cache = this.lazyVal();
}
return this.cache;
}
}
exports.ConfigVar = ConfigVar;
class ConfigVarProtocol extends di_1.AsyncService {

@@ -29,0 +45,0 @@ }

@@ -113,2 +113,12 @@ import { AsyncService, Class } from '@spinajs/di';

}
/**
* wrapper for lazy load config vars from protocols
* it allow to calculate vars only when needed / all modules are resolved
*/
export declare class ConfigVar {
protected lazyVal: () => any;
protected cache: any;
constructor(lazyVal: () => any);
get(): any;
}
export declare abstract class ConfigVarProtocol extends AsyncService {

@@ -126,4 +136,4 @@ /**

*/
abstract getVar(path: string, configuration: any): Promise<unknown>;
abstract getVar(path: string, configuration: any): Promise<string | number | boolean | ConfigVar | {}>;
}
//# sourceMappingURL=index.d.ts.map

@@ -7,4 +7,19 @@ import { AsyncService } from '@spinajs/di';

}
/**
* wrapper for lazy load config vars from protocols
* it allow to calculate vars only when needed / all modules are resolved
*/
export class ConfigVar {
constructor(lazyVal) {
this.lazyVal = lazyVal;
}
get() {
if (!this.cache) {
this.cache = this.lazyVal();
}
return this.cache;
}
}
export class ConfigVarProtocol extends AsyncService {
}
//# sourceMappingURL=index.js.map

4

package.json
{
"name": "@spinajs/configuration-common",
"version": "2.0.288",
"version": "2.0.289",
"description": "> TODO: description",

@@ -50,5 +50,5 @@ "author": "Grzegorz Beń <grzegorz.ben@coderush.pl>",

"dependencies": {
"@spinajs/di": "^2.0.288"
"@spinajs/di": "^2.0.289"
},
"gitHead": "002dc553b0ffffd72193d0121ac425a4083bc9ee"
}

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc