Skip to content

Commit 5054078

Browse files
committed
Use variable name for conditional
1 parent 8592cdb commit 5054078

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/behaviors.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -190,13 +190,12 @@ const behaviorAvailable = <TArgs extends unknown[]>(
190190

191191
const behaviorMatches = <TArgs extends unknown[]>(actualArguments: TArgs) => {
192192
return (behavior: BehaviorEntry<TArgs>): boolean => {
193-
// Check arity
194193
const expectedArguments = behavior.args
195-
const { ignoreExtraArgs } = behavior
196-
if (expectedArguments.length !== actualArguments.length && !ignoreExtraArgs)
194+
const arityMatches = expectedArguments.length === actualArguments.length
195+
if (!arityMatches && !behavior.ignoreExtraArgs) {
197196
return false
197+
}
198198

199-
// Check arguments
200199
return expectedArguments.every((expectedArgument, index) => {
201200
return equals(actualArguments[index], expectedArgument)
202201
})

0 commit comments

Comments
 (0)