lib/pages.js
function decorate(pages, page) {
  Object.defineProperties(page, {
    first: {
      enumerable: true,
      set: function() {},
      get: function() {
        return pages.first && pages.first.current;
      }
    },

    current: {
      enumerable: true,
      set: function() {},
      get: function() {
        return this.idx + 1;
      }
    },

    last: {
      enumerable: true,
      set: function() {},
      get: function() {
        return pages.last && pages.last.current;
      }
    },

    total: {
      enumerable: true,
      set: function() {},
      get: function() {
        return pages.total;
      }
    }
  });

  var prev = pages.last;
  var idx = pages.total;
  page.idx = idx;
  if (prev) {
    page.prev = prev.current;
    prev.next = page.current;
  }
  return page;
}
function decorate(pages, page) {
  Object.defineProperties(page, {
    first: {
      enumerable: true,
      set: function() {},
      get: function() {
        return pages.first && pages.first.current;
      }
    },

    current: {
      enumerable: true,
      set: function() {},
      get: function() {
        return this.idx + 1;
      }
    },

    last: {
      enumerable: true,
      set: function() {},
      get: function() {
        return pages.last && pages.last.current;
      }
    },

    total: {
      enumerable: true,
      set: function() {},
      get: function() {
        return pages.total;
      }
    }
  });

  var prev = pages.last;
  var idx = pages.total;
  page.idx = idx;
  if (prev) {
    page.prev = prev.current;
    prev.next = page.current;
  }
  return page;
}
function decorate ( pages , page ) { Object . defineProperties ( page , { first : { enumerable : true , set : function ( ) { } , get : function ( ) { return pages . first && pages . first . current ; } } , current : { enumerable : true , set : function ( ) { } , get : function ( ) { return this . idx + 1 ; } } , last : { enumerable : true , set : function ( ) { } , get : function ( ) { return pages . last && pages . last . current ; } } , total : { enumerable : true , set : function ( ) { } , get : function ( ) { return pages . total ; } } } ) ; var prev = pages . last ; var idx = pages . total ; page . idx = idx ; if ( prev ) { page . prev = prev . current ; prev . next = page . current ; } return page ; }
Decorates a page with additional properties.

@param  {Object} `page` Instance of page to decorate
@return {Object} Returns the decorated page to be added to the list
Decorates a page with additional properties .