MCPcopy
hub / github.com/zxlie/FeHelper / _getDirectNodeText

Function _getDirectNodeText

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

Source from the content-addressed store, hash-verified

1018 };
1019
1020 let _getDirectNodeText = function (el) {
1021 let directText = el.children('.key,.string,.number,.bool,.null').map(function () {
1022 return $(this).text();
1023 }).get().join(' ');
1024
1025 if (!directText) {
1026 directText = el.clone().children('.kv-list,.boxOpt').remove().end().text();
1027 }
1028
1029 return String(directText || '').replace(/\s+/g, ' ').trim();
1030 };
1031
1032 let _getJsonNodeType = function (el, text) {
1033 if (!el || !el.length) {

Callers 2

_getSelectionInfoFunction · 0.85
_getSearchableNodeTextFunction · 0.85

Calls 4

removeMethod · 0.80
cloneMethod · 0.80
$Function · 0.50
getMethod · 0.45

Tested by

no test coverage detected