Get username from filepath. (#265)

This commit is contained in:
Meris Bahtijaragic 2019-05-17 17:30:41 +02:00 committed by Yishi Lin
parent b154c04178
commit c59c72729b
3 changed files with 12 additions and 1 deletions

View file

@ -32,6 +32,10 @@ public class Password {
return url.deletingPathExtension().path
}
public var nameFromPath: String? {
return url.deletingPathExtension().path.split(separator: "/").last.map { String($0) }
}
public var password: String {
return parser.firstLine
}