MCPcopy Index your code
hub / github.com/darkreader/darkreader / compareChromeVersions

Function compareChromeVersions

src/utils/platform.ts:83–92  ·  view source on GitHub ↗
($a: string, $b: string)

Source from the content-addressed store, hash-verified

81})();
82
83export function compareChromeVersions($a: string, $b: string): -1 | 0 | 1 {
84 const a = $a.split('.').map((x) => parseInt(x));
85 const b = $b.split('.').map((x) => parseInt(x));
86 for (let i = 0; i < a.length; i++) {
87 if (a[i] !== b[i]) {
88 return a[i] < b[i] ? -1 : 1;
89 }
90 }
91 return 0;
92}
93
94export const isXMLHttpRequestSupported = typeof XMLHttpRequest === 'function';
95

Callers 2

Calls

no outgoing calls

Tested by

no test coverage detected