From 21c2ba68cce8a8fd0f96a40bef3e2cbdeb4e814e Mon Sep 17 00:00:00 2001 From: apalanevich Date: Wed, 21 Jul 2021 23:30:50 +0300 Subject: [PATCH] fix(jsdoc): pr fix --- src/core/state-model.ts | 8 ++------ src/editor/editor.ts | 4 +++- 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/src/core/state-model.ts b/src/core/state-model.ts index afb1b7a6..99a17b61 100644 --- a/src/core/state-model.ts +++ b/src/core/state-model.ts @@ -65,16 +65,12 @@ export class UIPStateModel extends Observable { const elements = Array.from(this._html.querySelectorAll(target)); if (!elements.length) return; - if ('transform' in cfg) { - UIPStateModel.setAttribute(elements, attribute, cfg.transform); - } else { - UIPStateModel.setAttribute(elements, attribute, cfg.value); - } + UIPStateModel.setAttribute(elements, attribute, 'transform' in cfg ? cfg.transform : cfg.value); this._lastModifier = modifier; this.fire(); } - /** Transform attributes values for specified elements. */ + /** Transform attributes values. */ protected static setAttribute(elements: Element[], attr: string, transform: TransformSignature | string | boolean) { elements.forEach(el => { const transformed = typeof transform === 'function' ? transform(el.getAttribute(attr)) : transform; diff --git a/src/editor/editor.ts b/src/editor/editor.ts index 88bbf29a..7a71c5f8 100644 --- a/src/editor/editor.ts +++ b/src/editor/editor.ts @@ -14,7 +14,9 @@ import {UIPPlugin} from '../core/plugin'; interface EditorConfig { /** Editor's appearance theme. */ theme: string; - /** Text mode used. */ + /** + * Text mode which is used + * inside the editor. */ mode: string; /** Position of the vertical line for wrapping. */ printMarginColumn: number;