sortKeys.js 238 B

1234567891011
  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. };