import { keywordSlugToUriSlug } from "./_internal/slugConverters";
import { appendIdToSlug } from "./_internal/slugs";
/**
 * Consistent means to get an item's identifier - either the slug or the id
 * @param item
 * @returns
 */
export function getItemIdentifier(item, 
// for backwards compatibility, we do not include the id in the slug by default
// once all of the routes have been updated to expect slugs w/ ids, we should always include the id
includeIdInSlug = false) {
    const { id, properties } = item;
    const slug = properties === null || properties === void 0 ? void 0 : properties.slug;
    return slug
        ? keywordSlugToUriSlug(includeIdInSlug ? appendIdToSlug(slug, id) : slug)
        : id;
}
//# sourceMappingURL=getItemIdentifier.js.map