Skip to content

Commit 2a0ff31

Browse files
committed
SuperDebug support for Map and Set
1 parent 467cc2b commit 2a0ff31

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

CHANGELOG.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,12 @@ Headlines: Added, Changed, Deprecated, Removed, Fixed, Security
55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
66
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
77

8+
## [Unreleased]
9+
10+
### Added
11+
12+
- [SuperDebug](https://superforms.rocks/super-debug) support for `Map` and `Set`.
13+
814
## [2.12.2] - 2024-03-29
915

1016
### Fixed

src/lib/client/SuperDebug.svelte

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -291,6 +291,12 @@
291291
if (value instanceof Error) {
292292
return '#}E#' + `${value.name}: ${value.message || value.cause || '(No error message)'}`;
293293
}
294+
if (value instanceof Set) {
295+
return Array.from(value);
296+
}
297+
if (value instanceof Map) {
298+
return Array.from(value.entries());
299+
}
294300
if (browser && typeof this === 'object' && this[key] instanceof File) {
295301
return fileToJSON(this[key]);
296302
}

0 commit comments

Comments
 (0)