import toInteger from '../_lib/toInteger/index' ; import toDate from '../toDate/index' ; import requiredArgs from '../_lib/requiredArgs/index' ; name category summary description param { Date | Number } date param { Number } amount returns { Date } throws example export default function addDays ( dirtyDate , dirtyAmount ) { requiredArgs ( 2 , arguments ) ; const date = toDate ( dirtyDate ) ; const amount = toInteger ( dirtyAmount ) ; if ( isNaN ( amount ) ) { return new Date ( NaN ) ; } if ( ! amount ) { return date ; } date . setDate ( date . getDate ( ) + amount ) ; return date ; }