An unexpected type returned from dayjs.minMax when called with empty array - revisit
Open
- Dominant language
- JavaScript
- Stars
- 48.7k
- Forks
- 2.5k
- PR merge metrics
- No merged PRs in 30d
Description
Describe the bug
An empty array is very unexpected here:
typeof dayjs.max([]) === 'array'; // true
there's an example:
https://jsfiddle.net/7y5f6r3g/1/
Expected behavior
I know this is already been raised in #1061 but changes done for this fix doesn't seems correct to me, be should written dayjs object when argument is an empty array and null when passing null.
Information
Day.js Version 1.8.36
OS: OSX
Browser Chrome
Contributor guide
Assessment
This issue has not been assessed yet.