computer-scienceangular-roadmapbackend-roadmapblockchain-roadmapdba-roadmapdeveloper-roadmapdevops-roadmapfrontend-roadmapgo-roadmaphactoberfestjava-roadmapjavascript-roadmapnodejs-roadmappython-roadmapqa-roadmapreact-roadmaproadmapstudy-planvue-roadmapweb3-roadmap
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
21 lines
596 B
21 lines
596 B
export function removeSortingInfo(groupId: string) { |
|
return (groupId || '').replace(/^\d+-/, ''); |
|
} |
|
|
|
export function queryGroupElementsById(groupId: string) { |
|
const elements = document.querySelectorAll( |
|
`[data-group-id$="-${groupId}"]` |
|
) as any; |
|
const matchingElements: HTMLElement[] = []; |
|
|
|
elements.forEach((element: HTMLElement) => { |
|
const foundGroupId = element?.dataset?.groupId || ''; |
|
const validGroupRegex = new RegExp(`^\\d+-${groupId}$`); |
|
|
|
if (validGroupRegex.test(foundGroupId)) { |
|
matchingElements.push(element); |
|
} |
|
}); |
|
|
|
return matchingElements; |
|
}
|
|
|