Skip to content

Commit

Permalink
fix: improve the def command
Browse files Browse the repository at this point in the history
  • Loading branch information
kobenguyent committed Jul 31, 2023
1 parent 4ef0b2a commit 9f03a22
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions lib/command/definitions.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ const actingHelpers = [...require('../plugin/standardActingHelpers'), 'REST'];
* @param {Map} params.supportObject
* @param {Array<string>} params.helperNames
* @param {Array<string>} params.importPaths
* @param {Array<string>} params.customHelpers
* @param params.translations
*
* @returns {string}
Expand All @@ -29,12 +28,10 @@ const getDefinitionsFileContent = ({
supportObject,
importPaths,
translations,
customHelpers,
}) => {
const getHelperListFragment = ({
hasCustomHelper,
hasCustomStepsFile,
customHelpers,
}) => {
if (hasCustomHelper && hasCustomStepsFile) {
return `${['ReturnType<steps_file>', 'WithTranslation<Methods>'].join(', ')}`;
Expand All @@ -50,7 +47,6 @@ const getDefinitionsFileContent = ({
const helpersListFragment = getHelperListFragment({
hasCustomHelper,
hasCustomStepsFile,
customHelpers,
});

const importPathsFragment = importPaths.join('\n');
Expand Down Expand Up @@ -143,7 +139,7 @@ module.exports = function (genPath, options) {
}

if (!actingHelpers.includes(name)) {
customHelpers.push(`WithTranslation<${name}>`);
customHelpers.push(name);
}
}

Expand Down Expand Up @@ -186,7 +182,6 @@ module.exports = function (genPath, options) {
translations,
hasCustomStepsFile,
hasCustomHelper,
customHelpers,
});

// add aliases for translations
Expand Down

0 comments on commit 9f03a22

Please sign in to comment.