MCPcopy Index your code
hub / github.com/zxlie/FeHelper / _safeStringify

Function _safeStringify

apps/json-format/format-lib.js:1891–1912  ·  view source on GitHub ↗
(value, space)

Source from the content-addressed store, hash-verified

1889 };
1890
1891 let _safeStringify = function(value, space) {
1892 if (
1893 typeof window !== 'undefined' &&
1894 window.FHJsonAutoUtils &&
1895 typeof window.FHJsonAutoUtils.safeStringify === 'function'
1896 ) {
1897 return window.FHJsonAutoUtils.safeStringify(value, space);
1898 }
1899
1900 return JSON.stringify(value, function(key, item) {
1901 if (typeof item === 'bigint') {
1902 return item.toString();
1903 }
1904 if (isBigNumberLike(item)) {
1905 return getBigNumberDisplayString(item);
1906 }
1907 if (typeof item === 'number' && item.toString().includes('e')) {
1908 return item.toLocaleString('fullwide', {useGrouping: false});
1909 }
1910 return item;
1911 }, space);
1912 };
1913
1914 let _normalizePreservedKey = function(key) {
1915 if (

Callers 2

formatFunction · 0.85
formatSyncFunction · 0.85

Calls 2

isBigNumberLikeFunction · 0.70

Tested by

no test coverage detected