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

@spinajs/configuration

Package Overview
Dependencies
Maintainers
1
Versions
281
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@spinajs/configuration - npm Package Compare versions

Comparing version 2.0.238 to 2.0.240

1

lib/cjs/sources.d.ts

@@ -15,2 +15,3 @@ import { Configuration, ConfigurationSource, IConfigLike } from '@spinajs/configuration-common';

protected load(extension: string, callback: (file: string) => Promise<unknown>): Promise<{}>;
protected getEnvironment(config: Configuration): string;
}

@@ -17,0 +18,0 @@ export declare class JsFileSource extends BaseFileSource {

25

lib/cjs/sources.js

@@ -113,2 +113,15 @@ "use strict";

}
getEnvironment(config) {
const env = config.get('process.env.APP_ENV', 'production');
switch (env) {
case 'dev':
case 'development':
return 'dev';
case 'prod':
case 'production':
return 'prod';
default:
return env;
}
}
}

@@ -118,5 +131,5 @@ exports.BaseFileSource = BaseFileSource;

async Load(config) {
const common = await this.load('!(*.dev|*.prod).{cjs,js}', _load);
const env = config.get('process.env.APP_ENV', 'production');
const fExt = env === 'development' ? '*.dev.{cjs,js}' : '*.prod.{cjs,js}';
const env = this.getEnvironment(config);
const common = await this.load(`!(*.dev|*.prod|*.${env}).{cjs,js}`, _load);
const fExt = `*.${env}.{cjs,js}`;
const cfg = await this.load(fExt, _load);

@@ -142,5 +155,5 @@ return lodash_1.default.mergeWith(common, cfg, util_js_1.mergeArrays);

async Load(config) {
const common = await this.load('!(*.dev|*.prod).json', _load);
const env = config.get('process.env.APP_ENV', 'production');
const fExt = env === 'development' ? '*.dev.json' : '*.prod.json';
const env = this.getEnvironment(config);
const common = await this.load(`!(*.dev|*.prod|*.${env}).json`, _load);
const fExt = `*.${env}.json`;
const cfg = await this.load(fExt, _load);

@@ -147,0 +160,0 @@ return lodash_1.default.mergeWith(common, cfg, util_js_1.mergeArrays);

@@ -15,2 +15,3 @@ import { Configuration, ConfigurationSource, IConfigLike } from '@spinajs/configuration-common';

protected load(extension: string, callback: (file: string) => Promise<unknown>): Promise<{}>;
protected getEnvironment(config: Configuration): string;
}

@@ -17,0 +18,0 @@ export declare class JsFileSource extends BaseFileSource {

@@ -84,8 +84,21 @@ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {

}
getEnvironment(config) {
const env = config.get('process.env.APP_ENV', 'production');
switch (env) {
case 'dev':
case 'development':
return 'dev';
case 'prod':
case 'production':
return 'prod';
default:
return env;
}
}
}
let JsFileSource = class JsFileSource extends BaseFileSource {
async Load(config) {
const common = await this.load('!(*.dev|*.prod).{cjs,js}', _load);
const env = config.get('process.env.APP_ENV', 'production');
const fExt = env === 'development' ? '*.dev.{cjs,js}' : '*.prod.{cjs,js}';
const env = this.getEnvironment(config);
const common = await this.load(`!(*.dev|*.prod|*.${env}).{cjs,js}`, _load);
const fExt = `*.${env}.{cjs,js}`;
const cfg = await this.load(fExt, _load);

@@ -111,5 +124,5 @@ return _.mergeWith(common, cfg, mergeArrays);

async Load(config) {
const common = await this.load('!(*.dev|*.prod).json', _load);
const env = config.get('process.env.APP_ENV', 'production');
const fExt = env === 'development' ? '*.dev.json' : '*.prod.json';
const env = this.getEnvironment(config);
const common = await this.load(`!(*.dev|*.prod|*.${env}).json`, _load);
const fExt = `*.${env}.json`;
const cfg = await this.load(fExt, _load);

@@ -116,0 +129,0 @@ return _.mergeWith(common, cfg, mergeArrays);

{
"name": "@spinajs/configuration",
"version": "2.0.238",
"version": "2.0.240",
"description": "framework configuration module",

@@ -55,7 +55,7 @@ "main": "lib/cjs/index.js",

"dependencies": {
"@spinajs/configuration-common": "^2.0.238",
"@spinajs/di": "^2.0.238",
"@spinajs/exceptions": "^2.0.238",
"@spinajs/internal-logger": "^2.0.238",
"@spinajs/util": "2.0.238",
"@spinajs/configuration-common": "^2.0.240",
"@spinajs/di": "^2.0.240",
"@spinajs/exceptions": "^2.0.240",
"@spinajs/internal-logger": "^2.0.240",
"@spinajs/util": "2.0.240",
"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

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