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

//#region src/utils/mapper/organization.ts
/**
* Maps an organization to an API response.
* @param organization - The organization to map.
* @param  - Whether the user is an admin of the organization.
* @returns The organization mapped to an API response.
*/
const mapOrganizationToAPI = (organization) => {
	if (!organization) return null;
	return ensureMongoDocumentToObject(organization);
};
const mapOrganizationsToAPI = (organizations) => organizations.map(mapOrganizationToAPI).filter(Boolean);

//#endregion
export { mapOrganizationToAPI, mapOrganizationsToAPI };
//# sourceMappingURL=organization.mjs.map