createRecap static method
Implementation
static Map<String, dynamic> createRecap(
String namespace,
String ability,
List<String> methods, {
Map limits = const {},
}) {
try {
final sortedMethods = List<String>.from(methods)
..sort((a, b) => a.compareTo(b));
Map<String, dynamic> abilities = {};
for (var method in sortedMethods) {
abilities['$ability/$method'] = [
...(abilities['$ability/$method'] ?? []),
limits,
];
}
return {
'att': {
namespace: Map<String, dynamic>.fromEntries(abilities.entries),
}
};
} catch (e) {
rethrow;
}
}