groupPropsByOp static method
Iterable<({ProppatchRequestOp op, List<ProppatchRequestProp<ToXmlCapable> > props})>
groupPropsByOp(
- Iterable<
ProppatchRequestProp< propsToXmlCapable> >
Implementation
static Iterable<({ProppatchRequestOp op, List<ProppatchRequestProp> props})>
groupPropsByOp(Iterable<ProppatchRequestProp> props) {
final result =
<({ProppatchRequestOp op, List<ProppatchRequestProp> props})>[];
var currentProps = <ProppatchRequestProp>[];
ProppatchRequestOp? currentOp;
for (var prop in props) {
if (currentOp != prop.op) {
currentOp = prop.op;
currentProps = [];
result.add((op: prop.op, props: currentProps));
}
currentProps.add(prop);
}
return result;
}