浏览代码

chore: rename compare to test

Lucas.Xu 2 年之前
父节点
当前提交
8855822fd1

+ 2 - 2
frontend/app_flowy/packages/appflowy_editor/lib/src/extensions/text_node_extensions.dart

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