A Silicon Valley company has filed an antitrust lawsuit accusing Apple of cornering the market for heart-rate monitoring technology for the Apple Watch, and endangering wearers’ health. In a complaint filed late on Tuesday night, AliveCor said Apple shut out rivals by changing the heart-rate algorithm on its watch’s operating system, making rival technology incompatible. AliveCor sells KardiaBand, an Apple Watch wristband capable of recording an electrocardiogram, and SmartRhythm, an app that alerts users to irregular heartbeats. The privately held company accused Apple, whose market value exceeds $2 trillion, of quietly “working in the background” to copy its ability to record an ECG on the Apple Watch, and to provide a separate app for heart-rate analysis. “As it has done multiple times over the years in other markets, Apple decided that it would not accept competition on the merits,” AliveCor said in its complaint filed in San Francisco federal court. …