MCPcopy Index your code
hub / github.com/Bytez-com/docs / toString

Method toString

docs/scripts/generatePages/Component.js:8–25  ·  view source on GitHub ↗
(indent = 1, depth = 0)

Source from the content-addressed store, hash-verified

6 }
7
8 toString(indent = 1, depth = 0) {
9 const props = Object.entries(this.props).map(([key, value]) => {
10 if (value === undefined) {
11 return key;
12 }
13 return `${key}="${value}"`;
14 });
15
16 const propsString = props.length > 0 ? ` ${props.join(' ')}` : '';
17
18 const indents = Array(indent * depth)
19 .fill('\t')
20 .join('');
21
22 const childrenString = this.childrenToString(indent, depth);
23
24 return `${indents}<${this.name}${propsString}>\n${childrenString}\n${indents}</${this.name}>`;
25 }
26
27 childrenToString(indent, depth) {
28 const childStrings = [];

Callers 5

mainFunction · 0.95
getDataUrlFunction · 0.80
tasks.test.tsFile · 0.80
index.jsFile · 0.80
childrenToStringMethod · 0.80

Calls 1

childrenToStringMethod · 0.95

Tested by 1

getDataUrlFunction · 0.64