Skip to content

Commit

Permalink
feat: add decircular package
Browse files Browse the repository at this point in the history
  • Loading branch information
rellafella committed Feb 24, 2025
1 parent b8cb775 commit 2eef5bb
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 2 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,7 @@
"bumpp": "^10.0.3",
"chalk": "^5.4.1",
"cosmiconfig": "^9.0.0",
"decircular": "^1.0.0",
"deepmerge": "^4.3.1",
"esbuild": "^0.25.0",
"execa": "^9.5.2",
Expand Down
1 change: 1 addition & 0 deletions packages/cspell-config/dictionaries/envsa-misc.txt
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@ darkgreen
darkmode
datetime
ddev
decircular
deepmerge
defaultstatus
deployignore
Expand Down
2 changes: 1 addition & 1 deletion packages/eslint-config/src/globs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ export const GLOB_SVELTE = '**/*.svelte';
export const GLOB_YAML = '**/*.y?(a)ml';
export const GLOB_XML = '**/*.xml';
export const GLOB_SVG = '**/*.svg';
export const GLOB_HTML = '**/*.{htm?(l),twig}';
export const GLOB_HTML = '**/*.htm?(l)';
export const GLOB_GRAPHQL = '**/*.{g,graph}ql';

export const GLOB_MARKDOWN_CODE = `${GLOB_MARKDOWN}/${GLOB_SRC}`;
Expand Down
10 changes: 10 additions & 0 deletions pnpm-lock.yaml

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

3 changes: 2 additions & 1 deletion src/json-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

import jsonColorizer from '@pinojs/json-colorizer';
import type { ArrayMergeOptions, Options } from 'deepmerge';
import decircular from 'decircular';
import deepmerge from 'deepmerge';
import jsonStringifyPrettyCompact from 'json-stringify-pretty-compact';

Expand All @@ -12,7 +13,7 @@ import jsonStringifyPrettyCompact from 'json-stringify-pretty-compact';
*/
export function stringify(object: any): string {
return jsonColorizer(
jsonStringifyPrettyCompact(object, {
jsonStringifyPrettyCompact(decircular(object), {
indent: 2,
replacer(_, value) {
if (typeof value === 'function') {
Expand Down

0 comments on commit 2eef5bb

Please sign in to comment.