Skip to content

Commit 8fda7ff

Browse files
authored
Revert "Fix mix with string keys ending in !" (#972)
Reverts #967
2 parents 148c027 + ea07b7a commit 8fda7ff

2 files changed

Lines changed: 2 additions & 14 deletions

File tree

lib/phlex/helpers.rb

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -36,14 +36,7 @@ module Phlex::Helpers
3636
end
3737

3838
result.transform_keys! do |key|
39-
case key
40-
when Symbol
41-
key.end_with?("!") ? key.name.chop.to_sym : key
42-
when String
43-
key.end_with?("!") ? key.chop.to_sym : key
44-
else
45-
key
46-
end
39+
key.end_with?("!") ? key.name.chop.to_sym : key
4740
end
4841
end
4942
end

quickdraw/helpers/mix.test.rb

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -65,16 +65,11 @@
6565
assert_equal output, { class: ["foo", "bar"] }
6666
end
6767

68-
test "override with symbol key" do
68+
test "override" do
6969
output = mix({ class: "foo" }, { class!: "bar" })
7070
assert_equal output, { class: "bar" }
7171
end
7272

73-
test "override with string key" do
74-
output = mix({ class: "foo" }, { "class!" => "bar" })
75-
assert_equal output, { class: "bar" }
76-
end
77-
7873
test "set + set" do
7974
output = mix({ class: Set["foo"] }, { class: Set["bar"] })
8075
assert_equal output, { class: Set["foo", "bar"] }

0 commit comments

Comments
 (0)