From a83aa1062784ecd86eb1ca15abd68070be37ee3e Mon Sep 17 00:00:00 2001 From: hexbabe Date: Tue, 19 Nov 2024 12:25:56 -0500 Subject: [PATCH] Improve naming --- lib/src/utils.dart | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/lib/src/utils.dart b/lib/src/utils.dart index 4cba7b923ba..6a4da7d1dde 100644 --- a/lib/src/utils.dart +++ b/lib/src/utils.dart @@ -39,8 +39,8 @@ extension StructUtils on Struct { } } -extension UnwrapProtoMapUtils on Map { - /// Deeply unwraps a nested proto map structure by removing unnecessary proto wrappers and +extension ProtoMapUtils on Map { + /// Deeply unwraps a map derived from a proto struct by removing unnecessary proto wrappers and /// converting all nested values to their primitive Dart types. /// /// Handles: @@ -81,6 +81,7 @@ extension UnwrapProtoMapUtils on Map { return []; } + // 2a. Fields wrapper (from proto Struct) if (kindMap.containsKey('StructValue')) { final structValue = kindMap['StructValue']; if (structValue is Map && structValue.containsKey('fields')) { @@ -91,7 +92,7 @@ extension UnwrapProtoMapUtils on Map { return value; } - // 2. Fields wrapper (from proto Struct) + // 2b. Fields wrapper (from proto Struct) if (mapValue.containsKey('fields')) { return Map.from(mapValue['fields']).unwrap(); }