@vis.gl/react-google-maps
Version:
React components and hooks for the Google Maps JavaScript API
16 lines (12 loc) • 392 B
text/typescript
export function isVersionGreaterEqual(
major: number,
minor: number
): boolean | undefined {
if (!google?.maps?.version) return undefined;
const version = google.maps.version.split('.');
const currentMajor = parseInt(version[0], 10);
const currentMinor = parseInt(version[1], 10);
return (
currentMajor > major || (currentMajor === major && currentMinor >= minor)
);
}