diff --git a/.vscode/settings.json b/.vscode/settings.json index f881f4e..a0d164f 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,7 +8,6 @@ "editor.codeActionsOnSave": { "source.fixAll": "explicit" }, - "jest.jestCommandLine": "pnpm test --", "[javascript]": { "editor.codeActionsOnSave": { "source.organizeImports": "never" diff --git a/CHANGELOG.md b/CHANGELOG.md index c6d328c..ce27d9d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## JSONView 3.0.1 + +- Fixed a regression where floating-point numbers were truncated to integers. + ## JSONView 3.0.0 - JSONView is now compatible with Manifest V3, which is required in Chrome. diff --git a/README.md b/README.md index cdb79c9..2a79d39 100644 --- a/README.md +++ b/README.md @@ -5,6 +5,7 @@ - [Install for Firefox](https://addons.mozilla.org/en-US/firefox/addon/jsonview/) - [Install for Chrome](https://chrome.google.com/webstore/detail/jsonview/gmegofmjomhknnokphhckolhcffdaihd) - [Install for Edge](https://microsoftedge.microsoft.com/addons/detail/jsonview/kmpfgkgaimakokfhgdahhiaaiidiphco) +- There is no version for Safari because it costs $100/year to publish a free extension to the Mac App Store. Normally, when encountering a [JSON](http://json.org) document (content type `application/json`), Firefox simply prompts you to download the view. With the JSONView extension, JSON documents are shown in the browser similar to how XML documents are shown. The document is formatted, highlighted, and arrays and objects can be collapsed. Even if the JSON document contains errors, JSONView will still show the raw text. @@ -49,3 +50,7 @@ pnpm start ``` `jsonview-chrome.zip` and `jsonview-firefox.zip` can then be manually uploaded to the extension sites. + +- Chrome: https://chrome.google.com/webstore/devconsole/ +- Firefox: https://addons.mozilla.org/en-US/developers/addons +- Edge: https://partner.microsoft.com/en-us/dashboard/microsoftedge/overview diff --git a/package.json b/package.json index 664ef75..6fe7d79 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "id": "jsonview@brh.numbera.com", - "version": "3.0.0", + "version": "3.0.1", "name": "jsonview", "title": "JSONView", "description": "View JSON documents in the browser.", diff --git a/src/jsonformatter.test.ts b/src/jsonformatter.test.ts new file mode 100644 index 0000000..459680a --- /dev/null +++ b/src/jsonformatter.test.ts @@ -0,0 +1,108 @@ +import { strict as assert } from "node:assert"; +import test from "node:test"; +import { valueToHTML } from "./jsonformatter.js"; +import { safeStringEncodeNums } from "./safe-encode-numbers.js"; + +const jsonContent = [ + [`{}`, `{ }`], + [ + `{ "hey": "guy" }`, + `{