forked from mirrors/probot
fix(TypeScript): context.config() type (#1252)
This commit is contained in:
parent
3f0d529d1d
commit
8f626590cb
|
@ -189,7 +189,7 @@ export class Context<E extends WebhookPayloadWithRepository = any> implements We
|
|||
* @param deepMergeOptions - Controls merging configs (from the [deepmerge](https://github.com/TehShrike/deepmerge) module)
|
||||
* @return Configuration object read from the file
|
||||
*/
|
||||
public async config<T> (fileName: string, defaultConfig?: T, deepMergeOptions?: MergeOptions): Promise<object | null> {
|
||||
public async config<T> (fileName: string, defaultConfig?: T, deepMergeOptions?: MergeOptions): Promise<T | null> {
|
||||
const params = this.repo({ path: path.posix.join(CONFIG_PATH, fileName) })
|
||||
const config = await this.loadYaml(params)
|
||||
|
||||
|
@ -219,7 +219,7 @@ export class Context<E extends WebhookPayloadWithRepository = any> implements We
|
|||
// filter out null configs
|
||||
[defaultConfig, baseConfig, config].filter(conf => conf),
|
||||
deepMergeOptions
|
||||
)
|
||||
) as unknown as T
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue