orderRouteKeys method

  1. @visibleForTesting
List<ModularKey> orderRouteKeys(
  1. Iterable<ModularKey> keys
)
inherited

Implementation

@visibleForTesting
List<ModularKey> orderRouteKeys(Iterable<ModularKey> keys) {
  List<ModularKey> ordenatekeys = [...keys];
  ordenatekeys.sort((preview, actual) {
    if (preview.name.contains('/:') && !actual.name.contains('**')) {
      return 1;
    }

    if (preview.name.contains('**')) {
      if (!actual.name.contains('**')) {
        return 1;
      } else if (actual.name.split('/').length >
          preview.name.split('/').length) {
        return 1;
      }
    }

    return 0;
  });
  return ordenatekeys;
}