@anjianshi/utils 2.1.1 → 2.1.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -3,9 +3,9 @@
3
3
  * 注意:依赖 dotenv 包
4
4
  */
5
5
  export declare class EnvReader {
6
- readonly envFile: string;
6
+ readonly envFiles: string | string[];
7
7
  envsFromFile: Record<string, string>;
8
- constructor(envFile: string);
8
+ constructor(envFiles: string | string[]);
9
9
  get(key: string, defaults: string): string;
10
10
  get(key: string, defaults: number): number;
11
11
  get(key: string, defaults: boolean): boolean;
@@ -4,12 +4,12 @@ import * as dotenv from 'dotenv';
4
4
  * 注意:依赖 dotenv 包
5
5
  */
6
6
  export class EnvReader {
7
- envFile;
7
+ envFiles;
8
8
  envsFromFile = {};
9
- constructor(envFile) {
10
- this.envFile = envFile;
9
+ constructor(envFiles) {
10
+ this.envFiles = envFiles;
11
11
  dotenv.config({
12
- path: this.envFile,
12
+ path: this.envFiles,
13
13
  processEnv: this.envsFromFile, // 把从 .env 文件读到的内容写入到此实例的属性,而不是 process.env
14
14
  });
15
15
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@anjianshi/utils",
3
- "version": "2.1.1",
3
+ "version": "2.1.2",
4
4
  "description": "Common JavaScript Utils",
5
5
  "homepage": "https://github.com/anjianshi/js-packages/utils",
6
6
  "bugs": {