const SETTINGS_TAB_NAME = "__settings__";

export const normalizeTab = (value, postTypeKeys = []) => {
    const raw = typeof value === "string" ? value : "";
    if (raw === SETTINGS_TAB_NAME || raw === "settings") {
        return SETTINGS_TAB_NAME;
    }
    if (raw === "") {
        return null;
    }

    return postTypeKeys.includes(raw) ? raw : null;
};
