Skip to content

Commit

Permalink
fix(mutator): correctly check if custom instance is a hook
Browse files Browse the repository at this point in the history
  • Loading branch information
anymaniax committed Aug 23, 2022
1 parent 2c2a142 commit d921c2f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/core/generators/mutator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,8 +82,8 @@ export const generateMutator = async ({
const path = getImport(output, mutator);

const isHook = mutator.name
? !!mutator.name.startsWith('use') && !!mutatorInfo.returnNumberOfParams
: !!mutatorInfo.returnNumberOfParams;
? !!mutator.name.startsWith('use') && !mutatorInfo.numberOfParams
: !mutatorInfo.numberOfParams;

return {
name: mutator.name || !isHook ? importName : `use${pascal(importName)}`,
Expand Down

0 comments on commit d921c2f

Please sign in to comment.