@castlabs/ui 7.19.1 → 7.19.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- /* @castlabs/ui v7.19.1 */
1
+ /* @castlabs/ui v7.19.2 */
2
2
 
3
3
  /*!
4
4
  * Bootstrap v5.3.8 (https://getbootstrap.com/)
@@ -961,11 +961,12 @@ export function getDomainCookieJson (name) {
961
961
  }
962
962
 
963
963
  function getDomain () {
964
- if (window.location.hostname.match(/^[0-9]+.[0-9]+.[0-9]+.[0-9]+$/)) {
964
+ const hostname = window.location.hostname ?? 'unknown'
965
+ if (hostname.match(/^[0-9]+.[0-9]+.[0-9]+.[0-9]+$/)) {
965
966
  // IP domain
966
- return window.location.hostname
967
+ return hostname
967
968
  }
968
- const parts = window.location.hostname.split('.').reverse()
969
+ const parts = hostname.split('.').reverse()
969
970
  if (parts.length > 1) {
970
971
  // regular multi-part domain name
971
972
  return `.${parts[1]}.${parts[0]}`