node_mutation 1.21.1 → 1.21.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/Gemfile.lock +1 -1
- data/lib/node_mutation/action.rb +5 -0
- data/lib/node_mutation/result.rb +1 -4
- data/lib/node_mutation/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e1f63b9205f77a333104b27187a81f8643d25771c440308eaeebe61133a18128
|
4
|
+
data.tar.gz: 48002aeb8687c03ee62b0cd41f3ac76793873c0039caa9f73d6203ad6aab645d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 249ff1d6f50cb3395d3d8307bbfeedaaa642c9eec532b130fecdb07653bb608bf697ebfa0b4e9c0f6209a323e85c1bc7207aa8141e80f2a81dd258e5e22cbef7
|
7
|
+
data.tar.gz: cbcedfcfa1a60fc2020301d66bd3f56b055d7a150a7db14a562fa927b651abf4ab0e575ab66473ebf150950beb5856f17c0a0264ebd5eeebfc0c744faa6934ca
|
data/CHANGELOG.md
CHANGED
data/Gemfile.lock
CHANGED
data/lib/node_mutation/action.rb
CHANGED
@@ -41,6 +41,11 @@ class NodeMutation::Action
|
|
41
41
|
end
|
42
42
|
end
|
43
43
|
|
44
|
+
def to_struct
|
45
|
+
to_struct_actions = @actions ? @actions.map(&:to_struct) : nil
|
46
|
+
NodeMutation::Struct::Action.new(@type, @start, @end, new_code, to_struct_actions)
|
47
|
+
end
|
48
|
+
|
44
49
|
protected
|
45
50
|
|
46
51
|
# Calculate the begin the end positions.
|
data/lib/node_mutation/result.rb
CHANGED
@@ -19,10 +19,7 @@ class NodeMutation::Result
|
|
19
19
|
end
|
20
20
|
|
21
21
|
def actions=(actions)
|
22
|
-
@actions =
|
23
|
-
actions.map { |action|
|
24
|
-
NodeMutation::Struct::Action.new(action.type, action.start, action.end, action.new_code, action.actions)
|
25
|
-
}
|
22
|
+
@actions = actions.map(&:to_struct)
|
26
23
|
end
|
27
24
|
|
28
25
|
def to_json(*args)
|