The links.find() method finds a link by its ID.
DayPilot.Gantt.links.find(id);id - the link ID to be found
Returns a DayPilot.Link object if the link is found; otherwise returns null.
The id value is compared using ===, so 1 (number) is different from "1" (string).
const link = gantt.links.find("link-1");
if (link) {
// ...
}