dotenv-mono
Advanced tools
Comparing version 0.1.0 to 0.1.1
@@ -5,2 +5,9 @@ # Changelog | ||
### 0.1.1 (2022-11-10) | ||
### Bug Fixes | ||
* default priority ([892948e](https://github.com/marcocesarato/dotenv-mono/commit/892948e2a944af98a217f888ede1fbbe1d9d9960)) | ||
## 0.1.0 (2022-11-10) |
@@ -14,3 +14,3 @@ export type Data = Record<string, any>; | ||
public envString: string | null | undefined; | ||
constructor(args: DontEnvArgs); | ||
constructor(args?: DontEnvArgs); | ||
public load(loadOnProcess: boolean): DotEnv; | ||
@@ -17,0 +17,0 @@ public get(): Data; |
16
index.js
@@ -7,8 +7,8 @@ const fs = require("fs"); | ||
class DotEnv { | ||
constructor({path = null, expand = true, extension = null, priorities = null}) { | ||
this.path = path; | ||
this.expand = expand; | ||
this.ext = extension; | ||
constructor(props = {}) { | ||
this.path = props.path; | ||
this.expand = props.expand ?? false; | ||
this.ext = props.extension; | ||
this.env = {}; | ||
this.setPriorities(priorities); | ||
this.setPriorities(props.priorities); | ||
} | ||
@@ -24,4 +24,4 @@ | ||
[`.env${ext}.${this.nodeEnv}`]: 25, | ||
[`.env${ext}`]: 0, | ||
...(priorities || {}), | ||
[`.env${ext}`]: 1, | ||
...(priorities ?? {}), | ||
}; | ||
@@ -63,3 +63,3 @@ | ||
const matcher = (cwd) => { | ||
const priority = 0; | ||
const priority = -1; | ||
Object.keys(this.priorities).forEach((fileName) => { | ||
@@ -66,0 +66,0 @@ if ( |
{ | ||
"name": "dotenv-mono", | ||
"version": "0.1.0", | ||
"version": "0.1.1", | ||
"main": "index.js", | ||
@@ -5,0 +5,0 @@ "module": "index.js", |
@@ -51,3 +51,3 @@ <div align="center"> | ||
| 25 | .env.{development,production,test} | | ||
| 0 | .env | | ||
| 1 | .env | | ||
@@ -54,0 +54,0 @@ They can be customized on the constructor `priorities` property, see the example below. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12576