selectWithAllClasses<T extends DOMNode> method
Returns a node T
that has all classes
.
Implementation
T? selectWithAllClasses<T extends DOMNode>(List<String>? classes) {
if (isEmptyObject(classes) || isEmptyContent) return null;
classes = classes!
.whereType<String>()
.map((c) => c.trim())
.where((c) => c.isNotEmpty)
.toList();
if (classes.isEmpty) return null;
return selectWhere((n) => n is DOMElement && n.containsAllClasses(classes));
}