OLD | NEW |
(Empty) | |
| 1 // Copyright (c) 2015, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. |
| 4 |
| 5 library http_parser.case_insensitive_map; |
| 6 |
| 7 import 'package:collection/collection.dart'; |
| 8 |
| 9 /// A map from case-insensitive strings to values. |
| 10 /// |
| 11 /// Much of HTTP is case-insensitive, so this is useful to have pre-defined. |
| 12 class CaseInsensitiveMap<V> extends CanonicalizedMap<String, String, V> { |
| 13 CaseInsensitiveMap() |
| 14 : super((key) => key.toLowerCase(), isValidKey: (key) => key != null); |
| 15 |
| 16 CaseInsensitiveMap.from(Map<String, V> other) |
| 17 : super.from(other, (key) => key.toLowerCase(), |
| 18 isValidKey: (key) => key != null); |
| 19 } |
OLD | NEW |