mirror of
https://github.com/mas-cli/mas
synced 2024-11-21 19:23:01 +00:00
Improve parameter names.
Partial #592 Signed-off-by: Ross Goldberg <484615+rgoldberg@users.noreply.github.com>
This commit is contained in:
parent
586de07389
commit
2af2a42a88
2 changed files with 6 additions and 6 deletions
|
@ -58,14 +58,14 @@ extension Mas {
|
|||
let apps: [SoftwareProduct] =
|
||||
appIDs.isEmpty
|
||||
? appLibrary.installedApps
|
||||
: appIDs.compactMap {
|
||||
if let appID = AppID($0) {
|
||||
: appIDs.compactMap { appID in
|
||||
if let appID = AppID(appID) {
|
||||
// argument is an AppID, lookup app by id using argument
|
||||
return appLibrary.installedApp(withAppID: appID)
|
||||
}
|
||||
|
||||
// argument is not an AppID, lookup app by name using argument
|
||||
return appLibrary.installedApp(named: $0)
|
||||
return appLibrary.installedApp(named: appID)
|
||||
}
|
||||
|
||||
let promises = apps.map { installedApp in
|
||||
|
|
|
@ -36,7 +36,7 @@ class MasStoreSearch: StoreSearch {
|
|||
///
|
||||
/// - Parameter searchTerm: a search term matched against app names
|
||||
/// - Returns: A Promise of an Array of SearchResults matching searchTerm
|
||||
func search(for appName: String) -> Promise<[SearchResult]> {
|
||||
func search(for searchTerm: String) -> Promise<[SearchResult]> {
|
||||
// Search for apps for compatible platforms, in order of preference.
|
||||
// Macs with Apple Silicon can run iPad and iPhone apps.
|
||||
var entities = [Entity.desktopSoftware]
|
||||
|
@ -45,8 +45,8 @@ class MasStoreSearch: StoreSearch {
|
|||
}
|
||||
|
||||
let results = entities.map { entity in
|
||||
guard let url = searchURL(for: appName, inCountry: country, ofEntity: entity) else {
|
||||
fatalError("Failed to build URL for \(appName)")
|
||||
guard let url = searchURL(for: searchTerm, inCountry: country, ofEntity: entity) else {
|
||||
fatalError("Failed to build URL for \(searchTerm)")
|
||||
}
|
||||
return loadSearchResults(url)
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue