apply method
Implementation
Delta apply(
RuleType ruleType,
Document document,
int index, {
int? len,
Object? data,
Attribute? attribute,
}) {
for (final rule in _customRules + _rules) {
if (rule.type != ruleType) {
continue;
}
try {
final result = rule.apply(document, index,
len: len, data: data, attribute: attribute);
if (result != null) {
return result..trim();
}
} catch (e) {
rethrow;
}
}
throw FormatException(
'Apply delta rules failed. No matching rule found for type: $ruleType',
);
}