query method

Iterable<(bool, Script)> query(
  1. String query
)

Implementation

Iterable<(bool, Script)> query(String query) sync* {
  if (_matchesQuery(this, query)) {
    yield (true, this);
  }

  final scripts = this.scripts?.scripts.values ?? [];

  for (final script in scripts) {
    final hasMatch = _matchesQuery(script, query);
    yield (hasMatch, script);

    if (hasMatch) continue;

    yield* script.query(query);
  }
}