Sha256: 9afbac93286bd6d97e6609056863d26b661d22b4bfb1c678477e5a108c52a304
Contents?: true
Size: 414 Bytes
Versions: 17
Compression:
Stored size: 414 Bytes
Contents
# frozen_string_literal: true module Synvert::Core # IfOnlyExistCondition checks if node has only one child node and the child node matches rules. class Rewriter::IfOnlyExistCondition < Rewriter::Condition # check if only have one child node and the child node matches rules. def match? @instance.current_node.body.size == 1 && @instance.current_node.body.first.match?(@rules) end end end
Version data entries
17 entries across 17 versions & 1 rubygems