cosmiconfig options should be optional

This commit is contained in:
Saad Quadri
2018-05-13 17:14:42 -04:00
committed by saadq
parent 9028a63234
commit f31b54d5b7
2 changed files with 4 additions and 1 deletions
+2
View File
@@ -11,6 +11,8 @@ const explorer = cosmiconfig("yourModuleName", {
ignoreEmptySearchPlaces: false,
});
const explorer2 = cosmiconfig("yourModuleName");
Promise.all([
explorer.search(path.join(__dirname)),
explorer.searchSync(path.join(__dirname)),
+2 -1
View File
@@ -2,6 +2,7 @@
// Project: https://github.com/davidtheclark/cosmiconfig
// Definitions by: ozum <https://github.com/ozum>
// szeck87 <https://github.com/szeck87>
// saadq <https://github.com/saadq>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
// TypeScript Version: 2.2
@@ -55,4 +56,4 @@ export interface ExplorerOptions {
ignoreEmptySearchPlaces?: boolean;
}
export default function cosmiconfig(moduleName: string, options: ExplorerOptions): Explorer;
export default function cosmiconfig(moduleName: string, options?: ExplorerOptions): Explorer;