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
316
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.50 to 2.0.51

8

lib/sources.d.ts

@@ -1,2 +0,2 @@

import { ConfigurationSource, IConfigLike } from '@spinajs/configuration-common';
import { ConfigurationSource } from '@spinajs/configuration-common';
export declare abstract class BaseFileSource extends ConfigurationSource {

@@ -14,10 +14,10 @@ protected RunApp?: string;

constructor(RunApp?: string, CustomConfigPaths?: string[], appBaseDir?: string);
protected load(extension: string, callback: (file: string) => Promise<unknown>): Promise<{}>;
protected load(extension: string, callback: (file: string) => Promise<any>): Promise<{}>;
}
export declare class JsFileSource extends BaseFileSource {
Load(): Promise<IConfigLike>;
Load(): Promise<any>;
}
export declare class JsonFileSource extends BaseFileSource {
Load(): Promise<IConfigLike>;
Load(): Promise<any>;
}
//# sourceMappingURL=sources.d.ts.map

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

};
/* eslint-disable @typescript-eslint/no-unsafe-argument */
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/require-await */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/no-unsafe-return */
/* eslint-disable @typescript-eslint/no-explicit-any */
import { Injectable, DI } from '@spinajs/di';

@@ -82,2 +88,3 @@ import glob from 'glob';

const common = await this.load('!(*.dev|*.prod).{cjs,js}', _load);
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const dEnv = DI.get('process.env') ?? process.env;

@@ -90,7 +97,8 @@ const fExt = dEnv.NODE_ENV && dEnv.NODE_ENV === 'development' ? '*.dev.{cjs,js}' : '*.prod.{cjs,js}';

InternalLogger.trace(`Trying to load file ${file}`, 'Configuration');
const res = (await import(`file://${file}`));
// eslint-disable -next-line security/detect-non-literal-require
const res = await import(`file://${file}`);
return res.default;
}
catch (err) {
InternalLogger.error(err, `error loading configuration file ${file}`, 'configuration');
InternalLogger.error(err, `error loading configuration file ${file}`);
return null;

@@ -108,2 +116,3 @@ }

const common = await this.load('!(*.dev|*.prod).json', _load);
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment
const dEnv = DI.get('process.env') ?? process.env;

@@ -116,3 +125,3 @@ const fExt = dEnv.NODE_ENV && dEnv.NODE_ENV === 'development' ? '*.dev.json' : '*.prod.json';

InternalLogger.trace(`Trying to load file ${file}`, 'Configuration');
return Promise.resolve(JSON.parse(fs.readFileSync(file, 'utf-8')));
return JSON.parse(fs.readFileSync(file, 'utf-8'));
}

@@ -119,0 +128,0 @@ catch (err) {

{
"name": "@spinajs/configuration",
"version": "2.0.50",
"version": "2.0.51",
"description": "framework configuration module",

@@ -22,4 +22,4 @@ "exports": "./lib/index.js",

"preversion": "npm run lint",
"version": "npm run format && git add -A src",
"postinstall": "npm run build"
"version": "npm run format && git add -A src"
},

@@ -26,0 +26,0 @@ "files": [

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