hasConfig

View as MarkdownOpen in Claude

Check whether any configuration data has been loaded. Returns true if a file was loaded or data was set via loadFromObject().

Deliberate deviation from the Python SDK. Python’s has_config() returns True only when a file was loaded. The TypeScript version also returns true for object-loaded data, because loadFromObject() is a TS-only entry point with no Python equivalent — treating object-loaded data as “configured” matches the TS API surface.

If you specifically need file-load detection, check loader.getFilePath() !== null via getFilePath().

Returns

booleantrue if any configuration data exists (from file or object), false if the loader is empty.

Example

1import { ConfigLoader } from '@signalwire/sdk';
2
3const loader = new ConfigLoader('config.json');
4if (loader.hasConfig()) {
5 console.log('Config loaded, proceed with startup');
6}