fix(TypeScript): context.config() type (#1252)

This commit is contained in:
FoseFx 2020-07-10 21:04:46 +02:00 committed by GitHub
parent 3f0d529d1d
commit 8f626590cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -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
}
/**