diff --git a/CHANGELOG.md b/CHANGELOG.md index 31ac61e..d90c157 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ - `CanonicalizedMap`: added constructor `fromEntries`. - Require Dart `^3.1.0` - Mark "mixin" classes as `mixin`. +- Deprecate `transitiveClosure`. Consider using `package:graphs`. ## 1.18.0 diff --git a/lib/src/functions.dart b/lib/src/functions.dart index 8f60b26..fb67c9f 100644 --- a/lib/src/functions.dart +++ b/lib/src/functions.dart @@ -120,6 +120,7 @@ S? maxBy(Iterable values, T Function(S) orderBy, /// that vertex has no outgoing edges. This isn't checked, but if it's not /// satisfied, the function may crash or provide unexpected output. For example, /// `{"a": ["b"]}` is not valid, but `{"a": ["b"], "b": []}` is. +@Deprecated('This method will be removed. Consider using package:graphs.') Map> transitiveClosure(Map> graph) { // This uses [Warshall's algorithm][], modified not to add a vertex from each // node to itself. diff --git a/test/functions_test.dart b/test/functions_test.dart index cc97327..f602303 100644 --- a/test/functions_test.dart +++ b/test/functions_test.dart @@ -2,6 +2,8 @@ // for details. All rights reserved. Use of this source code is governed by a // BSD-style license that can be found in the LICENSE file. +// ignore_for_file: deprecated_member_use_from_same_package + import 'package:collection/collection.dart'; import 'package:test/test.dart'; @@ -9,7 +11,6 @@ void main() { group('mapMap()', () { test('with an empty map returns an empty map', () { expect( - // ignore: deprecated_member_use_from_same_package mapMap({}, key: expectAsync2((_, __) {}, count: 0), value: expectAsync2((_, __) {}, count: 0)), @@ -18,7 +19,6 @@ void main() { test('with no callbacks, returns a copy of the map', () { var map = {'foo': 1, 'bar': 2}; - // ignore: deprecated_member_use_from_same_package var result = mapMap(map); expect(result, equals({'foo': 1, 'bar': 2})); @@ -29,7 +29,6 @@ void main() { test("maps the map's keys", () { expect( - // ignore: deprecated_member_use_from_same_package mapMap({'foo': 1, 'bar': 2}, key: (dynamic key, dynamic value) => key[value]), equals({'o': 1, 'r': 2})); @@ -37,7 +36,6 @@ void main() { test("maps the map's values", () { expect( - // ignore: deprecated_member_use_from_same_package mapMap({'foo': 1, 'bar': 2}, value: (dynamic key, dynamic value) => key[value]), equals({'foo': 'o', 'bar': 'r'})); @@ -45,7 +43,6 @@ void main() { test("maps both the map's keys and values", () { expect( - // ignore: deprecated_member_use_from_same_package mapMap({'foo': 1, 'bar': 2}, key: (dynamic key, dynamic value) => '$key$value', value: (dynamic key, dynamic value) => key[value]),