{"size": 958, "ext": "js", "max_stars_repo_path": "src/Pile.js", "max_stars_repo_name": "mohebifar/pasoor", "max_stars_repo_stars_event_min_datetime": "2016-03-20T21:04:30.000Z", "max_stars_repo_stars_event_max_datetime": "2021-04-23T16:03:26.000Z", "max_issues_repo_path": "src/Pile.js", "max_issues_repo_name": "mohebifar/pasoor", "max_issues_repo_issues_event_min_datetime": "2016-08-10T18:44:44.000Z", "max_issues_repo_issues_event_max_datetime": "2016-08-26T22:41:37.000Z", "max_forks_repo_path": "src/Pile.js", "max_forks_repo_name": "mohebifar/pasoor", "max_forks_repo_forks_event_min_datetime": "2016-08-10T18:22:17.000Z", "max_forks_repo_forks_event_max_datetime": "2016-08-10T18:22:17.000Z"}
{"max_stars_count": 8, "max_issues_count": 6, "max_forks_count": 1, "avg_line_length": 21.2888888889, "max_line_length": 66, "alphanum_fraction": 0.5260960334}
export default class Pile extends Array {
  constructor() {
    super();

    /**
     * Empty out the pile
     *
     * @access  public
     * @return  array
     */
    this.empty = () => this.splice(0, this.length);

    /**
     * Copy all values into a different pile
     *
     * @access  public
     * @param   array
     * @return  void
     */
    this.copyInto = (array) => array.push(...this.slice());

    /**
     * Empty all values and move them into a different pile
     *
     * @access  public
     * @param   array    an array-like object
     * @return  void
     */
    this.emptyInto = (array) => array.push(...this.empty());

    /**
     * Shift off the first value and push it onto a different pile
     *
     * @access  public
     * @param   array    an array-like object
     * @return  mixed
     */
    this.shiftInto = (array) => {
      const value = this.shift();
      array.push(value);
      return value;
    };
  }
}
