Skip to content

Commit 34f3358

Browse files
authored
Allow latest pkg:yaml (#768)
Prepare to publish v1.0.4
1 parent 3b68dbb commit 34f3358

File tree

3 files changed

+17
-4
lines changed

3 files changed

+17
-4
lines changed

checked_yaml/CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
## 1.0.4
2+
3+
- Allow `package:yaml` `v3.x`.
4+
15
## 1.0.3
26

37
- Require at least Dart `2.7.0`.

checked_yaml/lib/checked_yaml.dart

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,8 +27,17 @@ T checkedYamlDecode<T>(
2727
allowNull ??= false;
2828
YamlNode yaml;
2929

30+
Uri sourceUri;
31+
if (sourceUrl == null) {
32+
// noop
33+
} else if (sourceUrl is Uri) {
34+
sourceUri = sourceUrl;
35+
} else {
36+
sourceUri = Uri.parse(sourceUrl as String);
37+
}
38+
3039
try {
31-
yaml = loadYamlNode(yamlContent, sourceUrl: sourceUrl);
40+
yaml = loadYamlNode(yamlContent, sourceUrl: sourceUri);
3241
} on YamlException catch (e) {
3342
throw ParsedYamlException.fromYamlException(e);
3443
}

checked_yaml/pubspec.yaml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
name: checked_yaml
2-
version: 1.0.3
2+
version: 1.0.4
33
description: >-
44
Generate more helpful exceptions when decoding YAML documents using
55
package:json_serializable and package:yaml.
6-
homepage: https://github.com/google/json_serializable.dart
6+
repository: https://github.com/google/json_serializable.dart
77
environment:
88
sdk: '>=2.7.0 <3.0.0'
99

1010
dependencies:
1111
json_annotation: '>=2.2.0 <5.0.0'
1212
source_span: ^1.0.0
13-
yaml: ^2.1.13
13+
yaml: '>=2.1.13 <4.0.0'
1414

1515
dev_dependencies:
1616
build_runner: ^1.0.0

0 commit comments

Comments
 (0)