{"ast":null,"code":"import { constructFrom } from \"./constructFrom.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name setYear\n * @category Year Helpers\n * @summary Set the year to the given date.\n *\n * @description\n * Set the year to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param year - The year of the new date\n *\n * @returns The new date with the year set\n *\n * @example\n * // Set year 2013 to 1 September 2014:\n * const result = setYear(new Date(2014, 8, 1), 2013)\n * //=> Sun Sep 01 2013 00:00:00\n */\nexport function setYear(date, year) {\n  const _date = toDate(date);\n\n  // Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date\n  if (isNaN(+_date)) {\n    return constructFrom(date, NaN);\n  }\n  _date.setFullYear(year);\n  return _date;\n}\n\n// Fallback for modularized imports:\nexport default setYear;","map":{"version":3,"names":["constructFrom","toDate","setYear","date","year","_date","isNaN","NaN","setFullYear"],"sources":["/root/rfcontavagas_hom/12.-Servidor-local-Docker/Front-Parking-Angular/node_modules/date-fns/setYear.mjs"],"sourcesContent":["import { constructFrom } from \"./constructFrom.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name setYear\n * @category Year Helpers\n * @summary Set the year to the given date.\n *\n * @description\n * Set the year to the given date.\n *\n * @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).\n *\n * @param date - The date to be changed\n * @param year - The year of the new date\n *\n * @returns The new date with the year set\n *\n * @example\n * // Set year 2013 to 1 September 2014:\n * const result = setYear(new Date(2014, 8, 1), 2013)\n * //=> Sun Sep 01 2013 00:00:00\n */\nexport function setYear(date, year) {\n  const _date = toDate(date);\n\n  // Check if date is Invalid Date because Date.prototype.setFullYear ignores the value of Invalid Date\n  if (isNaN(+_date)) {\n    return constructFrom(date, NaN);\n  }\n\n  _date.setFullYear(year);\n  return _date;\n}\n\n// Fallback for modularized imports:\nexport default setYear;\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,qBAAqB;AACnD,SAASC,MAAM,QAAQ,cAAc;;AAErC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,SAASC,OAAOA,CAACC,IAAI,EAAEC,IAAI,EAAE;EAClC,MAAMC,KAAK,GAAGJ,MAAM,CAACE,IAAI,CAAC;;EAE1B;EACA,IAAIG,KAAK,CAAC,CAACD,KAAK,CAAC,EAAE;IACjB,OAAOL,aAAa,CAACG,IAAI,EAAEI,GAAG,CAAC;EACjC;EAEAF,KAAK,CAACG,WAAW,CAACJ,IAAI,CAAC;EACvB,OAAOC,KAAK;AACd;;AAEA;AACA,eAAeH,OAAO","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}