Skip to content

Commit

Permalink
Release v2.1.0
Browse files Browse the repository at this point in the history
  • Loading branch information
dpilafian committed Dec 7, 2023
1 parent d05d08c commit 06bf801
Show file tree
Hide file tree
Showing 14 changed files with 76 additions and 49 deletions.
2 changes: 1 addition & 1 deletion dist/css/pretty-print-json.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! pretty-print-json v2.0.4 ~~ https://pretty-print-json.js.org ~~ MIT License */
/*! pretty-print-json v2.1.0 ~~ https://pretty-print-json.js.org ~~ MIT License */

/* Layout */
.json-container { font-family: menlo, consolas, monospace; font-style: normal; font-weight: bold; line-height: 1.4em; font-size: 0.9rem; transition: background-color 400ms; }
Expand Down
2 changes: 1 addition & 1 deletion dist/css/pretty-print-json.dark-mode.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! pretty-print-json v2.0.4 ~~ https://pretty-print-json.js.org ~~ MIT License */
/*! pretty-print-json v2.1.0 ~~ https://pretty-print-json.js.org ~~ MIT License */

/* Layout */
.json-container { font-family: menlo, consolas, monospace; font-style: normal; font-weight: bold; line-height: 1.4em; font-size: 0.9rem; transition: background-color 400ms; }
Expand Down
2 changes: 1 addition & 1 deletion dist/css/pretty-print-json.dark-mode.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/css/pretty-print-json.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion dist/css/pretty-print-json.prefers.css
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*! pretty-print-json v2.0.4 ~~ https://pretty-print-json.js.org ~~ MIT License */
/*! pretty-print-json v2.1.0 ~~ https://pretty-print-json.js.org ~~ MIT License */

/* Layout */
.json-container { font-family: menlo, consolas, monospace; font-style: normal; font-weight: bold; line-height: 1.4em; font-size: 0.9rem; transition: background-color 400ms; }
Expand Down
2 changes: 1 addition & 1 deletion dist/css/pretty-print-json.prefers.min.css

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions dist/pretty-print-json.d.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
//! pretty-print-json v2.0.4 ~~ https://pretty-print-json.js.org ~~ MIT License
//! pretty-print-json v2.1.0 ~~ https://pretty-print-json.js.org ~~ MIT License

export type FormatSettings = {
indent: number;
lineNumbers: boolean;
linkUrls: boolean;
linksNewTab: boolean;
quoteKeys: boolean;
trailingComma: boolean;
trailingCommas: boolean;
};
export type FormatOptions = Partial<FormatSettings>;
export type JsonType = 'key' | 'string' | 'number' | 'boolean' | 'null' | 'mark';
Expand Down
10 changes: 6 additions & 4 deletions dist/pretty-print-json.dev.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
//! pretty-print-json v2.0.4 ~~ https://pretty-print-json.js.org ~~ MIT License
//! pretty-print-json v2.1.0 ~~ https://pretty-print-json.js.org ~~ MIT License

const prettyPrintJson = {
version: '2.0.4',
version: '2.1.0',
toHtml(data, options) {
if (!''.at)
String.prototype.at = function (i) { return this.charAt(i + (i < 0 ? this.length : 0)); };
if (options?.['trailingComma'] !== undefined)
options.trailingCommas = options['trailingComma'];
const defaults = {
indent: 3,
lineNumbers: false,
linkUrls: true,
linksNewTab: true,
quoteKeys: false,
trailingComma: true,
trailingCommas: true,
};
const settings = { ...defaults, ...options };
const invalidHtml = /[<>&]|\\"/g;
Expand Down Expand Up @@ -39,7 +41,7 @@ const prettyPrintJson = {
const keyHtml = part.key ? spanTag('key', keyName) + spanTag('mark', ': ') : '';
const valueHtml = part.value ? buildValueHtml(part.value) : '';
const noComma = !part.end || [']', '}'].includes(match.at(-1));
const addComma = settings.trailingComma && match.at(0) === ' ' && noComma;
const addComma = settings.trailingCommas && match.at(0) === ' ' && noComma;
const endHtml = spanTag('mark', addComma ? (part.end ?? '') + ',' : part.end);
return indentHtml + keyHtml + valueHtml + endHtml;
};
Expand Down
10 changes: 6 additions & 4 deletions dist/pretty-print-json.js
Original file line number Diff line number Diff line change
@@ -1,17 +1,19 @@
//! pretty-print-json v2.0.4 ~~ https://pretty-print-json.js.org ~~ MIT License
//! pretty-print-json v2.1.0 ~~ https://pretty-print-json.js.org ~~ MIT License

const prettyPrintJson = {
version: '2.0.4',
version: '2.1.0',
toHtml(data, options) {
if (!''.at)
String.prototype.at = function (i) { return this.charAt(i + (i < 0 ? this.length : 0)); };
if (options?.['trailingComma'] !== undefined)
options.trailingCommas = options['trailingComma'];
const defaults = {
indent: 3,
lineNumbers: false,
linkUrls: true,
linksNewTab: true,
quoteKeys: false,
trailingComma: true,
trailingCommas: true,
};
const settings = { ...defaults, ...options };
const invalidHtml = /[<>&]|\\"/g;
Expand Down Expand Up @@ -39,7 +41,7 @@ const prettyPrintJson = {
const keyHtml = part.key ? spanTag('key', keyName) + spanTag('mark', ': ') : '';
const valueHtml = part.value ? buildValueHtml(part.value) : '';
const noComma = !part.end || [']', '}'].includes(match.at(-1));
const addComma = settings.trailingComma && match.at(0) === ' ' && noComma;
const addComma = settings.trailingCommas && match.at(0) === ' ' && noComma;
const endHtml = spanTag('mark', addComma ? (part.end ?? '') + ',' : part.end);
return indentHtml + keyHtml + valueHtml + endHtml;
};
Expand Down
4 changes: 2 additions & 2 deletions dist/pretty-print-json.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

10 changes: 6 additions & 4 deletions dist/pretty-print-json.umd.cjs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
//! pretty-print-json v2.0.4 ~~ https://pretty-print-json.js.org ~~ MIT License
//! pretty-print-json v2.1.0 ~~ https://pretty-print-json.js.org ~~ MIT License

(function (factory) {
if (typeof module === "object" && typeof module.exports === "object") {
Expand All @@ -13,17 +13,19 @@
Object.defineProperty(exports, "__esModule", { value: true });
exports.prettyPrintJson = void 0;
const prettyPrintJson = {
version: '2.0.4',
version: '2.1.0',
toHtml(data, options) {
if (!''.at)
String.prototype.at = function (i) { return this.charAt(i + (i < 0 ? this.length : 0)); };
if (options?.['trailingComma'] !== undefined)
options.trailingCommas = options['trailingComma'];
const defaults = {
indent: 3,
lineNumbers: false,
linkUrls: true,
linksNewTab: true,
quoteKeys: false,
trailingComma: true,
trailingCommas: true,
};
const settings = { ...defaults, ...options };
const invalidHtml = /[<>&]|\\"/g;
Expand Down Expand Up @@ -51,7 +53,7 @@
const keyHtml = part.key ? spanTag('key', keyName) + spanTag('mark', ': ') : '';
const valueHtml = part.value ? buildValueHtml(part.value) : '';
const noComma = !part.end || [']', '}'].includes(match.at(-1));
const addComma = settings.trailingComma && match.at(0) === ' ' && noComma;
const addComma = settings.trailingCommas && match.at(0) === ' ' && noComma;
const endHtml = spanTag('mark', addComma ? (part.end ?? '') + ',' : part.end);
return indentHtml + keyHtml + valueHtml + endHtml;
};
Expand Down
6 changes: 3 additions & 3 deletions docs/dynamic/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,10 +12,10 @@
<link rel=icon href=https://centerkey.com/graphics/bookmark.png>
<link rel=preconnect href=https://fonts.googleapis.com>
<link rel=preconnect href=https://fonts.gstatic.com crossorigin>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.4/css/all.min.css>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/@fortawesome/fontawesome-free@6.5/css/all.min.css>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/pretty-print-json@2.0/dist/css/pretty-print-json.css>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/dna-engine@3.0/dist/dna-engine.css>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/web-ignition@2.0/dist/reset.min.css>
<link rel=stylesheet href=https://cdn.jsdelivr.net/npm/web-ignition@2.1/dist/reset.min.css>
<style>
body {
max-width: 700px;
Expand Down Expand Up @@ -43,7 +43,7 @@
}
</style>
<script defer src=https://cdn.jsdelivr.net/npm/dna-engine@3.0/dist/dna-engine.min.js></script>
<script defer src=https://cdn.jsdelivr.net/npm/web-ignition@2.0/dist/lib-x.min.js></script>
<script defer src=https://cdn.jsdelivr.net/npm/web-ignition@2.1/dist/lib-x.min.js></script>
<script data-on-load=app.setup data-wait-for=libX>
const app = {
loadModule(module) {
Expand Down
Loading

0 comments on commit 06bf801

Please sign in to comment.