We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 36eb902 commit d0d944dCopy full SHA for d0d944d
jsonlogic.go
@@ -129,3 +129,19 @@ func AddOperation(name string, op Operation) {
129
func (jl *JSONLogic) AddOperation(name string, op Operation) {
130
jl.ops[name] = op
131
}
132
+
133
+// Clone is equivalent to DefaultJSONLogic.Clone.
134
+func Clone() *JSONLogic {
135
+ return DefaultJSONLogic.Clone()
136
+}
137
138
+// Clone clones a JSONLogic instance.
139
+func (jl *JSONLogic) Clone() *JSONLogic {
140
+ ret := &JSONLogic{
141
+ ops: make(map[string]Operation),
142
+ }
143
+ for k, v := range jl.ops {
144
+ ret.ops[k] = v
145
146
+ return ret
147
0 commit comments