@senior-agronegocio/angular-components 0.0.72-origination → 0.0.73-origination

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.
@@ -1891,13 +1891,25 @@ var AgroCookieUtils = /** @class */ (function () {
1891
1891
  if (parseURIString) {
1892
1892
  cookieString = decodeURIComponent(cookieString);
1893
1893
  }
1894
+ if (AgroCookieUtils.isStringAnObject(cookieString)) {
1895
+ return JSON.parse(cookieString);
1896
+ }
1894
1897
  cookieString.split(';').forEach(function (cookie) {
1895
1898
  var _a = __read(cookie.split('=').map(function (c) { return c.trim(); }), 2), key = _a[0], value = _a[1];
1896
1899
  cookieObject[key] = value;
1897
1900
  });
1898
1901
  return cookieObject;
1899
1902
  };
1900
- AgroCookieUtils.prototype.setCookie = function (name, value, days) {
1903
+ AgroCookieUtils.isStringAnObject = function (str) {
1904
+ try {
1905
+ var parsed = JSON.parse(str);
1906
+ return typeof parsed === 'object' && parsed !== null && !Array.isArray(parsed);
1907
+ }
1908
+ catch (e) {
1909
+ return false;
1910
+ }
1911
+ };
1912
+ AgroCookieUtils.setCookie = function (name, value, days) {
1901
1913
  var date = new Date();
1902
1914
  date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
1903
1915
  var expires = 'expires=' + date.toUTCString();