Socket
Socket
Sign inDemoInstall

gemini-configparser

Package Overview
Dependencies
Maintainers
9
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gemini-configparser - npm Package Compare versions

Comparing version 1.3.2 to 1.4.0

14

lib/locator.js

@@ -20,6 +20,18 @@ const _ = require('lodash');

function getEnvName(prefixes, subKey) {
if (typeof prefixes === 'string') {
return prefixes + subKey;
}
const relatedEnvPrefixIndex = prefixes.findIndex((prefix => Object.hasOwnProperty.call(env, prefix + subKey)));
const envPrefix = relatedEnvPrefixIndex >= 0 ? prefixes[relatedEnvPrefixIndex] : prefixes[0];
return envPrefix + subKey;
}
function getNested(option, {namePrefix, envPrefix, cliPrefix}) {
return (subKey) => {
const envName = envPrefix + _.snakeCase(subKey);
const envSubKey = _.snakeCase(subKey);
const cliFlag = cliPrefix + _.kebabCase(subKey);
const envName = getEnvName(envPrefix, envSubKey);

@@ -26,0 +38,0 @@ const argIndex = parsedArgv.lastIndexOf(cliFlag);

2

package.json
{
"name": "gemini-configparser",
"version": "1.3.2",
"version": "1.4.0",
"description": "Config parser module for gemini",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

@@ -12,3 +12,4 @@ declare module "gemini-configparser" {

type RootPrefixes = {
envPrefix: string;
// If defined as an array and multiple prefixes match, first defined in the array will be used
envPrefix: string | string[];
cliPrefix: string;

@@ -15,0 +16,0 @@ };

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