prismicio / javascript-kit

Development kit for the Javascript language
https://developers.prismic.io
106 stars 69 forks source link

Fix asHtml and asText-methods for CompositeSlice-fragments #146

Closed petetnt closed 7 years ago

petetnt commented 7 years ago

This PR fixes asHtml and asText methods for CompositeSlice-fragments.

asHtml and asText were being called on the object keys instead of the object values, which resulted in field.asHtml is not a function error. In addition the assignments are wrapped in hasOwnProperty checks to prevent asHtml and asText being called on possible prototype methods that might not have asHtml and/or asText.

srenault commented 7 years ago

Thanks for your PR. We fixed this issue in this PR : https://github.com/prismicio/javascript-kit/pull/147. We add some tests. Sorry for this issue. I'll publish a new version.

petetnt commented 7 years ago

Thanks @srenault!