True, it's a bit more verbose, but we might agree that one wouldn't be able to distinguish loader.UNKNOWN being a type rather than an error as loader.NOT_LOADED or loader.CORRUPT_FORMAT without scraping the source of the module while loder.types.UNKNOWN leaves no space for misunderstandings thanks to namespacing semantics.

In PHP code to avoid this we usually prefix constants in a meaningful way for the very same reason (e.g. TYPE_UNKNOWN or ERROR_NOT_LOADED, note that this also helps with intellisense/autocompletion/smart-whatever-it-is-called) but in JS object notation makes much more sense.