Skip to content

Commit c8e14b4

Browse files
authored
Allow petitparser version >=2.1.1<4.0.0 (#49)
1 parent 0918428 commit c8e14b4

File tree

4 files changed

+10
-4
lines changed

4 files changed

+10
-4
lines changed

pem/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,6 @@
1+
## v1.0.1
2+
* Fixed incompability with petitparser version 3.x
3+
* Relaxed dependency constraints on petitparser to `>=2.1.1<4.0.0`.
4+
15
## v1.0.0
26
* Initial release, with support for encoding/decoding PEM blocks.

pem/lib/pem.dart

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ library pem;
5959

6060
import 'dart:convert' show base64, Codec, Converter;
6161
import 'dart:math' as math;
62+
import 'package:petitparser/petitparser.dart';
63+
6264
import 'src/parser.dart' show stricttextualmsg, laxtextualmsg;
6365

6466
/// Labels for PEM encoded strings.

pem/lib/src/helpers.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,10 +34,10 @@ void _flattenString(dynamic value, StringBuffer target) {
3434
}
3535

3636
/// Create a [Parser] that ignores output from [p] and return `null`.
37-
Parser<String> ignore<T>(Parser<T> p) => ActionParser(p, (_) => null);
37+
Parser<String> ignore<T>(Parser<T> p) => p.map((_) => null);
3838

3939
/// Create a [Parser] that flattens all strings in the result from [p].
40-
Parser<String> flatten(Parser<dynamic> p) => ActionParser(p, (value) {
40+
Parser<String> flatten(Parser<dynamic> p) => p.map((value) {
4141
final s = StringBuffer();
4242
_flattenString(value, s);
4343
return s.toString();

pem/pubspec.yaml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
name: pem
2-
version: 1.0.0
2+
version: 1.0.1
33
authors:
44
- Jonas Finnemann Jensen <[email protected]>
55
description: |
@@ -10,7 +10,7 @@ homepage: https://github.com/google/dart-neats/tree/master/pem
1010
repository: https://github.com/google/dart-neats.git
1111
issue_tracker: https://github.com/google/dart-neats/labels/pkg:pem
1212
dependencies:
13-
petitparser: ^2.1.1
13+
petitparser: '>=2.1.1<4.0.0'
1414
dev_dependencies:
1515
test: ^1.5.1
1616
pedantic: ^1.4.0

0 commit comments

Comments
 (0)