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

configuring

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

configuring - npm Package Compare versions

Comparing version 0.1.0 to 0.2.0

8

.vscode/settings.json
{
"typescript.tsdk": "node_modules/typescript/lib"
"typescript.tsdk": "node_modules/typescript/lib",
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
],
}

4

dist/ConfigManager.d.ts
export interface ConfigManagerOptions<TConfig> {
configurations: {
default: Partial<TConfig>;
default: TConfig;
[env: string]: Partial<TConfig>;

@@ -9,5 +9,5 @@ };

get: (key: string, env?: string) => any;
getConfig: (env?: string) => Partial<TConfig> | undefined;
getConfig: (env?: string) => TConfig;
}
export declare const createConfigManager: <TConfig>(options: ConfigManagerOptions<TConfig>) => ConfigurationManager<TConfig>;
export default createConfigManager;

@@ -51,9 +51,10 @@ 'use strict';

var config = configurationManager.getConfig(env);
if (config === null) {
throw new Error("No configuration for environment \"" + (env || 'default') + "\"");
}
return get(config, key);
},
getConfig: function (env) {
return getFitEnvironmentConfig(env);
var config = getFitEnvironmentConfig(env);
if (!config) {
throw new Error("No configuration for environment \"" + (env || 'default') + "\"");
}
return config;
},

@@ -60,0 +61,0 @@ };

@@ -45,9 +45,10 @@ import defaultsDeep from 'lodash/defaultsDeep';

var config = configurationManager.getConfig(env);
if (config === null) {
throw new Error("No configuration for environment \"" + (env || 'default') + "\"");
}
return get(config, key);
},
getConfig: function (env) {
return getFitEnvironmentConfig(env);
var config = getFitEnvironmentConfig(env);
if (!config) {
throw new Error("No configuration for environment \"" + (env || 'default') + "\"");
}
return config;
},

@@ -54,0 +55,0 @@ };

{
"name": "configuring",
"version": "0.1.0",
"version": "0.2.0",
"description": "A configuration system for typescript projects",

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

@@ -7,3 +7,3 @@ import defaultsDeep from 'lodash/defaultsDeep';

configurations: {
default: Partial<TConfig>;
default: TConfig;
[env: string]: Partial<TConfig>;

@@ -15,3 +15,3 @@ };

get: (key: string, env?: string) => any;
getConfig: (env?: string) => Partial<TConfig> | undefined;
getConfig: (env?: string) => TConfig;
}

@@ -31,3 +31,3 @@

const { configurations } = options;
const configSet = new Map<string, Partial<TConfig>>();
const configSet = new Map<string, TConfig>();

@@ -64,3 +64,8 @@ configSet.set('default', configurations.default);

const config = configurationManager.getConfig(env);
if (config === null) {
return get(config, key);
},
getConfig: (env) => {
const config = getFitEnvironmentConfig(env);
if (!config) {
throw new Error(

@@ -70,8 +75,4 @@ `No configuration for environment "${env || 'default'}"`

}
return get(config, key);
return config;
},
getConfig: (env) => {
return getFitEnvironmentConfig(env);
},
};

@@ -78,0 +79,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