Repository: date-fns/date-fns
File: src/add/index.js (JavaScript)

Code before:
import toDate from '../toDate/index.js'
import getDaysInMonth from '../getDaysInMonth/index.js'
import toInteger from '../_lib/toInteger/index.js'

/**
 * @name add
 * @category Combined time Helpers
 * @summary Add the specified milliseconds, seconds, minutes, hours, days, months, quarters and years to the given date.
 *
 * @description
 * Add the specified milliseconds ,seconds, minutes, hours, days, months, quarters and years to the given date.
 *
 * - [Changes that are common for the whole library](https://github.com/date-fns/date-fns/blob/master/docs/upgradeGuide.md#Common-Changes).
 *
 * @param {Date|Number} date - the date to be changed
 * @param {Object|Number} amount - the object with milliseconds, seconds, minutes, hours, days, months, quarters and years to be added
 *
 * | Key                 |            Significance              |
 * |---------------------|------------------------------------- |
 * | milliseconds        |   Amount of milliseconds to be added |
 * | seconds             |   Amount of seconds to be added      |
 * | minutes             |   Amount of minutes to be added      |
 * | hours               |   Amount of hours to be added        |
 * | days                |   Amount of days to be added         |
 * | weeks               |   Amount of weeks to be added        |
 * | months              |   Amount of months to be added       |
 * | quarters            |   Amount of quarters to be added     |
 * | years               |   Amount of years to be added        |
 *
 * All values default to 0
 *
 * @returns {Date} the new date with the seconds added
 * @throws {TypeError} 2 arguments required
 *
 * @example
 * // Add followind amount to 'Mon Sep 01 2014 10:20:00 GMT+0530 (India Standard Time)':
 * var result = add(new Date(2014, 8 , 1, 10, 19, 50, 10000), {
 *     milliseconds: 30000,
 *     seconds: 30,
 *     minutes: 9,
 *     hours: 5,
 *     days: 7,
 *     weeks: 1,
 *     months: 9,
 *     quarters: 5,

Review comment (suggestion):
Please align the table cells:

```
 * | Key                 |            Significance              |
 * |---------------------|------------------------------------- |
 * | milliseconds        |   Amount of milliseconds to be added |
```

→

```
 * | Key                 | Significance                       |
 * |---------------------|----------------------------------- |
 * | milliseconds        | Amount of milliseconds to be added |
```

Code after:
import addMonths from '../addMonths/index.js'
import toDate from '../toDate/index.js'
import requiredArgs from '../_lib/requiredArgs/index.js'
import toInteger from '../_lib/toInteger/index.js'

/**
 * @name add
 * @category Common Helpers
 * @summary Add the specified years, months, days, hours, minutes and seconds to the given date.
 *
 * @description
 * Add the specified years, months, days, hours, minutes and seconds to the given date.
 *
 * @param {Date|Number} date - the date to be changed
 * @param {Object} duration - the object with years, months, days, hours, minutes and seconds to be added
 *
 * | Key            | Description                        |
 * |----------------|------------------------------------|
 * | years          | Amount of years to be added        |
 * | months         | Amount of months to be added       |
 * | days           | Amount of days to be added         |
 * | hours          | Amount of hours to be added        |
 * | minutes        | Amount of minutes to be added      |
 * | seconds        | Amount of seconds to be added      |
 *
 * All values default to 0
 *
 * @returns {Date} the new date with the seconds added
 * @throws {TypeError} 2 arguments required
 *
 * @example
 * // Add the following duration to 1 September 2014, 10:19:50
 * var result = add(new Date(2014, 8, 1, 10, 19, 50), {
 *   years: 2,
 *   months: 24,
 *   days: 7,
 *   hours: 5,
 *   minutes: 9,
 *   seconds: 30,
 * })
 * //=> Sat Sep 8 2018 15:29:20
 */
export default function add(dirtyDate, duration) {
  requiredArgs(2, arguments)