Upgrade analyzer to <15.0.0 in shelf_router_generator (#533)
diff --git a/pkgs/shelf_router_generator/CHANGELOG.md b/pkgs/shelf_router_generator/CHANGELOG.md
index ae483b7..79f67bd 100644
--- a/pkgs/shelf_router_generator/CHANGELOG.md
+++ b/pkgs/shelf_router_generator/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 1.1.5
+
+* Support `analyzer` versions up to `14.x`.
+
## 1.1.4
* Support `analyzer: '^10.0.0'`
diff --git a/pkgs/shelf_router_generator/pubspec.yaml b/pkgs/shelf_router_generator/pubspec.yaml
index 105e1f7..cefc418 100644
--- a/pkgs/shelf_router_generator/pubspec.yaml
+++ b/pkgs/shelf_router_generator/pubspec.yaml
@@ -1,5 +1,5 @@
name: shelf_router_generator
-version: 1.1.4
+version: 1.1.5
description: >
A package:build-compatible builder for generating request routers for the
shelf web-framework based on source annotations.
@@ -14,7 +14,7 @@
sdk: ^3.9.0
dependencies:
- analyzer: '>=8.1.1 <11.0.0'
+ analyzer: '>=8.1.1 <15.0.0'
build: ^4.0.0
build_config: ^1.2.0
code_builder: ^4.2.0
diff --git a/pkgs/shelf_static/lib/src/util.dart b/pkgs/shelf_static/lib/src/util.dart
index 2d42379..ba62177 100644
--- a/pkgs/shelf_static/lib/src/util.dart
+++ b/pkgs/shelf_static/lib/src/util.dart
@@ -3,6 +3,9 @@
// BSD-style license that can be found in the LICENSE file.
DateTime toSecondResolution(DateTime dt) {
- if (dt.millisecond == 0) return dt;
- return dt.subtract(Duration(milliseconds: dt.millisecond));
+ if (dt.millisecond == 0 && dt.microsecond == 0) return dt;
+ return dt.subtract(Duration(
+ milliseconds: dt.millisecond,
+ microseconds: dt.microsecond,
+ ));
}