Skip to content

Commit

Permalink
Add comment
Browse files Browse the repository at this point in the history
  • Loading branch information
ehmicky committed Jun 5, 2022
1 parent bd4c631 commit 71f4a52
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/error/normalize/main.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,8 @@ const isDefinedString = function (value) {
return typeof value === 'string' && value !== ''
}

// Recurse over `error.cause`
// Recurse over `error.cause`.
// Skip `error.cause` if infinitely recursive.
const normalizeCause = function (error, parents) {
if (error.cause === undefined) {
return
Expand All @@ -70,6 +71,7 @@ const normalizeCause = function (error, parents) {

// Recurse over `error.errors`.
// Also ensure `AggregateError` instance have an `errors` property.
// Skip `error.errors` that are infinitely recursive.
const normalizeAggregate = function (error, parents) {
if (Array.isArray(error.errors)) {
const aggregateErrors = error.errors
Expand Down

0 comments on commit 71f4a52

Please sign in to comment.