From 22a8cc624502a9d3c00fa155a05b5171e5f2b238 Mon Sep 17 00:00:00 2001 From: kalutkaz Date: Tue, 19 Apr 2022 13:46:40 +0300 Subject: [PATCH] Refactoring --- .../src/app/shared/components/json-object-edit.component.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui-ngx/src/app/shared/components/json-object-edit.component.ts b/ui-ngx/src/app/shared/components/json-object-edit.component.ts index 35f9e1e623..7d829115af 100644 --- a/ui-ngx/src/app/shared/components/json-object-edit.component.ts +++ b/ui-ngx/src/app/shared/components/json-object-edit.component.ts @@ -22,7 +22,7 @@ import { ActionNotificationHide, ActionNotificationShow } from '@core/notificati import { Store } from '@ngrx/store'; import { AppState } from '@core/core.state'; import { CancelAnimationFrame, RafService } from '@core/services/raf.service'; -import { guid, isDefinedAndNotNull, isUndefined } from '@core/utils'; +import {guid, isDefinedAndNotNull, isObject, isUndefined} from '@core/utils'; import { ResizeObserver } from '@juggle/resize-observer'; import { getAce } from '@shared/models/ace/ace.models'; @@ -259,7 +259,7 @@ export class JsonObjectEditComponent implements OnInit, ControlValueAccessor, Va if (this.contentValue && this.contentValue.length > 0) { try { data = JSON.parse(this.contentValue); - if (typeof data !== 'object') { + if (!isObject(data)) { throw new TypeError(`Value is not a valid JSON`); } this.objectValid = true;