Skip to content

Commit c321e8c

Browse files
Mark ApplyInterface as public method
1 parent 659feac commit c321e8c

5 files changed

+43
-172
lines changed

helpers_test.go

-133
This file was deleted.

jsonlogic.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -511,7 +511,7 @@ func Apply(rule, data io.Reader, result io.Writer) error {
511511
return err
512512
}
513513

514-
output, err := applyInterface(_rule, _data)
514+
output, err := ApplyInterface(_rule, _data)
515515
if err != nil {
516516
return err
517517
}
@@ -561,17 +561,17 @@ func ApplyRaw(rule, data json.RawMessage) (json.RawMessage, error) {
561561
return nil, err
562562
}
563563

564-
result, err := applyInterface(_rule, _data)
564+
result, err := ApplyInterface(_rule, _data)
565565
if err != nil {
566566
return nil, err
567567
}
568568

569569
return json.Marshal(&result)
570570
}
571571

572-
// applyInterface receives a rule and data as interface{} and returns the result
572+
// ApplyInterface receives a rule and data as interface{} and returns the result
573573
// of the rule applied to the data.
574-
func applyInterface(rule, data interface{}) (output interface{}, err error) {
574+
func ApplyInterface(rule, data interface{}) (output interface{}, err error) {
575575
defer func() {
576576
if e := recover(); e != nil {
577577
// fmt.Println("stacktrace from panic: \n" + string(debug.Stack()))

0 commit comments

Comments
 (0)