Skip to content

isSet

isSet<K>(key): boolean

Checks whether a specific configuration option is set.

K extends string | number

key: K

The key of the configuration option to check.

boolean

true if the configuration option is set, otherwise false.

// Verify if the 'api' configuration is set
if (isSet('api')) {
console.log('API configuration is set.');
} else {
console.log('API configuration is not set.');
}

config/src/Service.ts:124