Skip to content

Commit

Permalink
Minor analysis fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
jpeiffer committed Aug 12, 2023
1 parent a0e1208 commit aafdbf4
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 4 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## [3.1.1] - August 12th, 2023

* Minor analysis fixes.


## [3.1.0] - July 16th, 2023

* Updated to json_class 3.0.0
Expand Down
4 changes: 2 additions & 2 deletions lib/src/expressions/functions/future_functions.dart
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@ class FutureFunctions {
'delay': (value) => value is Duration
? Future.delayed(value)
: value is String || value is num
? Future.delayed(JsonClass.parseDurationFromMillis(value)!)
? Future.delayed(JsonClass.parseDurationFromMillis(value))
: throw Exception(
'[delay]: expected [value] to be a Duration, a String, or a num but encountered: ${value?.runtimeType}',
),
'delayed': (value) => value is Duration
? Future.delayed(value)
: value is String || value is num
? Future.delayed(JsonClass.parseDurationFromMillis(value)!)
? Future.delayed(JsonClass.parseDurationFromMillis(value))
: throw Exception(
'[delayed]: expected [value] to be a Duration, a String, or a num but encountered: ${value?.runtimeType}',
),
Expand Down
2 changes: 1 addition & 1 deletion pubspec.yaml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: 'template_expressions'
description: 'A Dart library to process string based templates using expressions.'
homepage: 'https://github.com/peiffer-innovations/template_expressions'
version: '3.1.0'
version: '3.1.1'

environment:
sdk: '>=3.0.0 <4.0.0'
Expand Down
7 changes: 6 additions & 1 deletion test/expressions/expressions_test.dart
Original file line number Diff line number Diff line change
Expand Up @@ -302,10 +302,15 @@ void main() {
});

test('string concat', () {
final context = {'a': 'alice', 'b': 'bob'};
final context = {
'a': 'alice',
'b': 'bob',
'first_name': 'John',
};
final expressions = {
'a + b': 'alicebob',
'a + " " + b': 'alice bob',
"'Welcome: ' + first_name + '!'": 'Welcome: John!',
};

expressions.forEach((e, r) {
Expand Down

0 comments on commit aafdbf4

Please sign in to comment.