code: function removePreviousAssociatedDomains(preferences, domains) {
      const output = [];
      const linkDomains = preferences.linkDomain;
  
      if (!domains) return output;
      for (let i = 0; i < domains.length; i++) {
        let domain = domains[i];
        if (domain.indexOf("applinks:") === 0) {
          domain = domain.replace("applinks:", "");
          if (isBranchAssociatedDomains(domain, linkDomains)) {
            output.push(`applinks:${domain}`);
          }
        } else if (isBranchAssociatedDomains(domain, linkDomains)) {
          output.push(domain);
        }
      }
  
      return output;
    }
docs: removed previous associated domains related to Branch (will not remove link domain changes from custom domains or custom sub domains)