sortKeysDesc.js 252 B

1234567891011
  1. 'use strict';
  2. module.exports = function sortKeysDesc() {
  3. var _this = this;
  4. var ordered = {};
  5. Object.keys(this.items).sort().reverse().forEach(function (key) {
  6. ordered[key] = _this.items[key];
  7. });
  8. return new this.constructor(ordered);
  9. };