fix(gen): replace named function with anonymous
Merge pull request #875 from cebor/patch-2

fix(gen): replace named function with anonymous