{"version":3,"file":"addMonths.cjs","names":[],"sources":["../../src/date/addMonths.ts"],"sourcesContent":["/**\n * Adds the specified number of months to the given date.\n *\n * @param date - The date to modify\n * @param amount - The number of months to add (can be negative)\n * @returns A new Date object with the months added\n *\n * @example\n * addMonths(new Date('2024-01-15'), 3) // => Date object for 2024-04-15\n * addMonths(new Date('2024-01-15'), -2) // => Date object for 2023-11-15\n */\nexport function addMonths(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.setMonth(result.getMonth() + Math.floor(amount));\n  return result;\n}\n"],"mappings":";;;;;;;;;;;;;AAWA,SAAgB,UAAU,MAAY,QAAsB;CAC1D,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,SAAS,OAAO,SAAS,IAAI,KAAK,MAAM,MAAM,CAAC;CACtD,OAAO;AACT"}