How to get the current design package and theme names programmatically on the browser side (with JavaScript)?

The current design package name

require.toUrl('').split('/').slice(-4)[0]

The current design theme name

require.toUrl('').split('/').slice(-4)[1]

See also: