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

@coast/dynamic-config

Package Overview
Dependencies
Maintainers
4
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@coast/dynamic-config - npm Package Compare versions

Comparing version 1.4.6 to 1.4.7

1

DynamicConfig.d.ts

@@ -13,3 +13,2 @@ import { SSM } from 'aws-sdk';

* Loads config values in priority order
*
* @returns {Promise<Record<string, unknown>>} The validated configuration map.

@@ -16,0 +15,0 @@ * Values will be coerced to their primitive types if appliable

@@ -22,3 +22,2 @@ "use strict";

* Loads config values in priority order
*
* @returns {Promise<Record<string, unknown>>} The validated configuration map.

@@ -28,25 +27,15 @@ * Values will be coerced to their primitive types if appliable

async loadConfig() {
console.log('loadConfig called', new Date());
const allKeys = this.getAllKeys();
console.log('allKeys loaded', new Date());
const entries = {};
this.loadFromSource(allKeys, process.env, entries);
console.log('process.env loaded', new Date());
let dotEnvParse = {};
console.log('looking up dotenv?', this.options.envFilePath !== undefined);
if (this.options.envFilePath !== undefined && fs_1.default.existsSync(this.options.envFilePath)) {
console.log('attempting dotenv', new Date());
dotEnvParse = dotenv_1.default.parse(fs_1.default.readFileSync(this.options.envFilePath));
this.loadFromSource(this.getAllUnsetKeys(allKeys, entries), dotEnvParse, entries);
console.log('dotenv loaded', new Date());
}
const missingEntries = this.getAllUnsetKeys(allKeys, entries);
console.log({ missing: missingEntries.length > 0, skipSSM: this.options.skipSsm });
if (missingEntries.length > 0 && !this.options.skipSsm) {
console.log('attempting ssm', new Date());
await this.loadFromSsm(missingEntries, dotEnvParse, entries);
console.log('ssm loaded', new Date());
}
this.configuration = joi_1.default.attempt(entries, this.options.schema, { allowUnknown: this.options.allowUnknownVariables });
console.log('configuration validated', new Date());
return this.configuration;

@@ -53,0 +42,0 @@ }

2

package.json
{
"name": "@coast/dynamic-config",
"version": "1.4.6",
"version": "1.4.7",
"main": "index.js",

@@ -5,0 +5,0 @@ "scripts": {

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