import semver from 'semver'; import type { Metadata } from '../types'; /* * Check if the MFE's @servicetitan/launchdarkly-service is new enough to prefer * LDService.getVersionClient over LDService.getClient, and so can safely receive a * host-provided LDService even when the LaunchDarkly SDK versions don't match exactly. */ export function getMFESupportsVersionedLDClient(bundledWith: Metadata['bundledWith']) { const version = bundledWith?.['@servicetitan/launchdarkly-service']; return !!version && semver.gte(version, '40.0.0'); }