Skip to content

Commit

Permalink
chore: use includes instead of indexOf
Browse files Browse the repository at this point in the history
  • Loading branch information
43081j committed Oct 7, 2024
1 parent 3397d91 commit 300e34f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/error.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ export default function inspectObject(error: Error, options: Options) {
message = message ? `: ${message}` : ''
options.truncate -= message.length + 5
options.seen = options.seen || []
if (options.seen.indexOf(error) >= 0) {
if (options.seen.includes(error)) {
return '[Circular]'
}
options.seen.push(error)
Expand Down
2 changes: 1 addition & 1 deletion src/object.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ export default function inspectObject(object: object, options: Options): string
}
options.truncate -= 4
options.seen = options.seen || []
if (options.seen.indexOf(object) >= 0) {
if (options.seen.includes(object)) {
return '[Circular]'
}
options.seen.push(object)
Expand Down

0 comments on commit 300e34f

Please sign in to comment.