use default argument value

This unifies the style with the other function in that file and fixes
the lint "no-param-reassign".
This commit is contained in:
Johann150 2022-12-01 20:32:57 +01:00
parent 11a6e706f4
commit 936cbf900b
Signed by untrusted user: Johann150
GPG key ID: 9EE6577A2A06F8F1

View file

@ -39,7 +39,7 @@ export async function extractPollFromQuestion(source: string | IObject, resolver
* @param resolver Resolver to use
* @returns true if updated
*/
export async function updateQuestion(value: string | IObject, resolver?: Resolver) {
export async function updateQuestion(value: string | IObject, resolver?: Resolver = new Resolver()) {
const uri = typeof value === 'string' ? value : value.id;
// URIがこのサーバーを指しているならスキップ
@ -54,7 +54,6 @@ export async function updateQuestion(value: string | IObject, resolver?: Resolve
//#endregion
// resolve new Question object
if (resolver == null) resolver = new Resolver();
const question = await resolver.resolve(value) as IQuestion;
apLogger.debug(`fetched question: ${JSON.stringify(question, null, 2)}`);