use default argument value
Some checks failed
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
ci/woodpecker/pr/lint-backend Pipeline failed
ci/woodpecker/pr/lint-foundkey-js Pipeline was successful
ci/woodpecker/pr/build Pipeline was successful
ci/woodpecker/pr/lint-client Pipeline failed
ci/woodpecker/pr/test Pipeline failed

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: 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)}`);