fix: fromJSON should work with any JSON (#883)

* test: fromJSON should work with arrays

* fix: fromJSON should work with any JSON
This commit is contained in:
Mike Beaumont authored and GitHub committed 2021-11-15 14:26:04 +00:00
1 parent 12fa4d703d
commit 09693ec5b9
2 files changed
+3 -2

No files matched your search

+2 -2
View File
@@ -327,8 +327,8 @@ func vmToJSON(vm *otto.Otto) {
}
func vmFromJSON(vm *otto.Otto) {
fromJSON := func(str string) map[string]interface{} {
var dat map[string]interface{}
fromJSON := func(str string) interface{} {
var dat interface{}
err := json.Unmarshal([]byte(str), &dat)
if err != nil {
log.Errorf("Unable to unmarshal: %v", err)