A structure for a text messages dictionary with system notifications/errors I would like to arrange a system messages dictionary for an application in JavaScript.
As an initial intention, I thought something about the following structure:
export const SYS_MESSAGES = Object.freeze({

    fileSizeExceeded: {
        code: &quot;FILE_SIZE_EXCEEDED&quot;,
        text: &quot;The file size exceeds allowed limit&quot;
    }

});

But then I realized, the structure could be even more simple:
export const SYS_MESSAGES = Object.freeze({

    FILE_SIZE_EXCEEDED: &quot;The file size exceeds allowed limit&quot;

});

Which option of two structures is a preferred-one from maintenance/style perspective?
I consider that the second option is better for the following:

The first option is more verbose than the second, and it is in a way that there is no additional information which allow other developers or even you to obtain meaningful information.
The second option has a constant style name which represents what you are trying to tell us, &quot;hey, this is a constant and its value is ...&quot; and so, it clearly reflects a shorter and descriptive code style.
Having less properties (in your objects) implies less space, and less space computed implies less execution time. (even if it is very small).
Less content helps you to debug faster.

Well, I hope it helped you.