OLD | NEW |
1 // Copyright (c) 2013, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2013, 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 watcher.path_dart; | 5 library watcher.path_dart; |
6 | 6 |
7 import 'dart:collection'; | 7 import 'dart:collection'; |
8 | 8 |
9 import 'package:path/path.dart' as p; | 9 import 'package:path/path.dart' as p; |
10 | 10 |
(...skipping 148 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
159 // 14980). | 159 // 14980). |
160 if (!p.isRelative(relative) || parts.first == '..' || parts.first == '.') { | 160 if (!p.isRelative(relative) || parts.first == '..' || parts.first == '.') { |
161 throw new ArgumentError('Path "$path" is not inside "$root".'); | 161 throw new ArgumentError('Path "$path" is not inside "$root".'); |
162 } | 162 } |
163 return p.join(root, relative); | 163 return p.join(root, relative); |
164 } | 164 } |
165 | 165 |
166 /// Returns the segments of [path] beneath [root]. | 166 /// Returns the segments of [path] beneath [root]. |
167 List<String> _split(String path) => p.split(p.relative(path, from: root)); | 167 List<String> _split(String path) => p.split(p.relative(path, from: root)); |
168 } | 168 } |
OLD | NEW |