Skip to content

Commit

Permalink
fix(fix the absence of circular structure treatment): fix the lack of…
Browse files Browse the repository at this point in the history
… circular structure treatment

The Step class uses JSON.stringify without the callback function to handle circular structures. When
passing an object with a circular structure it shows the error "TypeError: Converting circular
structure to JSON" and interrupts code execution. Now, the Step class performs the packaging of
objects with circular structures.

#46
  • Loading branch information
KelvinFelix committed Aug 18, 2021
1 parent 09985c4 commit 807a430
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/step.js
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ class Step {
}

let circularStructureCache = []
const _circularStructureHandling = (key, value) => {
const _circularStructureHandling = (_, value) => {
if (typeof value === 'object' && value !== null) {
if (circularStructureCache.includes(value)) return
circularStructureCache.push(value)
Expand Down

0 comments on commit 807a430

Please sign in to comment.