@stemy/ngx-utils 12.2.16 → 12.2.18

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.
@@ -498,7 +498,9 @@
498
498
  };
499
499
  ObjectUtils.getType = function (obj) {
500
500
  var regex = new RegExp("\\s([a-zA-Z]+)");
501
- return Object.prototype.toString.call(obj).match(regex)[1].toLowerCase();
501
+ var target = !obj ? null : obj.constructor;
502
+ var type = !target ? null : Reflect.getMetadata("objectType", target);
503
+ return (type || Object.prototype.toString.call(obj).match(regex)[1]).toLowerCase();
502
504
  };
503
505
  ObjectUtils.isPrimitive = function (value) {
504
506
  var type = typeof value;
@@ -758,6 +760,11 @@
758
760
  ReflectUtils.defineMetadata("factoryDependencies", dependencies, target, method);
759
761
  };
760
762
  }
763
+ function ObjectType(type) {
764
+ return function (target) {
765
+ ReflectUtils.defineMetadata("objectType", type, target);
766
+ };
767
+ }
761
768
  var PaginationItemContext = /** @class */ (function () {
762
769
  function PaginationItemContext(item, parallelItem, count, index, dataIndex) {
763
770
  this.item = item;
@@ -1881,7 +1888,7 @@
1881
1888
  });
1882
1889
  Object.defineProperty(UniversalService.prototype, "browserName", {
1883
1890
  get: function () {
1884
- return this.dds.browser;
1891
+ return (this.dds.browser || "").toLowerCase();
1885
1892
  },
1886
1893
  enumerable: false,
1887
1894
  configurable: true
@@ -1895,35 +1902,35 @@
1895
1902
  });
1896
1903
  Object.defineProperty(UniversalService.prototype, "isExplorer", {
1897
1904
  get: function () {
1898
- return this.dds.browser == "ie";
1905
+ return this.checkBrowser("ie");
1899
1906
  },
1900
1907
  enumerable: false,
1901
1908
  configurable: true
1902
1909
  });
1903
1910
  Object.defineProperty(UniversalService.prototype, "isEdge", {
1904
1911
  get: function () {
1905
- return this.dds.browser == "ms-edge";
1912
+ return this.checkBrowser("edge");
1906
1913
  },
1907
1914
  enumerable: false,
1908
1915
  configurable: true
1909
1916
  });
1910
1917
  Object.defineProperty(UniversalService.prototype, "isChrome", {
1911
1918
  get: function () {
1912
- return this.dds.browser == "chrome";
1919
+ return this.checkBrowser("chrome");
1913
1920
  },
1914
1921
  enumerable: false,
1915
1922
  configurable: true
1916
1923
  });
1917
1924
  Object.defineProperty(UniversalService.prototype, "isFirefox", {
1918
1925
  get: function () {
1919
- return this.dds.browser == "firefox";
1926
+ return this.checkBrowser("firefox");
1920
1927
  },
1921
1928
  enumerable: false,
1922
1929
  configurable: true
1923
1930
  });
1924
1931
  Object.defineProperty(UniversalService.prototype, "isSafari", {
1925
1932
  get: function () {
1926
- return this.dds.browser == "safari";
1933
+ return this.checkBrowser("safari");
1927
1934
  },
1928
1935
  enumerable: false,
1929
1936
  configurable: true
@@ -1956,6 +1963,9 @@
1956
1963
  enumerable: false,
1957
1964
  configurable: true
1958
1965
  });
1966
+ UniversalService.prototype.checkBrowser = function (name) {
1967
+ return this.browserName.includes(name) || false;
1968
+ };
1959
1969
  return UniversalService;
1960
1970
  }());
1961
1971
  UniversalService.decorators = [
@@ -6306,6 +6316,7 @@
6306
6316
  exports.MinPipe = MinPipe;
6307
6317
  exports.NgxTemplateOutletDirective = NgxTemplateOutletDirective;
6308
6318
  exports.NgxUtilsModule = NgxUtilsModule;
6319
+ exports.ObjectType = ObjectType;
6309
6320
  exports.ObjectUtils = ObjectUtils;
6310
6321
  exports.ObservableUtils = ObservableUtils;
6311
6322
  exports.OpenApiService = OpenApiService;