rc-config-loader 2.0.4 → 2.0.5

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.
package/README.md CHANGED
@@ -40,11 +40,13 @@ Install with [npm](https://www.npmjs.com/):
40
40
  ```ts
41
41
  export interface rcConfigLoaderOption {
42
42
  // does look for `package.json`
43
- packageJSON?: boolean,
43
+ packageJSON?: boolean | {
44
+ fieldName: string;
45
+ };
44
46
  // if config file name is not same with packageName, set the name
45
47
  configFileName?: string;
46
48
  // treat default(no ext file) as some extension
47
- defaultExtension?: string | string[],
49
+ defaultExtension?: string | string[];
48
50
  // where start to load
49
51
  cwd?: string;
50
52
  }
@@ -107,7 +109,7 @@ console.log(rcfile("bar", {
107
109
  defaultExtension: [".json", ".yml", ".js"]
108
110
  }));
109
111
 
110
- // try to load as .yml, but it is not json
112
+ // try to load as .json, but it is not json
111
113
  // throw Error
112
114
  try {
113
115
  rcfile("unknown", {
@@ -1,6 +1,10 @@
1
1
  export interface rcConfigLoaderOption {
2
2
  // does look for `package.json`
3
- packageJSON?: boolean;
3
+ packageJSON?:
4
+ | boolean
5
+ | {
6
+ fieldName: string;
7
+ };
4
8
  // if config file name is not same with packageName, set the name
5
9
  configFileName?: string;
6
10
  // treat default(no ext file) as some extension
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "src/"
11
11
  ],
12
12
  "name": "rc-config-loader",
13
- "version": "2.0.4",
13
+ "version": "2.0.5",
14
14
  "description": "load config file from .{product}rc.{json,yml,js}",
15
15
  "main": "lib/rc-config-loader.js",
16
16
  "scripts": {
@@ -1,6 +1,10 @@
1
1
  export interface rcConfigLoaderOption {
2
2
  // does look for `package.json`
3
- packageJSON?: boolean;
3
+ packageJSON?:
4
+ | boolean
5
+ | {
6
+ fieldName: string;
7
+ };
4
8
  // if config file name is not same with packageName, set the name
5
9
  configFileName?: string;
6
10
  // treat default(no ext file) as some extension