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

@dynrl/drl-settings

Package Overview
Dependencies
Maintainers
4
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@dynrl/drl-settings - npm Package Compare versions

Comparing version 1.0.3 to 1.0.4

lib/index.d.ts

11

lib/index.js

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

const fs = require('fs');
const path = require('path');
/**

@@ -36,2 +37,3 @@ * Wrapper for accessing settings in DRL apps and modules.

if (this.useEnvFile() && filePath) {
filePath = path.resolve(filePath);
if (!fs.existsSync(filePath)) {

@@ -65,10 +67,9 @@ throw new Error(`Could not locate .env file at ${filePath}`);

static getSetting(key) {
const val = process.env[key];
// Check validity of key
if (typeof val === 'undefined' || val === null) {
throw new Error(`Could not locate required setting, ${key}. Add this to your settings.json`);
}
if (!this.WhiteList[key]) {
throw new Error(`Non-sanctioned key detected, ${key}. Make sure keys are registered during the initSettings call.`);
}
const val = process.env[key];
if (val == null) {
throw new Error(`Could not locate required setting, ${key}. Add this to your environment variables.`);
}
if (val === '') {

@@ -75,0 +76,0 @@ this.warn(`Empty key detected, ${key}.`);

{
"name": "@dynrl/drl-settings",
"version": "1.0.3",
"version": "1.0.4",
"description": "Standardizes settings access",

@@ -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