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

Function getJsonText

apps/json-format/format-lib.js:567–579  ·  view source on GitHub ↗
(el)

Source from the content-addressed store, hash-verified

565 * @returns {string}
566 */
567 let getJsonText = function (el) {
568
569 let txt = el.text().replace(/复制\|下载\|删除/gm,'').replace(/":\s/gm, '":').replace(/,$/, '').trim();
570 if (!(/^{/.test(txt) && /\}$/.test(txt)) && !(/^\[/.test(txt) && /\]$/.test(txt))) {
571 txt = '{' + txt + '}';
572 }
573 try {
574 txt = JSON.stringify(JSON.parse(txt), null, 4);
575 } catch (err) {
576 }
577
578 return txt;
579 };
580
581 let _getJsonPathKeys = function (curEl) {
582 let keys = [];

Callers 6

fnDownloadFunction · 0.85
fnCopyFunction · 0.85
_stringifyJsonNodeValueFunction · 0.85
_getSelectionInfoFunction · 0.85
_copySelectedValueFunction · 0.85
_addEventsFunction · 0.85

Calls 1

parseMethod · 0.45

Tested by

no test coverage detected