code: function checkDBSize () {
      if (destroyed) {
        logger.warn('Couldn\'t check db size after destroy');
        return Promise.resolve();
      }
  
      return db.info()
        .then(function (response) {
          if (!response) return;
  
          // We want to call 'getDiskSize' directly without ignoring errors.
          // https://github.com/pouchdb/pouchdb-size/issues/22
          return db.getDiskSize()
            .then(function (diskSize) {
              // Handlers should be called only once
              // after the first reaching of a checkpoint.
              if (diskSize >= checkpoint) {
                handlers.forEach(function (handler) {
                  handler(checkpoint);
                });
              }
            });
        })
        .catch(function (error) {
          logger.error(
            'Error while fetching db info: \'%s\', stack: \'%s\'',
            String(error), error.stack
          );
          db.emit('error', error);
        });
    }
docs: Private methods