Closed dreamorosi closed 10 months ago
All modified and coverable lines are covered by tests :white_check_mark:
Comparison is base (
6a9f999
) 83.41% compared to head (4a2e140
) 83.49%. Report is 1 commits behind head on master.:exclamation: Current head 4a2e140 differs from pull request most recent head b3e3567. Consider uploading reports for the commit b3e3567 to get more accurate results
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
Hi @carolabadeer thanks for the review and the comments, I have committed both your suggestions!
Issue #, if available: closes #616
Description of changes:
This PR introduces a new method called
serialize
to the prototype of theSegment
andSubsegment
objects. This method wraps theJSON.stringify()
call that was previously made by thetoString()
andformat()
methods of these two classes.When calling the
JSON.stringify()
function, the method also passes a replacer function. This replacer for now includes anif
statement that castsBigInt
objects tostring
. This avoids runtimes errors described in the linked issue.By extracting the method, customers can easily override it and extend the replacer to suit their needs.
In addition to the method, the PR includes also changes to the type definition and the addition of a test.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.