blob: 27ab4fa1aca11fb3afe952e9841470b65c6ccded [file] [log] [blame]
// Copyright (c) 2017, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'package:file/src/io.dart' as io;
String getPath(path) {
if (path is io.FileSystemEntity) {
return path.path;
} else if (path is String) {
return path;
} else if (path is Uri) {
return path.toFilePath();
} else {
throw new ArgumentError('Invalid type for "path": ${path?.runtimeType}');
}
}