You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

12 lines
240 B

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