Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat (data): support checklist data format #103

Merged
merged 3 commits into from
Nov 5, 2024

Conversation

e11sy
Copy link

@e11sy e11sy commented Nov 3, 2024

Problem

Checklist data format is not supported for this tool

Solution

Improved normalizeData() method that now checks if data is related to the Checklist tool and converts it to Nested List data

*/
function instanceOfListData(data: ListData | OldListData): data is OldListData {
function instanceOfListData(data: ListData | OldListData | OldChecklistData): data is OldListData {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

function name means checking passed value to be ListData (new). But it checks for the OldListData.

* 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
* Method that checks if data is related to the List Tool
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

description is unclear

return (typeof data.items[0] === 'string');
}

/**
* Method that checks if data is related to the Checklist tool
* @param data - data of the Checklist of NestedList tool
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
* @param data - data of the Checklist of NestedList tool
* @param data - data of the Checklist or NestedList tool

@e11sy e11sy merged commit 2d84882 into release/2.0 Nov 5, 2024
1 check passed
@e11sy e11sy deleted the improve-normalize-data branch November 5, 2024 14:51
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants