import toDate from '../toDate/index' ; import isLeapYear from '../isLeapYear/index' ; import requiredArgs from '../_lib/requiredArgs/index' ; name category summary description param { Date | Number } date returns { Number } throws example export default function getDaysInYear ( dirtyDate ) { requiredArgs ( 1 , arguments ) ; const date = toDate ( dirtyDate ) ; if ( String ( new Date ( date ) ) === 'Invalid Date' ) { return NaN ; } return isLeapYear ( date ) ? 366 : 365 ; }