{"size": 692, "ext": "js", "max_stars_repo_path": "lib/virtual-page.js", "max_stars_repo_name": "rasshofer/cms", "max_stars_repo_stars_event_min_datetime": "2017-05-30T09:03:02.000Z", "max_stars_repo_stars_event_max_datetime": "2020-05-23T16:39:59.000Z", "max_issues_repo_path": "lib/virtual-page.js", "max_issues_repo_name": "rasshofer/cms", "max_issues_repo_issues_event_min_datetime": "2020-09-06T09:26:39.000Z", "max_issues_repo_issues_event_max_datetime": "2021-05-09T23:23:45.000Z", "max_forks_repo_path": "lib/virtual-page.js", "max_forks_repo_name": "rasshofer/cms", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": 10, "max_issues_count": 3, "max_forks_count": null, "avg_line_length": 24.7142857143, "max_line_length": 57, "alphanum_fraction": 0.6502890173}
const Page = require('./page');

class VirtualPage extends Page {
  constructor(properties, options, parent) {
    super(false, options, parent);

    this.index = properties.index || 0;
    this.identifier = properties.identifier;
    this.template = properties.template;

    this.setupGlobals(options);
    this.setupHelpers(options);

    this.addVirtualPage = (props) => {
      const page = new VirtualPage(props, options, this);
      this.children.push(page);
      this.children.sort((a, b) => a.index - b.index);
      return page;
    };

    Object.keys(properties).forEach((property) => {
      this[property] = properties[property];
    });
  }
}

module.exports = VirtualPage;
