MCPcopy Index your code
hub / github.com/dianping/cat / toString

Method toString

lib/node.js/lib/sys/SystemBaseInfo.js:11–31  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

9 }
10
11 toString() {
12 // to xml item
13 let tag = '<' + this.name
14 let attrKeys = Object.keys(this.attrs)
15 if (attrKeys.length) {
16 tag += (' ' + attrKeys.map(key => key + '=' + '"' + this.attrs[key] + '"').join(' '))
17 }
18
19 if (this.children.length) {
20 tag += '>\n'
21 this.children.forEach(child => {
22 tag += child.toString()
23 })
24 tag += ('</' + this.name + '>\n')
25 } else if (this.content) {
26 tag += ('>' + this.content + '</' + this.name + '>\n')
27 } else {
28 tag += '/>\n'
29 }
30 return tag
31 }
32
33 addChild(childInfo) {
34 if (childInfo && childInfo instanceof SystemBaseInfo) {

Callers 15

getAbsolutePathsMethod · 0.45
beginLogMethod · 0.45
beginLogMethod · 0.45
beginLogMethod · 0.45
beginLogMethod · 0.45
beginLogMethod · 0.45
beginLogMethod · 0.45
beginLogMethod · 0.45
getRequestMethodInfoMethod · 0.45
getRequestServerInfoMethod · 0.45
beginLogMethod · 0.45
beginLogMethod · 0.45

Calls 3

keysMethod · 0.80
joinMethod · 0.65
mapMethod · 0.65

Tested by

no test coverage detected