Parcourir la source

fixing an issue with getters in IE

Raanan Weber il y a 7 ans
Parent
commit
f1f2037f52
1 fichiers modifiés avec 2 ajouts et 2 suppressions
  1. 2 2
      Viewer/src/helper/index.ts

+ 2 - 2
Viewer/src/helper/index.ts

@@ -40,8 +40,8 @@ export function camelToKebab(str) {
  * @param config the configuration object that will extend the object
  * @param config the configuration object that will extend the object
  */
  */
 export function extendClassWithConfig(object: any, config: any) {
 export function extendClassWithConfig(object: any, config: any) {
-    if (!config) return;
-    Object.keys(config).forEach(key => {
+    if (!config || typeof config !== 'object') return;
+    Object.keys(config).forEach(function (key) {
         if (key in object && typeof object[key] !== 'function') {
         if (key in object && typeof object[key] !== 'function') {
             // if (typeof object[key] === 'function') return;
             // if (typeof object[key] === 'function') return;
             // if it is an object, iterate internally until reaching basic types
             // if it is an object, iterate internally until reaching basic types