Skip to content

Commit

Permalink
Merge pull request #13 from hyperoslo/feature/clean-argument-keys
Browse files Browse the repository at this point in the history
Feature clean argument keys
  • Loading branch information
vadymmarkov committed Nov 23, 2015
2 parents 6d02ff3 + 7e4c0b3 commit dfec953
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Pod/Tests/TestCompass.swift
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class TestCompass: XCTestCase {
let url = NSURL(string: "compassTests://profile:testUser")!
Compass.parse(url) { route, arguments in
XCTAssertEqual("profile:{user}", route)
XCTAssertEqual(arguments["{user}"], "testUser")
XCTAssertEqual(arguments["user"], "testUser")
}
}

Expand Down
2 changes: 1 addition & 1 deletion Source/Compass.swift
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ public struct Compass {

if queryArguments.count == routeArguments.count {
for (index, key) in routeArguments.enumerate() {
arguments[key] = index <= queryArguments.count && "\(query):" != prefix
arguments[String(key.characters.dropFirst().dropLast())] = index <= queryArguments.count && "\(query):" != prefix
? queryArguments[index] : nil
}
completion(route: route, arguments: arguments)
Expand Down

0 comments on commit dfec953

Please sign in to comment.