{"ast":null,"code":"import { constructFrom } from \"./constructFrom.mjs\";\nimport { setMonth } from \"./setMonth.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name set\n * @category Common Helpers\n * @summary Set date values to a given date.\n *\n * @description\n * Set date values to a given date.\n *\n * Sets time values to date from object `values`.\n * A value is not set if it is undefined or null or doesn't exist in `values`.\n *\n * Note about bundle size: `set` does not internally use `setX` functions from date-fns but instead opts\n * to use native `Date#setX` methods. If you use this function, you may not want to include the\n * other `setX` functions that date-fns provides if you are concerned about the bundle size.\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 values - The date values to be set\n *\n * @returns The new date with options set\n *\n * @example\n * // Transform 1 September 2014 into 20 October 2015 in a single line:\n * const result = set(new Date(2014, 8, 20), { year: 2015, month: 9, date: 20 })\n * //=> Tue Oct 20 2015 00:00:00\n *\n * @example\n * // Set 12 PM to 1 September 2014 01:23:45 to 1 September 2014 12:00:00:\n * const result = set(new Date(2014, 8, 1, 1, 23, 45), { hours: 12 })\n * //=> Mon Sep 01 2014 12:23:45\n */\n\nexport function set(date, values) {\n  let _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  if (values.year != null) {\n    _date.setFullYear(values.year);\n  }\n  if (values.month != null) {\n    _date = setMonth(_date, values.month);\n  }\n  if (values.date != null) {\n    _date.setDate(values.date);\n  }\n  if (values.hours != null) {\n    _date.setHours(values.hours);\n  }\n  if (values.minutes != null) {\n    _date.setMinutes(values.minutes);\n  }\n  if (values.seconds != null) {\n    _date.setSeconds(values.seconds);\n  }\n  if (values.milliseconds != null) {\n    _date.setMilliseconds(values.milliseconds);\n  }\n  return _date;\n}\n\n// Fallback for modularized imports:\nexport default set;","map":{"version":3,"names":["constructFrom","setMonth","toDate","set","date","values","_date","isNaN","NaN","year","setFullYear","month","setDate","hours","setHours","minutes","setMinutes","seconds","setSeconds","milliseconds","setMilliseconds"],"sources":["/root/rfcontavagas_hom/12.-Servidor-local-Docker/Front-Parking-Angular/node_modules/date-fns/set.mjs"],"sourcesContent":["import { constructFrom } from \"./constructFrom.mjs\";\nimport { setMonth } from \"./setMonth.mjs\";\nimport { toDate } from \"./toDate.mjs\";\n\n/**\n * @name set\n * @category Common Helpers\n * @summary Set date values to a given date.\n *\n * @description\n * Set date values to a given date.\n *\n * Sets time values to date from object `values`.\n * A value is not set if it is undefined or null or doesn't exist in `values`.\n *\n * Note about bundle size: `set` does not internally use `setX` functions from date-fns but instead opts\n * to use native `Date#setX` methods. If you use this function, you may not want to include the\n * other `setX` functions that date-fns provides if you are concerned about the bundle size.\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 values - The date values to be set\n *\n * @returns The new date with options set\n *\n * @example\n * // Transform 1 September 2014 into 20 October 2015 in a single line:\n * const result = set(new Date(2014, 8, 20), { year: 2015, month: 9, date: 20 })\n * //=> Tue Oct 20 2015 00:00:00\n *\n * @example\n * // Set 12 PM to 1 September 2014 01:23:45 to 1 September 2014 12:00:00:\n * const result = set(new Date(2014, 8, 1, 1, 23, 45), { hours: 12 })\n * //=> Mon Sep 01 2014 12:23:45\n */\n\nexport function set(date, values) {\n  let _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  if (values.year != null) {\n    _date.setFullYear(values.year);\n  }\n\n  if (values.month != null) {\n    _date = setMonth(_date, values.month);\n  }\n\n  if (values.date != null) {\n    _date.setDate(values.date);\n  }\n\n  if (values.hours != null) {\n    _date.setHours(values.hours);\n  }\n\n  if (values.minutes != null) {\n    _date.setMinutes(values.minutes);\n  }\n\n  if (values.seconds != null) {\n    _date.setSeconds(values.seconds);\n  }\n\n  if (values.milliseconds != null) {\n    _date.setMilliseconds(values.milliseconds);\n  }\n\n  return _date;\n}\n\n// Fallback for modularized imports:\nexport default set;\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,qBAAqB;AACnD,SAASC,QAAQ,QAAQ,gBAAgB;AACzC,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;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA,OAAO,SAASC,GAAGA,CAACC,IAAI,EAAEC,MAAM,EAAE;EAChC,IAAIC,KAAK,GAAGJ,MAAM,CAACE,IAAI,CAAC;;EAExB;EACA,IAAIG,KAAK,CAAC,CAACD,KAAK,CAAC,EAAE;IACjB,OAAON,aAAa,CAACI,IAAI,EAAEI,GAAG,CAAC;EACjC;EAEA,IAAIH,MAAM,CAACI,IAAI,IAAI,IAAI,EAAE;IACvBH,KAAK,CAACI,WAAW,CAACL,MAAM,CAACI,IAAI,CAAC;EAChC;EAEA,IAAIJ,MAAM,CAACM,KAAK,IAAI,IAAI,EAAE;IACxBL,KAAK,GAAGL,QAAQ,CAACK,KAAK,EAAED,MAAM,CAACM,KAAK,CAAC;EACvC;EAEA,IAAIN,MAAM,CAACD,IAAI,IAAI,IAAI,EAAE;IACvBE,KAAK,CAACM,OAAO,CAACP,MAAM,CAACD,IAAI,CAAC;EAC5B;EAEA,IAAIC,MAAM,CAACQ,KAAK,IAAI,IAAI,EAAE;IACxBP,KAAK,CAACQ,QAAQ,CAACT,MAAM,CAACQ,KAAK,CAAC;EAC9B;EAEA,IAAIR,MAAM,CAACU,OAAO,IAAI,IAAI,EAAE;IAC1BT,KAAK,CAACU,UAAU,CAACX,MAAM,CAACU,OAAO,CAAC;EAClC;EAEA,IAAIV,MAAM,CAACY,OAAO,IAAI,IAAI,EAAE;IAC1BX,KAAK,CAACY,UAAU,CAACb,MAAM,CAACY,OAAO,CAAC;EAClC;EAEA,IAAIZ,MAAM,CAACc,YAAY,IAAI,IAAI,EAAE;IAC/Bb,KAAK,CAACc,eAAe,CAACf,MAAM,CAACc,YAAY,CAAC;EAC5C;EAEA,OAAOb,KAAK;AACd;;AAEA;AACA,eAAeH,GAAG","ignoreList":[]},"metadata":{},"sourceType":"module","externalDependencies":[]}