How to check if module enabled in config?

How to check if module enabled in ‘modules’ in main.php config file? I need only check, without creating new instance of module.


if (isset(Yii::app()->modules['moduleName'])) {...}

:)

Or like this:


if (Yii::app()->hasModule('moduleName')) {...}