{"version":3,"file":"addDays.mjs","names":[],"sources":["../../src/date/addDays.ts"],"sourcesContent":["/**\n * Adds the specified number of days to the given date.\n *\n * @param date - The date to modify\n * @param amount - The number of days to add (can be negative)\n * @returns A new Date object with the days added\n *\n * @example\n * addDays(new Date('2024-01-15'), 5) // => Date object for 2024-01-20\n * addDays(new Date('2024-01-15'), -3) // => Date object for 2024-01-12\n */\nexport function addDays(date: Date, amount: number): Date {\n  if (!(date instanceof Date) || isNaN(date.getTime())) {\n    return new Date(NaN);\n  }\n\n  if (typeof amount !== 'number' || !isFinite(amount)) {\n    return new Date(NaN);\n  }\n\n  const result = new Date(date);\n  result.setDate(result.getDate() + Math.floor(amount));\n  return result;\n}\n"],"mappings":";;;;;;;;;;;;AAWA,SAAgB,QAAQ,MAAY,QAAsB;CACxD,IAAI,EAAE,gBAAgB,SAAS,MAAM,KAAK,QAAQ,CAAC,GACjD,uBAAO,IAAI,KAAK,GAAG;CAGrB,IAAI,OAAO,WAAW,YAAY,CAAC,SAAS,MAAM,GAChD,uBAAO,IAAI,KAAK,GAAG;CAGrB,MAAM,SAAS,IAAI,KAAK,IAAI;CAC5B,OAAO,QAAQ,OAAO,QAAQ,IAAI,KAAK,MAAM,MAAM,CAAC;CACpD,OAAO;AACT"}