LineBuilder
Classes
- Line
- LineBuilder
Useful for creating formatted snippets of code
Line
Kind: global class
- Line
- new Line(text, indent)
- .text :
string
- .indentation :
number
new Line(text, indent)
Param | Type |
---|---|
text | string |
indent | number |
line.text : string
Kind: instance property of Line
line.indentation : number
Kind: instance property of Line
LineBuilder
Useful for creating formatted snippets of code
Kind: global class
- LineBuilder
- instance
- .indentation ⇒
number
- .indentSpaces :
number
- .count ⇒
number
- .containsSubstring(term) ⇒
boolean
- .indent() ⇒
LineBuilder
- .dedent() ⇒
LineBuilder
- .add(line_text) ⇒
LineBuilder
- .addLines(lines)
- .build() ⇒
string
- .indentation ⇒
- static
- instance
lineBuilder.indentation ⇒ number
Current indentation level Mainly intended for testing
Kind: instance property of LineBuilder
lineBuilder.indentSpaces : number
TODO replace with indent string, that is tab, space or any combination or something else entirely
Kind: instance property of LineBuilder
lineBuilder.count ⇒ number
Number of lines
Kind: instance property of LineBuilder
lineBuilder.containsSubstring(term) ⇒ boolean
Substring test of per-line basis. A match can only span a single line, so multi-line matches will not be found.
Kind: instance method of LineBuilder
Param | Type |
---|---|
term | string |
lineBuilder.indent() ⇒ LineBuilder
Kind: instance method of LineBuilder
lineBuilder.dedent() ⇒ LineBuilder
Kind: instance method of LineBuilder
lineBuilder.add(line_text) ⇒ LineBuilder
Kind: instance method of LineBuilder
Param | Type |
---|---|
line_text | string |
lineBuilder.addLines(lines)
Kind: instance method of LineBuilder
Param | Type |
---|---|
lines | LineBuilder |
lineBuilder.build() ⇒ string
Kind: instance method of LineBuilder
LineBuilder.fromText(text, [line_separator]) ⇒ LineBuilder
Kind: static method of LineBuilder
Param | Type | Default | Description |
---|---|---|---|
text | string | ||
[line_separator] | string | "\n" | defaults to new-line character |