From 1b54dbccb6fcf372cdaf6f2f9d0cbb8c1729498d Mon Sep 17 00:00:00 2001 From: e11sy <130844513+e11sy@users.noreply.github.com> Date: Wed, 30 Oct 2024 21:02:40 +0300 Subject: [PATCH 1/4] add data normalization method --- index.html | 15 +++++++++++++-- src/ListTabulator/index.ts | 26 +++++++++++++------------- src/index.ts | 23 ++++++++++++----------- src/styles/list.pcss | 2 +- src/types/ListParams.ts | 30 ++++++++++++++++++++++-------- src/utils/normalizeData.ts | 36 ++++++++++++++++++++++++++++++++++++ 6 files changed, 97 insertions(+), 35 deletions(-) create mode 100644 src/utils/normalizeData.ts diff --git a/index.html b/index.html index 2f5aab0..7d1da53 100644 --- a/index.html +++ b/index.html @@ -191,8 +191,19 @@ } ] } - } - ] + }, + { + type : 'List', + data : { + style : "checklist", + items : [ + "This is List tool data", + "That would be displayed", + "In Nested List tool" + ], + }, + }, + ], }, onReady: function(){ saveButton.click(); diff --git a/src/ListTabulator/index.ts b/src/ListTabulator/index.ts index ef60628..8bbb915 100644 --- a/src/ListTabulator/index.ts +++ b/src/ListTabulator/index.ts @@ -1,7 +1,7 @@ import { OrderedListRenderer } from '../ListRenderer/OrderedListRenderer'; import { UnorderedListRenderer } from '../ListRenderer/UnorderedListRenderer'; -import type { NestedListConfig, ListData, ListDataStyle } from '../types/ListParams'; -import type { ListItem } from '../types/ListParams'; +import type { NestedListConfig, NestedListData, NestedListDataStyle } from '../types/ListParams'; +import type { NestedListItem } from '../types/ListParams'; import type { ItemElement, ItemChildWrapperElement } from '../types/Elements'; import { isHtmlElement } from '../utils/type-guards'; import { getContenteditableSlice, getCaretNodeAndOffset, isCaretAtStartOfInput } from '@editorjs/caret'; @@ -43,7 +43,7 @@ export default class ListTabulator { /** * Full content of the list */ - private data: ListData; + private data: NestedListData; /** * Editor block api @@ -207,14 +207,14 @@ export default class ListTabulator { * @param wrapper - optional argument wrapper * @returns whole list saved data if wrapper not passes, otherwise will return data of the passed wrapper */ - public save(wrapper?: ItemChildWrapperElement): ListData { + public save(wrapper?: ItemChildWrapperElement): NestedListData { const listWrapper = wrapper ?? this.listWrapper; /** * The method for recursive collecting of the child items * @param parent - where to find items */ - const getItems = (parent: ItemChildWrapperElement): ListItem[] => { + const getItems = (parent: ItemChildWrapperElement): NestedListItem[] => { const children = getChildItems(parent); return children.map((el) => { @@ -233,7 +233,7 @@ export default class ListTabulator { const composedListItems = listWrapper ? getItems(listWrapper) : []; - let dataToSave: ListData = { + let dataToSave: NestedListData = { style: this.data.style, items: composedListItems, }; @@ -268,7 +268,7 @@ export default class ListTabulator { * Other items of the next List would be appended to the current list without any changes in nesting levels * @param data - data of the second list to be merged with current */ - public merge(data: ListData): void { + public merge(data: NestedListData): void { /** * Get list of all levels children of the previous item */ @@ -360,9 +360,9 @@ export default class ListTabulator { * @param element - html element that contains whole list * @todo - refactor and move to nested list instance */ - public pasteHandler(element: PasteEvent['detail']['data']): ListData { + public pasteHandler(element: PasteEvent['detail']['data']): NestedListData { const { tagName: tag } = element; - let style: ListDataStyle = 'unordered'; + let style: NestedListDataStyle = 'unordered'; let tagToSearch: string; // set list style and tag to search. @@ -377,13 +377,13 @@ export default class ListTabulator { tagToSearch = 'ul'; } - const data: ListData = { + const data: NestedListData = { style, items: [], }; // get pasted items from the html. - const getPastedItems = (parent: Element): ListItem[] => { + const getPastedItems = (parent: Element): NestedListItem[] => { // get first level li elements. const children = Array.from(parent.querySelectorAll(`:scope > li`)); @@ -1030,7 +1030,7 @@ export default class ListTabulator { * @param meta - meta used in list item rendering * @returns html element of the rendered item */ - private renderItem(itemContent: ListItem['content'], meta?: ListItem['meta']): ItemElement { + private renderItem(itemContent: NestedListItem['content'], meta?: NestedListItem['meta']): ItemElement { const itemMeta = meta ?? this.renderer.composeDefaultMeta(); switch (true) { @@ -1050,7 +1050,7 @@ export default class ListTabulator { * @param items - list data used in item rendering * @param parentElement - where to append passed items */ - private appendItems(items: ListItem[], parentElement: Element): void { + private appendItems(items: NestedListItem[], parentElement: Element): void { items.forEach((item) => { const itemEl = this.renderItem(item.content, item.meta); diff --git a/src/index.ts b/src/index.ts index fbc75e6..7934978 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,7 +5,7 @@ import type { ToolConfig } from '@editorjs/editorjs/types/tools'; import { IconListBulleted, IconListNumbered, IconChecklist } from '@codexteam/icons'; -import type { NestedListConfig, ListData, ListDataStyle, ListItem } from './types/ListParams'; +import type { NestedListConfig, NestedListData, NestedListDataStyle, NestedListItem, ListData } from './types/ListParams'; import ListTabulator from './ListTabulator'; import { CheckListRenderer, OrderedListRenderer, UnorderedListRenderer } from './ListRenderer'; import type { ListRenderer } from './types/ListRenderer'; @@ -18,11 +18,12 @@ import { type OlCounterType, OlCounterTypesMap } from './types/OlCounterType'; import './styles/list.pcss'; import './styles/input.pcss'; import stripNumbers from './utils/stripNumbers'; +import normalizeData from './utils/normalizeData'; /** * Constructor Params for Nested List Tool, use to pass initial data and settings */ -export type ListParams = BlockToolConstructorOptions; +export type ListParams = BlockToolConstructorOptions; /** * Default class of the component used in editor @@ -92,14 +93,14 @@ export default class NestedList { * @param data - current list data * @returns - contents string formed from list data */ - export: (data: ListData) => string; + export: (data: NestedListData) => string; /** * Method that is responsible for conversion from string to data * @param content - contents string * @returns - list data formed from contents string */ - import: (content: string, config: ToolConfig) => ListData; + import: (content: string, config: ToolConfig) => NestedListData; } { return { export: (data) => { @@ -123,7 +124,7 @@ export default class NestedList { /** * Get list style name */ - private get listStyle(): ListDataStyle { + private get listStyle(): NestedListDataStyle { return this.data.style || this.defaultListStyle; } @@ -131,7 +132,7 @@ export default class NestedList { * Set list style * @param style - new style to set */ - private set listStyle(style: ListDataStyle) { + private set listStyle(style: NestedListDataStyle) { this.data.style = style; this.changeTabulatorByStyle(); @@ -169,7 +170,7 @@ export default class NestedList { /** * Tool's data */ - private data: ListData; + private data: NestedListData; /** * Editor block api @@ -210,7 +211,7 @@ export default class NestedList { items: [], }; - this.data = Object.keys(data).length ? data : initialData; + this.data = Object.keys(data).length ? normalizeData(data) : initialData; /** * Assign default value of the property for the ordered list @@ -227,7 +228,7 @@ export default class NestedList { * @param data - current data of the list * @returns - string of the recursively merged contents of the items of the list */ - private static joinRecursive(data: ListData | ListItem): string { + private static joinRecursive(data: NestedListData | NestedListItem): string { return data.items .map(item => `${item.content} ${NestedList.joinRecursive(item)}`) .join(''); @@ -247,7 +248,7 @@ export default class NestedList { * Function that is responsible for content saving * @returns formatted content used in editor */ - public save(): ListData { + public save(): NestedListData { this.data = this.list!.save(); return this.data; @@ -257,7 +258,7 @@ export default class NestedList { * Function that is responsible for mergind two lists into one * @param data - data of the next standing list, that should be merged with current */ - public merge(data: ListData): void { + public merge(data: NestedListData): void { this.list!.merge(data); } diff --git a/src/styles/list.pcss b/src/styles/list.pcss index 850f745..b1d25b3 100644 --- a/src/styles/list.pcss +++ b/src/styles/list.pcss @@ -13,7 +13,7 @@ --checkbox-background: #fff; --color-border: #C9C9C9; --color-bg-checked: #369FFF; - --line-height: 145%; + --line-height: 1.45em; --color-bg-checked-hover: #0059AB; --color-tick: #fff; --size-checkbox: 1.2em; diff --git a/src/types/ListParams.ts b/src/types/ListParams.ts index 5e83365..075170d 100644 --- a/src/types/ListParams.ts +++ b/src/types/ListParams.ts @@ -4,20 +4,20 @@ import type { OlCounterType } from './OlCounterType'; /** * list style to make list as ordered or unordered */ -export type ListDataStyle = 'ordered' | 'unordered' | 'checklist'; +export type NestedListDataStyle = 'ordered' | 'unordered' | 'checklist'; /** - * Output data + * Interface that represents data of the Nested List tool */ -export interface ListData { +export interface NestedListData { /** * list type 'ordered' or 'unordered' or 'checklist' */ - style: ListDataStyle; + style: NestedListDataStyle; /** * list of first-level elements */ - items: ListItem[]; + items: NestedListItem[]; /** * Max level of the nesting in list * If nesting is not needed, it could be set to 1 @@ -33,10 +33,24 @@ export interface ListData { counterType?: OlCounterType; } +/** + * Interface that represents data of the List tool + */ +export interface ListData { + /** + * Style of the List tool + */ + style: 'ordered' | 'unordered'; + /** + * Array of items of the List tool + */ + items: string[]; +} + /** * List item within the output data */ -export interface ListItem { +export interface NestedListItem { /** * list item text content */ @@ -50,7 +64,7 @@ export interface ListItem { /** * sublist items */ - items: ListItem[]; + items: NestedListItem[]; } /** @@ -61,5 +75,5 @@ export interface NestedListConfig { * default list style: ordered or unordered * default is unordered */ - defaultStyle?: ListDataStyle; + defaultStyle?: NestedListDataStyle; } diff --git a/src/utils/normalizeData.ts b/src/utils/normalizeData.ts new file mode 100644 index 0000000..4cca048 --- /dev/null +++ b/src/utils/normalizeData.ts @@ -0,0 +1,36 @@ +import type { ListData, NestedListData, NestedListItem } from '../types/ListParams'; + +/** + * Method that checks if data is related to the List or NestedListTool + * @param data - data of the List or NestedListTool + * @returns true if data related to the List tool, false if to Nested List tool + */ +function instanceOfListData(data: NestedListData | ListData): data is ListData { + return (typeof data.items[0] === 'string'); +} + +/** + * Method that normalizes checks if passed data is related to the List tool and normalizes it + * @param data - data to be checked + * @returns - normalized data, ready to be used by Nested List tool + */ +export default function normalizeData(data: NestedListData | ListData): NestedListData { + const normalizedDataItems: NestedListItem[] = []; + + if (instanceOfListData(data)) { + data.items.forEach((item) => { + normalizedDataItems.push({ + content: item, + meta: {}, + items: [], + }); + }); + + return { + style: data.style, + items: normalizedDataItems, + }; + } else { + return data; + } +}; From 3a1f7a6ffd33529e866b0a6461f8aac0abb7b57a Mon Sep 17 00:00:00 2001 From: e11sy <130844513+e11sy@users.noreply.github.com> Date: Wed, 30 Oct 2024 21:19:42 +0300 Subject: [PATCH 2/4] renaming --- src/ListTabulator/index.ts | 24 ++++++++++++------------ src/index.ts | 16 ++++++++-------- src/types/ListParams.ts | 10 +++++----- src/utils/normalizeData.ts | 8 ++++---- 4 files changed, 29 insertions(+), 29 deletions(-) diff --git a/src/ListTabulator/index.ts b/src/ListTabulator/index.ts index 8bbb915..86bce7e 100644 --- a/src/ListTabulator/index.ts +++ b/src/ListTabulator/index.ts @@ -1,7 +1,7 @@ import { OrderedListRenderer } from '../ListRenderer/OrderedListRenderer'; import { UnorderedListRenderer } from '../ListRenderer/UnorderedListRenderer'; -import type { NestedListConfig, NestedListData, NestedListDataStyle } from '../types/ListParams'; -import type { NestedListItem } from '../types/ListParams'; +import type { NestedListConfig, ListData, NestedListDataStyle } from '../types/ListParams'; +import type { ListItem } from '../types/ListParams'; import type { ItemElement, ItemChildWrapperElement } from '../types/Elements'; import { isHtmlElement } from '../utils/type-guards'; import { getContenteditableSlice, getCaretNodeAndOffset, isCaretAtStartOfInput } from '@editorjs/caret'; @@ -43,7 +43,7 @@ export default class ListTabulator { /** * Full content of the list */ - private data: NestedListData; + private data: ListData; /** * Editor block api @@ -207,14 +207,14 @@ export default class ListTabulator { * @param wrapper - optional argument wrapper * @returns whole list saved data if wrapper not passes, otherwise will return data of the passed wrapper */ - public save(wrapper?: ItemChildWrapperElement): NestedListData { + public save(wrapper?: ItemChildWrapperElement): ListData { const listWrapper = wrapper ?? this.listWrapper; /** * The method for recursive collecting of the child items * @param parent - where to find items */ - const getItems = (parent: ItemChildWrapperElement): NestedListItem[] => { + const getItems = (parent: ItemChildWrapperElement): ListItem[] => { const children = getChildItems(parent); return children.map((el) => { @@ -233,7 +233,7 @@ export default class ListTabulator { const composedListItems = listWrapper ? getItems(listWrapper) : []; - let dataToSave: NestedListData = { + let dataToSave: ListData = { style: this.data.style, items: composedListItems, }; @@ -268,7 +268,7 @@ export default class ListTabulator { * Other items of the next List would be appended to the current list without any changes in nesting levels * @param data - data of the second list to be merged with current */ - public merge(data: NestedListData): void { + public merge(data: ListData): void { /** * Get list of all levels children of the previous item */ @@ -360,7 +360,7 @@ export default class ListTabulator { * @param element - html element that contains whole list * @todo - refactor and move to nested list instance */ - public pasteHandler(element: PasteEvent['detail']['data']): NestedListData { + public pasteHandler(element: PasteEvent['detail']['data']): ListData { const { tagName: tag } = element; let style: NestedListDataStyle = 'unordered'; let tagToSearch: string; @@ -377,13 +377,13 @@ export default class ListTabulator { tagToSearch = 'ul'; } - const data: NestedListData = { + const data: ListData = { style, items: [], }; // get pasted items from the html. - const getPastedItems = (parent: Element): NestedListItem[] => { + const getPastedItems = (parent: Element): ListItem[] => { // get first level li elements. const children = Array.from(parent.querySelectorAll(`:scope > li`)); @@ -1030,7 +1030,7 @@ export default class ListTabulator { * @param meta - meta used in list item rendering * @returns html element of the rendered item */ - private renderItem(itemContent: NestedListItem['content'], meta?: NestedListItem['meta']): ItemElement { + private renderItem(itemContent: ListItem['content'], meta?: ListItem['meta']): ItemElement { const itemMeta = meta ?? this.renderer.composeDefaultMeta(); switch (true) { @@ -1050,7 +1050,7 @@ export default class ListTabulator { * @param items - list data used in item rendering * @param parentElement - where to append passed items */ - private appendItems(items: NestedListItem[], parentElement: Element): void { + private appendItems(items: ListItem[], parentElement: Element): void { items.forEach((item) => { const itemEl = this.renderItem(item.content, item.meta); diff --git a/src/index.ts b/src/index.ts index 7934978..4713c62 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,7 +5,7 @@ import type { ToolConfig } from '@editorjs/editorjs/types/tools'; import { IconListBulleted, IconListNumbered, IconChecklist } from '@codexteam/icons'; -import type { NestedListConfig, NestedListData, NestedListDataStyle, NestedListItem, ListData } from './types/ListParams'; +import type { NestedListConfig, ListData, NestedListDataStyle, ListItem, OldListData } from './types/ListParams'; import ListTabulator from './ListTabulator'; import { CheckListRenderer, OrderedListRenderer, UnorderedListRenderer } from './ListRenderer'; import type { ListRenderer } from './types/ListRenderer'; @@ -23,7 +23,7 @@ import normalizeData from './utils/normalizeData'; /** * Constructor Params for Nested List Tool, use to pass initial data and settings */ -export type ListParams = BlockToolConstructorOptions; +export type ListParams = BlockToolConstructorOptions; /** * Default class of the component used in editor @@ -93,14 +93,14 @@ export default class NestedList { * @param data - current list data * @returns - contents string formed from list data */ - export: (data: NestedListData) => string; + export: (data: ListData) => string; /** * Method that is responsible for conversion from string to data * @param content - contents string * @returns - list data formed from contents string */ - import: (content: string, config: ToolConfig) => NestedListData; + import: (content: string, config: ToolConfig) => ListData; } { return { export: (data) => { @@ -170,7 +170,7 @@ export default class NestedList { /** * Tool's data */ - private data: NestedListData; + private data: ListData; /** * Editor block api @@ -228,7 +228,7 @@ export default class NestedList { * @param data - current data of the list * @returns - string of the recursively merged contents of the items of the list */ - private static joinRecursive(data: NestedListData | NestedListItem): string { + private static joinRecursive(data: ListData | ListItem): string { return data.items .map(item => `${item.content} ${NestedList.joinRecursive(item)}`) .join(''); @@ -248,7 +248,7 @@ export default class NestedList { * Function that is responsible for content saving * @returns formatted content used in editor */ - public save(): NestedListData { + public save(): ListData { this.data = this.list!.save(); return this.data; @@ -258,7 +258,7 @@ export default class NestedList { * Function that is responsible for mergind two lists into one * @param data - data of the next standing list, that should be merged with current */ - public merge(data: NestedListData): void { + public merge(data: ListData): void { this.list!.merge(data); } diff --git a/src/types/ListParams.ts b/src/types/ListParams.ts index 075170d..9d25015 100644 --- a/src/types/ListParams.ts +++ b/src/types/ListParams.ts @@ -9,7 +9,7 @@ export type NestedListDataStyle = 'ordered' | 'unordered' | 'checklist'; /** * Interface that represents data of the Nested List tool */ -export interface NestedListData { +export interface ListData { /** * list type 'ordered' or 'unordered' or 'checklist' */ @@ -17,7 +17,7 @@ export interface NestedListData { /** * list of first-level elements */ - items: NestedListItem[]; + items: ListItem[]; /** * Max level of the nesting in list * If nesting is not needed, it could be set to 1 @@ -36,7 +36,7 @@ export interface NestedListData { /** * Interface that represents data of the List tool */ -export interface ListData { +export interface OldListData { /** * Style of the List tool */ @@ -50,7 +50,7 @@ export interface ListData { /** * List item within the output data */ -export interface NestedListItem { +export interface ListItem { /** * list item text content */ @@ -64,7 +64,7 @@ export interface NestedListItem { /** * sublist items */ - items: NestedListItem[]; + items: ListItem[]; } /** diff --git a/src/utils/normalizeData.ts b/src/utils/normalizeData.ts index 4cca048..a7d8405 100644 --- a/src/utils/normalizeData.ts +++ b/src/utils/normalizeData.ts @@ -1,11 +1,11 @@ -import type { ListData, NestedListData, NestedListItem } from '../types/ListParams'; +import type { OldListData, ListData, ListItem } from '../types/ListParams'; /** * Method that checks if data is related to the List or NestedListTool * @param data - data of the List or NestedListTool * @returns true if data related to the List tool, false if to Nested List tool */ -function instanceOfListData(data: NestedListData | ListData): data is ListData { +function instanceOfListData(data: ListData | OldListData): data is OldListData { return (typeof data.items[0] === 'string'); } @@ -14,8 +14,8 @@ function instanceOfListData(data: NestedListData | ListData): data is ListData { * @param data - data to be checked * @returns - normalized data, ready to be used by Nested List tool */ -export default function normalizeData(data: NestedListData | ListData): NestedListData { - const normalizedDataItems: NestedListItem[] = []; +export default function normalizeData(data: ListData | OldListData): ListData { + const normalizedDataItems: ListItem[] = []; if (instanceOfListData(data)) { data.items.forEach((item) => { From eee081e54a67bb228f32c6885883820fd61c2bce Mon Sep 17 00:00:00 2001 From: e11sy <130844513+e11sy@users.noreply.github.com> Date: Wed, 30 Oct 2024 21:20:37 +0300 Subject: [PATCH 3/4] renaming --- src/ListTabulator/index.ts | 4 ++-- src/index.ts | 6 +++--- src/types/ListParams.ts | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/src/ListTabulator/index.ts b/src/ListTabulator/index.ts index 86bce7e..ef60628 100644 --- a/src/ListTabulator/index.ts +++ b/src/ListTabulator/index.ts @@ -1,6 +1,6 @@ import { OrderedListRenderer } from '../ListRenderer/OrderedListRenderer'; import { UnorderedListRenderer } from '../ListRenderer/UnorderedListRenderer'; -import type { NestedListConfig, ListData, NestedListDataStyle } from '../types/ListParams'; +import type { NestedListConfig, ListData, ListDataStyle } from '../types/ListParams'; import type { ListItem } from '../types/ListParams'; import type { ItemElement, ItemChildWrapperElement } from '../types/Elements'; import { isHtmlElement } from '../utils/type-guards'; @@ -362,7 +362,7 @@ export default class ListTabulator { */ public pasteHandler(element: PasteEvent['detail']['data']): ListData { const { tagName: tag } = element; - let style: NestedListDataStyle = 'unordered'; + let style: ListDataStyle = 'unordered'; let tagToSearch: string; // set list style and tag to search. diff --git a/src/index.ts b/src/index.ts index 4713c62..c77fcec 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,7 +5,7 @@ import type { ToolConfig } from '@editorjs/editorjs/types/tools'; import { IconListBulleted, IconListNumbered, IconChecklist } from '@codexteam/icons'; -import type { NestedListConfig, ListData, NestedListDataStyle, ListItem, OldListData } from './types/ListParams'; +import type { NestedListConfig, ListData, ListDataStyle, ListItem, OldListData } from './types/ListParams'; import ListTabulator from './ListTabulator'; import { CheckListRenderer, OrderedListRenderer, UnorderedListRenderer } from './ListRenderer'; import type { ListRenderer } from './types/ListRenderer'; @@ -124,7 +124,7 @@ export default class NestedList { /** * Get list style name */ - private get listStyle(): NestedListDataStyle { + private get listStyle(): ListDataStyle { return this.data.style || this.defaultListStyle; } @@ -132,7 +132,7 @@ export default class NestedList { * Set list style * @param style - new style to set */ - private set listStyle(style: NestedListDataStyle) { + private set listStyle(style: ListDataStyle) { this.data.style = style; this.changeTabulatorByStyle(); diff --git a/src/types/ListParams.ts b/src/types/ListParams.ts index 9d25015..f7888f2 100644 --- a/src/types/ListParams.ts +++ b/src/types/ListParams.ts @@ -4,7 +4,7 @@ import type { OlCounterType } from './OlCounterType'; /** * list style to make list as ordered or unordered */ -export type NestedListDataStyle = 'ordered' | 'unordered' | 'checklist'; +export type ListDataStyle = 'ordered' | 'unordered' | 'checklist'; /** * Interface that represents data of the Nested List tool @@ -13,7 +13,7 @@ export interface ListData { /** * list type 'ordered' or 'unordered' or 'checklist' */ - style: NestedListDataStyle; + style: ListDataStyle; /** * list of first-level elements */ @@ -75,5 +75,5 @@ export interface NestedListConfig { * default list style: ordered or unordered * default is unordered */ - defaultStyle?: NestedListDataStyle; + defaultStyle?: ListDataStyle; } From 62e44c87f76a9b568eab67b2fa2aafdda327cebb Mon Sep 17 00:00:00 2001 From: e11sy <130844513+e11sy@users.noreply.github.com> Date: Wed, 30 Oct 2024 21:25:16 +0300 Subject: [PATCH 4/4] Update src/utils/normalizeData.ts Co-authored-by: Peter --- src/utils/normalizeData.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/normalizeData.ts b/src/utils/normalizeData.ts index a7d8405..6299d8c 100644 --- a/src/utils/normalizeData.ts +++ b/src/utils/normalizeData.ts @@ -10,7 +10,7 @@ function instanceOfListData(data: ListData | OldListData): data is OldListData { } /** - * Method that normalizes checks if passed data is related to the List tool and normalizes it + * Method that checks if passed data is related to the legacy format and normalizes it * @param data - data to be checked * @returns - normalized data, ready to be used by Nested List tool */