constructor(lightbox, options) {
    this.options = {
      ...defaultOptions,
      ...options
    };

    this.lightbox = lightbox;

    this.lightbox.on('init', () => {
      this.pswp = this.lightbox.pswp;
      this.initCaption();
    });
  }
PhotoSwipe Dynamic Caption plugin v1.2.7
https://github.com/dimsemenov/photoswipe-dynamic-caption-plugin

By https://dimsemenov.com