.dungeon/module/helpers/detailsExpanded.mjs
2024-01-07 22:29:57 -07:00

11 lines
No EOL
450 B
JavaScript

/**
* Checks if the specified collapseId is currently open, so that during re-renders
* it remains open or closed.
*
* @param {Set<string>} expanded A set indicating what collapseIds are expanded
* @param {string} collapseId The collapseId to check for
* @returns {"open"|null} The HTML insertion indicating the details is expanded
*/
export function detailsExpanded(expanded, collapseId) {
return expanded.has(collapseId) ? "open" : null;
};