Skip to content

Commit

Permalink
fix: inRange test (#5821)
Browse files Browse the repository at this point in the history
  • Loading branch information
ygj6 committed Apr 16, 2024
1 parent c7c70a7 commit a67a085
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
8 changes: 7 additions & 1 deletion src/inRange.ts
@@ -1,4 +1,6 @@
import baseInRange from './.internal/baseInRange.js';
import toFinite from './toFinite';
import toNumber from './toNumber';

/**
* Checks if `number` is between `start` and up to, but not including, `end`. If
Expand Down Expand Up @@ -37,11 +39,15 @@ import baseInRange from './.internal/baseInRange.js';
* // => true
*/
function inRange(number, start, end) {
start = toFinite(start);
if (end === undefined) {
end = start;
start = 0;
} else {
end = toFinite(end);
}
return baseInRange(+number, +start, +end);
number = toNumber(number);
return baseInRange(number, start, end);
}

export default inRange;
2 changes: 1 addition & 1 deletion test/inRange.spec.js
Expand Up @@ -48,6 +48,6 @@ describe('inRange', () => {
inRange(-1, -1, NaN),
];

expect(actual, lodashStable.map(actual).toEqual(stubTrue));
expect(actual).toEqual(lodashStable.map(actual,stubTrue));
});
});

0 comments on commit a67a085

Please sign in to comment.