hasSection

View as MarkdownOpen in Claude

Check if a top-level section with the given title exists.

Parameters

title
stringRequired

Section title to check.

Returns

booleantrue if the section exists, false otherwise.

Example

1import { PomBuilder } from '@signalwire/sdk';
2
3const pom = new PomBuilder();
4pom.addSection('Role', { body: 'You are a helpful assistant.' });
5
6console.log(pom.hasSection('Role')); // true
7console.log(pom.hasSection('Missing')); // false