findIndexFromProfileId function

int findIndexFromProfileId(
  1. List<Link>? matches,
  2. String id,
  3. Config config
)

Implementation

int findIndexFromProfileId(
  List<Link>? matches,
  String id,
  Config config,
) {
  return (matches ?? []).indexWhere((match) => match.idPattern != null
      ? RegExp('^(${match.idPattern!.replaceAll("{PROFILE_ID}", profileId)})')
          .hasMatch(id)
      : true);
}