From ad8d962062dde593f1b64a3b3d27ece9ed013150 Mon Sep 17 00:00:00 2001 From: jorenbroekema Date: Mon, 11 Mar 2024 17:57:25 +0100 Subject: [PATCH] chore: fix small type problem --- lib/buildFile.js | 1 + lib/utils/createFormatArgs.js | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/lib/buildFile.js b/lib/buildFile.js index 1b0f1f92a..4c73139e9 100644 --- a/lib/buildFile.js +++ b/lib/buildFile.js @@ -26,6 +26,7 @@ import createFormatArgs from './utils/createFormatArgs.js'; * @typedef {import('../types/Config.d.ts').Config} Config * @typedef {import('../types/File.d.ts').File} File * @typedef {import('../types/Filter.d.ts').Matcher} Matcher + * @typedef {import('../types/Format.d.ts').FormatterArguments} FormatterArguments */ /** diff --git a/lib/utils/createFormatArgs.js b/lib/utils/createFormatArgs.js index c19b1aa12..dceaf36a3 100644 --- a/lib/utils/createFormatArgs.js +++ b/lib/utils/createFormatArgs.js @@ -18,6 +18,7 @@ import deepExtend from './deepExtend.js'; * @typedef {import('../../types/Config.d.ts').PlatformConfig} PlatformConfig * @typedef {import('../../types/Config.d.ts').Config} Options * @typedef {import('../../types/File.d.ts').File} File + * @typedef {import('../../types/Format.d.ts').FormatterArguments} FormatterArguments * /** @@ -28,7 +29,7 @@ import deepExtend from './deepExtend.js'; * options: Options; * file: File; * }} param0 - * @returns + * @returns {FormatterArguments} */ export default function createFormatArgs({ dictionary, platform, options, file }) { const { allTokens, tokens } = dictionary; @@ -41,7 +42,7 @@ export default function createFormatArgs({ dictionary, platform, options, file } // always has the destination prop, then result will be File rather than Partial, so we just typecast it. file = /** @type {File} */ (deepExtend([{}, fileOptsTakenFromPlatform, file])); - return { + return /** @type {FormatterArguments} */ ({ dictionary, allTokens, tokens, @@ -51,5 +52,5 @@ export default function createFormatArgs({ dictionary, platform, options, file } ...(file.options || {}), usesDtcg: options?.usesDtcg ?? false, }, - }; + }); }