| Index: pkg/barback/lib/src/utils.dart
|
| diff --git a/pkg/barback/lib/src/utils.dart b/pkg/barback/lib/src/utils.dart
|
| index 7529fa974d580e91bd4b23531d43b02e7552e40a..bee60841dfdfed85a67ae21a7a3500d81e85f63a 100644
|
| --- a/pkg/barback/lib/src/utils.dart
|
| +++ b/pkg/barback/lib/src/utils.dart
|
| @@ -6,6 +6,23 @@ library barback.utils;
|
|
|
| import 'dart:async';
|
|
|
| +/// A pair of values.
|
| +class Pair<E, F> {
|
| + E first;
|
| + F last;
|
| +
|
| + Pair(this.first, this.last);
|
| +
|
| + String toString() => '($first, $last)';
|
| +
|
| + bool operator==(other) {
|
| + if (other is! Pair) return false;
|
| + return other.first == first && other.last == last;
|
| + }
|
| +
|
| + int get hashCode => first.hashCode ^ last.hashCode;
|
| +}
|
| +
|
| /// Converts a number in the range [0-255] to a two digit hex string.
|
| ///
|
| /// For example, given `255`, returns `ff`.
|
| @@ -46,6 +63,10 @@ List flatten(Iterable nested) {
|
| return result;
|
| }
|
|
|
| +/// Returns the union of all elements in each set in [sets].
|
| +Set unionAll(Iterable<Set> sets) =>
|
| + sets.fold(new Set(), (union, set) => union.union(set));
|
| +
|
| /// Passes each key/value pair in [map] to [fn] and returns a new [Map] whose
|
| /// values are the return values of [fn].
|
| Map mapMapValues(Map map, fn(key, value)) =>
|
|
|