import { ensureMongoDocumentToObject } from "../ensureMongoDocumentToObject.mjs";

//#region src/utils/mapper/tag.ts
/**
* Maps a tag to an API response.
* @param tag - The tag to map.
* @returns The tag mapped to an API response.
*/
const mapTagToAPI = (tag) => {
	if (!tag) return null;
	return ensureMongoDocumentToObject(tag);
};
/**
* Formats an array of tags for API response. Removes sensitive information.
* @param tags - The array of tag objects to format.
* @param user - The user object.
* @param isTagAdmin - Whether the user is an admin of the tag.
* @returns The formatted array of user objects.
*/
const mapTagsToAPI = (tags) => tags.map((tag) => mapTagToAPI(tag));

//#endregion
export { mapTagToAPI, mapTagsToAPI };
//# sourceMappingURL=tag.mjs.map