Skip to content

Commit 3ff0d26

Browse files
committed
refactor: add typedef
1 parent 349cc04 commit 3ff0d26

1 file changed

Lines changed: 10 additions & 7 deletions

File tree

lib/src/pub_license/pub_license.dart

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -28,20 +28,23 @@ class PubLicenseException implements Exception {
2828
final String message;
2929
}
3030

31+
/// The function signature for parsing HTML documents.
32+
@visibleForTesting
33+
typedef HtmlDocumentParse = html_dom.Document Function(
34+
dynamic input, {
35+
String? encoding,
36+
bool generateSpans,
37+
String? sourceUrl,
38+
});
39+
3140
/// {@template pub_license}
3241
/// Enables checking pub.dev's hosted packages license.
3342
/// {@endtemplate}
3443
class PubLicense {
3544
/// {@macro pub_license}
3645
PubLicense({
3746
@visibleForTesting http.Client? client,
38-
@visibleForTesting
39-
html_dom.Document Function(
40-
dynamic input, {
41-
String? encoding,
42-
bool generateSpans,
43-
String? sourceUrl,
44-
})? parse,
47+
@visibleForTesting HtmlDocumentParse? parse,
4548
}) : _client = client ?? http.Client(),
4649
_parse = parse ?? html_parser.parse;
4750

0 commit comments

Comments
 (0)