react-metatags-hook
Version:
React Hook to manage html meta tags
7 lines (6 loc) • 387 B
JavaScript
// Compares two meta models and return the removed tags
export const getRemovedTags = (metas, prevMetas) => Object.keys(prevMetas.tags || {})
.filter((tagId) => !metas.tags[tagId])
.map((tagId) => prevMetas.tags[tagId]);
// Returns the plain array of tags from the meta model
export const getTagsList = (metas) => Object.keys(metas.tags || {}).map((tagId) => metas.tags[tagId]);