Skip to content

Commit e6c9f97

Browse files
committed
Remove fragments from parse
1 parent 6dedbf4 commit e6c9f97

1 file changed

Lines changed: 5 additions & 11 deletions

File tree

Sources/Compass.swift

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -18,11 +18,11 @@ public struct Compass {
1818

1919
public static var routes = [String]()
2020

21-
public static func parse(url: NSURL, fragments: [String : AnyObject] = [:], payload: Any? = nil) -> Location? {
21+
public static func parse(url: NSURL, payload: Any? = nil) -> Location? {
2222
let path = url.absoluteString.substringFromIndex(scheme.endIndex)
2323

2424
guard !(path.containsString("?") || path.containsString("#")) else {
25-
return parseAsURL(url, fragments: fragments, payload: payload)
25+
return parseAsURL(url, payload: payload)
2626
}
2727

2828
let results: [Result] = routes.flatMap {
@@ -36,16 +36,13 @@ public struct Compass {
3636
}
3737

3838
if let result = results.first {
39-
return Location(path: result.route,
40-
arguments: result.arguments,
41-
fragments: fragments,
42-
payload: payload)
39+
return Location(path: result.route, arguments: result.arguments, payload: payload)
4340
}
4441

4542
return nil
4643
}
4744

48-
static func parseAsURL(url: NSURL, fragments: [String : AnyObject] = [:], payload: Any? = nil) -> Location? {
45+
static func parseAsURL(url: NSURL, payload: Any? = nil) -> Location? {
4946
guard let route = url.host else { return nil }
5047

5148
let urlComponents = NSURLComponents(URL: url, resolvingAgainstBaseURL: false)
@@ -59,10 +56,7 @@ public struct Compass {
5956
arguments = fragment.queryParameters()
6057
}
6158

62-
return Location(path: route,
63-
arguments: arguments,
64-
fragments: fragments,
65-
payload: payload)
59+
return Location(path: route, arguments: arguments, payload: payload)
6660
}
6761

6862
static func findMatch(routeString: String, pathString: String) -> Result? {

0 commit comments

Comments
 (0)