OLD | NEW |
1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2012, the Dart project authors. Please see the AUTHORS file |
2 // for details. All rights reserved. Use of this source code is governed by a | 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. | 3 // BSD-style license that can be found in the LICENSE file. |
4 | 4 |
5 library utils; | 5 library utils; |
6 | 6 |
7 import 'dart:isolate'; | 7 import 'dart:isolate'; |
8 import 'package:web_components/src/messages.dart'; | 8 import 'package:web_ui/src/messages.dart'; |
9 | 9 |
10 /** | 10 /** |
11 * Converts a string name with hyphens into an identifier, by removing hyphens | 11 * Converts a string name with hyphens into an identifier, by removing hyphens |
12 * and capitalizing the following letter. Optionally [startUppercase] to | 12 * and capitalizing the following letter. Optionally [startUppercase] to |
13 * captialize the first letter. | 13 * captialize the first letter. |
14 */ | 14 */ |
15 String toCamelCase(String hyphenedName, {bool startUppercase: false}) { | 15 String toCamelCase(String hyphenedName, {bool startUppercase: false}) { |
16 var segments = hyphenedName.split('-'); | 16 var segments = hyphenedName.split('-'); |
17 int start = startUppercase ? 0 : 1; | 17 int start = startUppercase ? 0 : 1; |
18 for (int i = start; i < segments.length; i++) { | 18 for (int i = start; i < segments.length; i++) { |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
204 } | 204 } |
205 | 205 |
206 /** Iterates through an infinite sequence, starting from zero. */ | 206 /** Iterates through an infinite sequence, starting from zero. */ |
207 class IntIterator implements Iterator<int> { | 207 class IntIterator implements Iterator<int> { |
208 int _next = 0; | 208 int _next = 0; |
209 | 209 |
210 bool get hasNext => true; | 210 bool get hasNext => true; |
211 | 211 |
212 int next() => _next++; | 212 int next() => _next++; |
213 } | 213 } |
OLD | NEW |