const require_utils_ensureMongoDocumentToObject = require('../ensureMongoDocumentToObject.cjs');

//#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 require_utils_ensureMongoDocumentToObject.ensureMongoDocumentToObject(organization);
};
const mapOrganizationsToAPI = (organizations) => organizations.map(mapOrganizationToAPI).filter(Boolean);

//#endregion
exports.mapOrganizationToAPI = mapOrganizationToAPI;
exports.mapOrganizationsToAPI = mapOrganizationsToAPI;
//# sourceMappingURL=organization.cjs.map