set

View as MarkdownOpen in Claude

Set a configuration value at the given dot-notation path, creating intermediate objects as needed. Keys matching __proto__, constructor, or prototype are silently ignored to prevent prototype pollution.

Parameters

path
stringRequired

Dot-separated key path into the config object (e.g., "server.port").

value
unknownRequired

The value to store at the given path.

Returns

ConfigLoader — Returns this for method chaining.

Example

1import { ConfigLoader } from '@signalwire/sdk';
2
3const config = new ConfigLoader();
4
5config.set('server.port', 8080);
6config.set('server.host', 'localhost');
7console.log(config.get<number>('server.port')); // 8080