When working with JavaScript...
if (eval('typeof admin_post_css_theme_dark-moon)=='function')) {/**/}
...an error message is triggered:
Error: ReferenceError: moon is not defined
This issue seems to be linked to the dash in the theme name, as themes without dashes do not cause any errors...
if (eval('typeof admin_post_css_theme_silver)=='function')) {/**/}
...do not result in any errors.
So why does the dash between 'dark' and 'moon' lead to this error?
Edit: It is recommended that those facing this issue should consider using camelCase or a similar naming convention. Personally, I use a 'name' and a 'base'. The 'base' is a URL-friendly version of the 'name', which may contain characters that are not URL-friendly. For example, 'My Example' and 'my-example' or 'my_example'.