Skip to content
Snippets Groups Projects
Commit d3be8872 authored by jojohoch's avatar jojohoch
Browse files

Fix `findUIElements` method

- Now only UIElements are found
- HTML parts of the text editor are ignored
parent f62b3ab8
No related branches found
No related tags found
No related merge requests found
import { UIElement } from 'common/models/elements/element';
import { UIElement, UIElementType } from 'common/models/elements/element';
export abstract class UnitUtils {
static findUIElements(value: any | unknown[], type?: string): UIElement[] {
static findUIElements(value: any | unknown[], type?: UIElementType): UIElement[] {
const elements: UIElement[] = [];
if (value && typeof value === 'object') {
if (type ? value.type === type : value.type) {
if (type ? value.type === type : value instanceof UIElement) {
elements.push(value);
}
if (Array.isArray(value)) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment