getProperties method

CustomProperties getProperties()

Implementation

CustomProperties getProperties() {
  final properties = formatSpecificParsing(
    (json) => json.getChildrenAs('properties', Property.parse),
    (xml) =>
        xml
            .getSingleChildOrNull('properties')
            ?.getChildrenAs('property', Property.parse) ??
        [],
  );

  // NOTE: two properties should never have the same name, if they do
  // one will simply override the other
  final byName =
      properties.groupFoldBy((prop) => prop.name, (previous, element) {
    return element;
  });

  return CustomProperties(byName);
}