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.2.0 to 0.3.0

CHANGELOG.md

9

dist/ConfigManager.d.ts

@@ -0,12 +1,15 @@

export declare type RecursivePartial<T> = {
[P in keyof T]?: T[P] extends (infer U)[] ? RecursivePartial<U>[] : T[P] extends object ? RecursivePartial<T[P]> : T[P];
};
export interface ConfigManagerOptions<TConfig> {
configurations: {
default: TConfig;
[env: string]: Partial<TConfig>;
[env: string]: RecursivePartial<TConfig>;
};
}
export interface ConfigurationManager<TConfig> {
get: (key: string, env?: string) => any;
getConfig: (env?: string) => TConfig;
get: (key: keyof TConfig, env?: string) => any;
getConfig: (env?: string) => Readonly<TConfig>;
}
export declare const createConfigManager: <TConfig>(options: ConfigManagerOptions<TConfig>) => ConfigurationManager<TConfig>;
export default createConfigManager;
{
"name": "configuring",
"version": "0.2.0",
"version": "0.3.0",
"description": "A configuration system for typescript projects",

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

},
"repository": {
"url": "https://github.com/ramiel/configuring"
},
"keywords": [],

@@ -18,0 +21,0 @@ "author": "",

@@ -5,6 +5,14 @@ import defaultsDeep from 'lodash/defaultsDeep';

export type RecursivePartial<T> = {
[P in keyof T]?: T[P] extends (infer U)[]
? RecursivePartial<U>[]
: T[P] extends object
? RecursivePartial<T[P]>
: T[P];
};
export interface ConfigManagerOptions<TConfig> {
configurations: {
default: TConfig;
[env: string]: Partial<TConfig>;
[env: string]: RecursivePartial<TConfig>;
};

@@ -14,4 +22,4 @@ }

export interface ConfigurationManager<TConfig> {
get: (key: string, env?: string) => any;
getConfig: (env?: string) => TConfig;
get: (key: keyof TConfig, env?: string) => any;
getConfig: (env?: string) => Readonly<TConfig>;
}

@@ -18,0 +26,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