@solid-soda/config
Advanced tools
+18
-0
@@ -5,2 +5,20 @@ # Change Log | ||
| # [2.0.0](https://github.com/solid-soda/config/compare/v1.2.1...v2.0.0) (2019-05-27) | ||
| ### Features | ||
| * replace tsoption by nanoption ([83a17c5](https://github.com/solid-soda/config/commit/83a17c5)) | ||
| ### BREAKING CHANGES | ||
| * use smaller lib for options | ||
| # Change Log | ||
| All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines. | ||
| ## [1.2.1](https://github.com/solid-soda/config/compare/v1.2.0...v1.2.1) (2019-05-16) | ||
@@ -7,0 +25,0 @@ |
@@ -1,2 +0,2 @@ | ||
| import { Option } from 'tsoption'; | ||
| import { Option } from 'nanoption'; | ||
| import { Configuration } from './Configuration'; | ||
@@ -3,0 +3,0 @@ export declare abstract class AbstractConfiguration implements Configuration { |
@@ -1,2 +0,2 @@ | ||
| import { Option } from 'tsoption'; | ||
| import { Option } from 'nanoption'; | ||
| export interface Configuration { | ||
@@ -3,0 +3,0 @@ get(key: string): Option<string>; |
@@ -5,4 +5,4 @@ import { AbstractConfiguration } from '../AbstractConfiguration'; | ||
| constructor(filePath: string); | ||
| get: (key: string) => import("tsoption").Some<string>; | ||
| get: (key: string) => import("nanoption").Some<string>; | ||
| isDev: () => boolean; | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| const changeCase = require("change-case"); | ||
| const tsoption_1 = require("tsoption"); | ||
| const nanoption_1 = require("nanoption"); | ||
| const AbstractConfiguration_1 = require("../AbstractConfiguration"); | ||
@@ -10,3 +10,3 @@ const dotEnvParse_1 = require("./fileParsers/dotEnvParse"); | ||
| super(); | ||
| this.get = (key) => tsoption_1.Option.of(this.configDict[changeCase.constantCase(key)]); | ||
| this.get = (key) => nanoption_1.Option.of(this.configDict[changeCase.constantCase(key)]); | ||
| this.isDev = () => this.getString('nodeEnv') | ||
@@ -13,0 +13,0 @@ .map(env => env === 'development') |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"DotEnvConfiguration.js","sourceRoot":"","sources":["../../lib/configurations/DotEnvConfiguration.ts"],"names":[],"mappings":";;AAAA,0CAAyC;AACzC,uCAAiC;AAEjC,oEAAgE;AAEhE,2DAAuD;AAEvD,MAAa,mBAAoB,SAAQ,6CAAqB;IAG5D,YAAmB,QAAgB;QACjC,KAAK,EAAE,CAAA;QAIF,QAAG,GAAG,CAAC,GAAW,EAAE,EAAE,CAC3B,iBAAM,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;QAEnD,UAAK,GAAG,GAAG,EAAE,CAClB,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC;aACtB,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,aAAa,CAAC;aACjC,SAAS,CAAC,KAAK,CAAC,CAAA;QATnB,IAAI,CAAC,UAAU,GAAG,yBAAW,CAAC,QAAQ,CAAC,CAAA;IACzC,CAAC;CASF;AAfD,kDAeC"} | ||
| {"version":3,"file":"DotEnvConfiguration.js","sourceRoot":"","sources":["../../lib/configurations/DotEnvConfiguration.ts"],"names":[],"mappings":";;AAAA,0CAAyC;AACzC,yCAAkC;AAElC,oEAAgE;AAEhE,2DAAuD;AAEvD,MAAa,mBAAoB,SAAQ,6CAAqB;IAG5D,YAAmB,QAAgB;QACjC,KAAK,EAAE,CAAA;QAIF,QAAG,GAAG,CAAC,GAAW,EAAE,EAAE,CAC3B,kBAAM,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,UAAU,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;QAEnD,UAAK,GAAG,GAAG,EAAE,CAClB,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC;aACtB,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,aAAa,CAAC;aACjC,SAAS,CAAC,KAAK,CAAC,CAAA;QATnB,IAAI,CAAC,UAAU,GAAG,yBAAW,CAAC,QAAQ,CAAC,CAAA;IACzC,CAAC;CASF;AAfD,kDAeC"} |
| import { AbstractConfiguration } from '../AbstractConfiguration'; | ||
| export declare class EnvConfiguration extends AbstractConfiguration { | ||
| get: (key: string) => import("tsoption").Some<string>; | ||
| get: (key: string) => import("nanoption").Some<string>; | ||
| isDev: () => boolean; | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| const changeCase = require("change-case"); | ||
| const tsoption_1 = require("tsoption"); | ||
| const nanoption_1 = require("nanoption"); | ||
| const AbstractConfiguration_1 = require("../AbstractConfiguration"); | ||
@@ -9,3 +9,3 @@ class EnvConfiguration extends AbstractConfiguration_1.AbstractConfiguration { | ||
| super(...arguments); | ||
| this.get = (key) => tsoption_1.Option.of(process.env[changeCase.constantCase(key)]); | ||
| this.get = (key) => nanoption_1.Option.of(process.env[changeCase.constantCase(key)]); | ||
| this.isDev = () => this.getString('nodeEnv') | ||
@@ -12,0 +12,0 @@ .map(env => env === 'development') |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"EnvConfiguration.js","sourceRoot":"","sources":["../../lib/configurations/EnvConfiguration.ts"],"names":[],"mappings":";;AAAA,0CAAyC;AACzC,uCAAiC;AAEjC,oEAAgE;AAEhE,MAAa,gBAAiB,SAAQ,6CAAqB;IAA3D;;QACS,QAAG,GAAG,CAAC,GAAW,EAAE,EAAE,CAC3B,iBAAM,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;QAE/C,UAAK,GAAG,GAAG,EAAE,CAClB,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC;aACtB,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,aAAa,CAAC;aACjC,SAAS,CAAC,KAAK,CAAC,CAAA;IACvB,CAAC;CAAA;AARD,4CAQC"} | ||
| {"version":3,"file":"EnvConfiguration.js","sourceRoot":"","sources":["../../lib/configurations/EnvConfiguration.ts"],"names":[],"mappings":";;AAAA,0CAAyC;AACzC,yCAAkC;AAElC,oEAAgE;AAEhE,MAAa,gBAAiB,SAAQ,6CAAqB;IAA3D;;QACS,QAAG,GAAG,CAAC,GAAW,EAAE,EAAE,CAC3B,kBAAM,CAAC,EAAE,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,YAAY,CAAC,GAAG,CAAC,CAAC,CAAC,CAAA;QAE/C,UAAK,GAAG,GAAG,EAAE,CAClB,IAAI,CAAC,SAAS,CAAC,SAAS,CAAC;aACtB,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,aAAa,CAAC;aACjC,SAAS,CAAC,KAAK,CAAC,CAAA;IACvB,CAAC;CAAA;AARD,4CAQC"} |
@@ -7,4 +7,4 @@ import { AbstractConfiguration } from '../AbstractConfiguration'; | ||
| constructor(configDict: ConfigDict, envKey: string); | ||
| get: (key: string) => import("tsoption").Some<string>; | ||
| get: (key: string) => import("nanoption").Some<string>; | ||
| isDev: () => boolean; | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| const tsoption_1 = require("tsoption"); | ||
| const nanoption_1 = require("nanoption"); | ||
| const AbstractConfiguration_1 = require("../AbstractConfiguration"); | ||
@@ -10,3 +10,3 @@ class ExternalConfiguration extends AbstractConfiguration_1.AbstractConfiguration { | ||
| this.envKey = envKey; | ||
| this.get = (key) => tsoption_1.Option.of(this.configDict[key]); | ||
| this.get = (key) => nanoption_1.Option.of(this.configDict[key]); | ||
| this.isDev = () => this.getString(this.envKey) | ||
@@ -13,0 +13,0 @@ .map(env => env === 'development') |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"ExternalConfiguration.js","sourceRoot":"","sources":["../../lib/configurations/ExternalConfiguration.ts"],"names":[],"mappings":";;AAAA,uCAAiC;AAEjC,oEAAgE;AAGhE,MAAa,qBAAsB,SAAQ,6CAAqB;IAC9D,YACmB,UAAsB,EACtB,MAAc;QAE/B,KAAK,EAAE,CAAA;QAHU,eAAU,GAAV,UAAU,CAAY;QACtB,WAAM,GAAN,MAAM,CAAQ;QAK1B,QAAG,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,iBAAM,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAA;QAEtD,UAAK,GAAG,GAAG,EAAE,CAClB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;aACxB,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,aAAa,CAAC;aACjC,SAAS,CAAC,KAAK,CAAC,CAAA;IAPrB,CAAC;CAQF;AAdD,sDAcC"} | ||
| {"version":3,"file":"ExternalConfiguration.js","sourceRoot":"","sources":["../../lib/configurations/ExternalConfiguration.ts"],"names":[],"mappings":";;AAAA,yCAAkC;AAElC,oEAAgE;AAGhE,MAAa,qBAAsB,SAAQ,6CAAqB;IAC9D,YACmB,UAAsB,EACtB,MAAc;QAE/B,KAAK,EAAE,CAAA;QAHU,eAAU,GAAV,UAAU,CAAY;QACtB,WAAM,GAAN,MAAM,CAAQ;QAK1B,QAAG,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,kBAAM,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAA;QAEtD,UAAK,GAAG,GAAG,EAAE,CAClB,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,MAAM,CAAC;aACxB,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,aAAa,CAAC;aACjC,SAAS,CAAC,KAAK,CAAC,CAAA;IAPrB,CAAC;CAQF;AAdD,sDAcC"} |
@@ -6,4 +6,4 @@ import { AbstractConfiguration } from '../AbstractConfiguration'; | ||
| constructor(filePath: string, fileParse: ParseFile); | ||
| get: (key: string) => import("tsoption").Some<string>; | ||
| get: (key: string) => import("nanoption").Some<string>; | ||
| isDev: () => boolean; | ||
| } |
| "use strict"; | ||
| Object.defineProperty(exports, "__esModule", { value: true }); | ||
| const tsoption_1 = require("tsoption"); | ||
| const nanoption_1 = require("nanoption"); | ||
| const AbstractConfiguration_1 = require("../AbstractConfiguration"); | ||
@@ -8,3 +8,3 @@ class FileConfiguration extends AbstractConfiguration_1.AbstractConfiguration { | ||
| super(); | ||
| this.get = (key) => tsoption_1.Option.of(this.configDict[key]); | ||
| this.get = (key) => nanoption_1.Option.of(this.configDict[key]); | ||
| this.isDev = () => this.getString('appEnv') | ||
@@ -11,0 +11,0 @@ .map(env => env === 'development') |
@@ -1,1 +0,1 @@ | ||
| {"version":3,"file":"FileConfiguration.js","sourceRoot":"","sources":["../../lib/configurations/FileConfiguration.ts"],"names":[],"mappings":";;AAAA,uCAAiC;AAEjC,oEAAgE;AAIhE,MAAa,iBAAkB,SAAQ,6CAAqB;IAG1D,YAAmB,QAAgB,EAAE,SAAoB;QACvD,KAAK,EAAE,CAAA;QAIF,QAAG,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,iBAAM,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAA;QAEtD,UAAK,GAAG,GAAG,EAAE,CAClB,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;aACrB,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,aAAa,CAAC;aACjC,SAAS,CAAC,KAAK,CAAC,CAAA;QARnB,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAA;IACvC,CAAC;CAQF;AAdD,8CAcC"} | ||
| {"version":3,"file":"FileConfiguration.js","sourceRoot":"","sources":["../../lib/configurations/FileConfiguration.ts"],"names":[],"mappings":";;AAAA,yCAAkC;AAElC,oEAAgE;AAIhE,MAAa,iBAAkB,SAAQ,6CAAqB;IAG1D,YAAmB,QAAgB,EAAE,SAAoB;QACvD,KAAK,EAAE,CAAA;QAIF,QAAG,GAAG,CAAC,GAAW,EAAE,EAAE,CAAC,kBAAM,CAAC,EAAE,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,CAAA;QAEtD,UAAK,GAAG,GAAG,EAAE,CAClB,IAAI,CAAC,SAAS,CAAC,QAAQ,CAAC;aACrB,GAAG,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,aAAa,CAAC;aACjC,SAAS,CAAC,KAAK,CAAC,CAAA;QARnB,IAAI,CAAC,UAAU,GAAG,SAAS,CAAC,QAAQ,CAAC,CAAA;IACvC,CAAC;CAQF;AAdD,8CAcC"} |
@@ -1,2 +0,2 @@ | ||
| import { Option } from 'tsoption'; | ||
| import { Option } from 'nanoption'; | ||
| export declare const getValueOrThrow: <T>(name: string, option: Option<T>) => T; |
+2
-2
| { | ||
| "name": "@solid-soda/config", | ||
| "version": "1.2.1", | ||
| "version": "2.0.0", | ||
| "license": "MIT", | ||
@@ -17,3 +17,3 @@ "main": "dist/index.js", | ||
| "dotenv": "^6.2.0", | ||
| "tsoption": "^0.7.0" | ||
| "nanoption": "^1.0.1" | ||
| }, | ||
@@ -20,0 +20,0 @@ "devDependencies": { |
+2
-2
@@ -48,6 +48,6 @@ # @solid-soda/config | ||
| > `@solid-soda/config` uses [tsoption](https://github.com/bcherny/tsoption) for nullable values | ||
| > `@solid-soda/config` uses [nanoption](https://github.com/igorkamyshev/nanoption) for nullable values | ||
| ```js | ||
| import { Option } from 'tsoption' | ||
| import { Option } from 'nanoption' | ||
@@ -54,0 +54,0 @@ interface Configuration { |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
29414
1.63%+ Added
+ Added
- Removed
- Removed