addToSection

View as MarkdownOpen in Claude

Add content to an existing section. If the section does not exist, it is created automatically (auto-vivification).

Parameters

title
stringRequired

Section title to add content to.

opts
object

Optional content to add.

opts.body
string

Text to append to the section body. Appended with a double newline separator.

opts.bullet
string

Single bullet point to add.

opts.bullets
string[]

Multiple bullet points to add.

Returns

PomBuilder — Self for method chaining.

Example

1import { PomBuilder } from '@signalwire/sdk';
2
3const pom = new PomBuilder();
4pom.addSection('Rules');
5pom.addToSection('Rules', { bullet: 'Be concise' });
6pom.addToSection('Rules', { bullet: 'Be accurate' });
7pom.addToSection('Rules', { body: 'Always verify information.' });