import { URL } from 'node:url';
import md5 from 'md5';
const iconColorCache = new Map();
export const workItemTypeIconColor = (workItemType) => {
    if (!iconColorCache.has(workItemType.icon.url)) {
        const { searchParams } = new URL(workItemType.icon.url);
        // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
        iconColorCache.set(workItemType.icon.url, searchParams.get('color'));
    }
    // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
    return iconColorCache.get(workItemType.icon.url);
};
export const workItemTypeId = (workItemType) => md5(workItemType.name + workItemType.icon.id + workItemTypeIconColor(workItemType));
export const closedDate = (workItem) => workItem.fields['Microsoft.VSTS.Common.ClosedDate'];
