sort(list, by = list, ...options) {
      var _options$order;

      options = Object.assign({}, ...options);
      let collatorOptions = Object.assign({
        numeric: true
      }, options);
      let collator = new Intl.Collator(options.lang || Mavo.locale, collatorOptions);

      if (!Array.isArray(by)) {
        by = _.get(list, by);
      }

      let desc = (_options$order = options.order) === null || _options$order === void 0 ? void 0 : _options$order.startsWith("desc");
      let arr = list.map((a, i) => [a, by[i]]);
      arr = arr.sort((a, b) => {
        let bya = a[1];
        let byb = b[1];
        return collator.compare(bya, byb) * (desc ? -1 : 1);
      });
      return arr.map(a => a[0]);
    }
Max of an array of numbers