compareTo method

  1. @override
int compareTo(
  1. Entry other
)
override

Implements Comparable to ensure that entries are ordered by their location in the target file. We sort primarily by the target offset because source map files are encoded by printing each mapping in order as they appear in the target file.

Implementation

@override
int compareTo(Entry other) {
  var res = target.compareTo(other.target);
  if (res != 0) return res;
  res = source.sourceUrl
      .toString()
      .compareTo(other.source.sourceUrl.toString());
  if (res != 0) return res;
  return source.compareTo(other.source);
}