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

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