mirror of
https://github.com/whoeevee/EeveeSpotifyReborn.git
synced 2026-01-09 00:23:20 +01:00
85a002b9b3
* chore: gitignore .vscode * fix(lrclib): use 'get' API, return empty lines when instrumental * build: add workflow_dispatch trigger * fix: encode query strings with stricter character set
15 lines
549 B
Swift
15 lines
549 B
Swift
import Foundation
|
|
|
|
extension Dictionary {
|
|
var queryString: String {
|
|
return self
|
|
.compactMap({ (key, value) -> String? in
|
|
guard let keyString = "\(key)".addingPercentEncoding(withAllowedCharacters: .urlQueryAllowedStrict),
|
|
let valueString = "\(value)".addingPercentEncoding(withAllowedCharacters: .urlQueryAllowedStrict) else {
|
|
return nil
|
|
}
|
|
return "\(keyString)=\(valueString)"
|
|
})
|
|
.joined(separator: "&")
|
|
}
|
|
} |