getChildNamespaces static method

List<String> getChildNamespaces(
  1. String namespace,
  2. List<String> channels
)

Get all child namespaces of a namespace

Implementation

static List<String> getChildNamespaces(
    String namespace, List<String> channels) {
  if (!namespace.startsWith('/')) {
    return [];
  }

  return channels
      .where((channel) => isInNamespace(channel, namespace))
      .toList();
}