TexteaInc / json-viewer

not only a JSON viewer
https://viewer.textea.io
MIT License
455 stars 36 forks source link

feat: support `displayComma` for showing comma #509

Closed pionxzh closed 2 months ago

pionxzh commented 2 months ago

closes #492

This PR adds the ability to show a comma at the end of the line. The initial goal of adding this is to allow the end user to select any part of the json view to copy valid json string. This PR also fixed a few edge cases to achieve the goal. But some special data types like Date, Function, BigInt, undefined and null are not rendered in a JSON-valid way. You will have to override their display or disallow these data in the source value.

image

netlify[bot] commented 2 months ago

Deploy Preview for any-viewer ready!

Name Link
Latest commit f503dde7139245760d01970cd353f58ba4eadf8f
Latest deploy log https://app.netlify.com/sites/any-viewer/deploys/66ccc90791075b00089dcc28
Deploy Preview https://deploy-preview-509--any-viewer.netlify.app
Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

codecov[bot] commented 2 months ago

Codecov Report

Attention: Patch coverage is 86.20690% with 12 lines in your changes missing coverage. Please review.

Project coverage is 67.89%. Comparing base (0b4393b) to head (f503dde). Report is 10 commits behind head on main.

Files Patch % Lines
docs/pages/full/index.tsx 0.00% 12 Missing :warning:
Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #509 +/- ## ========================================== + Coverage 67.53% 67.89% +0.35% ========================================== Files 37 37 Lines 3462 3535 +73 Branches 437 445 +8 ========================================== + Hits 2338 2400 +62 - Misses 1111 1122 +11 Partials 13 13 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

socket-security[bot] commented 2 months ago

New and removed dependencies detected. Learn more about Socket for GitHub โ†—๏ธŽ

Package New capabilities Transitives Size Publisher

๐Ÿšฎ Removed packages: npm/@eslint/config-array@0.17.1), npm/@eslint/eslintrc@3.1.0), npm/@eslint/js@9.9.0), npm/@eslint/object-schema@2.1.4), npm/@humanwhocodes/retry@0.3.0), npm/doctrine@2.1.0), npm/eslint-scope@8.0.2), npm/eslint@9.9.0), npm/espree@10.1.0), npm/file-entry-cache@8.0.0), npm/flat-cache@4.0.1)

View full reportโ†—๏ธŽ