From 9376e92d7dcc3b9776f8ccf79e6cda27f96eac34 Mon Sep 17 00:00:00 2001 From: gmpassos Date: Wed, 10 Mar 2021 04:36:31 -0300 Subject: [PATCH] v3.0.2 - Null safety migration adjustments. --- CHANGELOG.md | 4 ++++ README.md | 5 ++--- lib/src/regexp.dart | 4 ++-- pubspec.yaml | 2 +- 4 files changed, 9 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 2322224..91b7796 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,7 @@ +## 3.0.2 + +- Null safety migration adjustments. + ## 3.0.1 - Null safety migration adjustments. diff --git a/README.md b/README.md index d0f9fc0..4fa5670 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,8 @@ # Swiss Knife [![pub package](https://img.shields.io/pub/v/swiss_knife.svg?logo=dart&logoColor=00b9fc)](https://pub.dartlang.org/packages/swiss_knife) +[![Null Safety](https://img.shields.io/badge/null-safety-brightgreen)](https://dart.dev/null-safety) + [![CI](https://img.shields.io/github/workflow/status/gmpassos/swiss_knife/Dart%20CI/master?logo=github-actions&logoColor=white)](https://github.com/gmpassos/swiss_knife/actions) [![GitHub Tag](https://img.shields.io/github/v/tag/gmpassos/swiss_knife?logo=git&logoColor=white)](https://github.com/gmpassos/swiss_knife/releases) [![New Commits](https://img.shields.io/github/commits-since/gmpassos/swiss_knife/latest?logo=git&logoColor=white)](https://github.com/gmpassos/swiss_knife/network) @@ -8,9 +10,6 @@ [![Pull Requests](https://img.shields.io/github/issues-pr/gmpassos/swiss_knife?logo=github&logoColor=white)](https://github.com/gmpassos/swiss_knife/pulls) [![Code size](https://img.shields.io/github/languages/code-size/gmpassos/swiss_knife?logo=github&logoColor=white)](https://github.com/gmpassos/swiss_knife) [![License](https://img.shields.io/github/license/gmpassos/swiss_knife?logo=open-source-initiative&logoColor=green)](https://github.com/gmpassos/swiss_knife/blob/master/LICENSE) -[![Funding](https://img.shields.io/badge/Donate-yellow?labelColor=666666&style=plastic&logo=liberapay)](https://liberapay.com/gmpassos/donate) -[![Funding](https://img.shields.io/liberapay/patrons/gmpassos.svg?logo=liberapay)](https://liberapay.com/gmpassos/donate) - Dart Useful Tools: diff --git a/lib/src/regexp.dart b/lib/src/regexp.dart index fe7d0f2..3a496e9 100644 --- a/lib/src/regexp.dart +++ b/lib/src/regexp.dart @@ -284,7 +284,7 @@ final RegExp STRING_PLACEHOLDER_PATTERN = RegExp(r'{{(/?\w+(?:/\w+)*/?)}}'); /// Builds a string using as place holders in the format `{{key}}` /// from [parameters] and [extraParameters]. String? buildStringPattern(String? pattern, Map? parameters, - [List? extraParameters]) { + [List? extraParameters]) { if (pattern == null) return null; return replaceStringMarks(pattern, STRING_PLACEHOLDER_PATTERN, (varName) { @@ -300,7 +300,7 @@ String? buildStringPattern(String? pattern, Map? parameters, if (val == null && extraParameters != null) { for (var parameters2 in extraParameters) { - if (parameters2.isNotEmpty) { + if (parameters2 != null && parameters2.isNotEmpty) { val = findKeyPathValue(parameters2, varName); if (val != null) break; } diff --git a/pubspec.yaml b/pubspec.yaml index dc51b30..67e49b6 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -1,6 +1,6 @@ name: swiss_knife description: Dart Useful Tools - collections, math, date, uri, json, events, resources, regexp, etc... -version: 3.0.1 +version: 3.0.2 homepage: https://github.com/gmpassos/swiss_knife environment: