Skip to content

Commit 0c79423

Browse files
committed
Use safe navigation (&.) instead of checking if an object exists before calling the method.
1 parent c6aabb1 commit 0c79423

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/packwerk/node.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def parent_module_name(ancestors:)
188188
end
189189

190190
def type(node)
191-
node && node.type
191+
node?.type
192192
end
193193

194194
def value_from_hash(hash_node, key)

0 commit comments

Comments
 (0)