chore: rename compare to test

This commit is contained in:
Lucas.Xu
2022-08-23 20:34:15 +08:00
parent a2c4f73e7d
commit 8855822fd1

View File

@ -56,7 +56,7 @@ extension TextNodeExtension on TextNode {
bool allSatisfyInSelection(
String styleKey,
Selection selection,
bool Function(dynamic value) compare,
bool Function(dynamic value) test,
) {
final ops = delta.whereType<TextInsert>();
final startOffset =
@ -72,7 +72,7 @@ extension TextNodeExtension on TextNode {
if (start < endOffset && start + length > startOffset) {
if (op.attributes == null ||
!op.attributes!.containsKey(styleKey) ||
!compare(op.attributes![styleKey])) {
!test(op.attributes![styleKey])) {
return false;
}
}