Skip to content

Commit dcfa8e9

Browse files
committed
Fixed display of truncated string in SuperDebug.
1 parent 2690e81 commit dcfa8e9

File tree

3 files changed

+18
-1
lines changed

3 files changed

+18
-1
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+
### Fixed
11+
12+
- SuperDebug truncate length showed only the whole string length, not the truncated.
13+
814
## [1.4.0] - 2023-07-20
915

1016
### Fixed

src/lib/client/SuperDebug.svelte

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@
162162
match =
163163
stringTruncate > 0 && match.length > stringTruncate
164164
? match.slice(0, stringTruncate / 2) +
165-
`[..${match.length}..]` +
165+
`[..${match.length - stringTruncate}/${match.length}..]` +
166166
match.slice(-stringTruncate / 2)
167167
: match;
168168

src/routes/super-debug/+page.svelte

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -216,6 +216,17 @@
216216
>.
217217
</p>
218218
</section>
219+
220+
<section>
221+
<h4>SuperDebug and long strings</h4>
222+
<SuperDebug
223+
data={{
224+
longString:
225+
'The long name without any apparent end, goes on like a wind, however that is supposed to be. Very long. And winded. Long-winded so to speak.'
226+
}}
227+
label="Truncated string"
228+
/>
229+
</section>
219230
</main>
220231

221232
<style>

0 commit comments

Comments
 (0)