mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-18 06:44:46 -07:00
Use Map for formulaeList
This commit is contained in:
parent
f19d112736
commit
f19e8d2a5c
1 changed files with 15 additions and 8 deletions
|
|
@ -75,6 +75,13 @@ class MakeHomebrewList {
|
||||||
return null
|
return null
|
||||||
}
|
}
|
||||||
|
|
||||||
|
hasArm64Formula( formulaData ) {
|
||||||
|
// Check the official list first since it's data is newer and more frequently updated
|
||||||
|
const hasStableFormula = (formulaData.bottle.stable !== undefined)
|
||||||
|
|
||||||
|
return hasStableFormula && (formulaData.bottle.stable.files['arm64_big_sur'] !== undefined)
|
||||||
|
}
|
||||||
|
|
||||||
formulaIsNative (formulae) {
|
formulaIsNative (formulae) {
|
||||||
// Search Formulae from Homebrew API
|
// Search Formulae from Homebrew API
|
||||||
const formulaData = this.allFormulae[formulae.fullName] || this.searchFormulaeForName(formulae.name)
|
const formulaData = this.allFormulae[formulae.fullName] || this.searchFormulaeForName(formulae.name)
|
||||||
|
|
@ -94,7 +101,7 @@ class MakeHomebrewList {
|
||||||
const hasStableFormula = (formulaData.bottle.stable !== undefined)
|
const hasStableFormula = (formulaData.bottle.stable !== undefined)
|
||||||
const hasArm64Formula = hasStableFormula && (formulaData.bottle.stable.files['arm64_big_sur'] !== undefined)
|
const hasArm64Formula = hasStableFormula && (formulaData.bottle.stable.files['arm64_big_sur'] !== undefined)
|
||||||
|
|
||||||
return hasArm64Formula
|
return this.hasArm64Formula( formulaData )
|
||||||
}
|
}
|
||||||
|
|
||||||
parseStatus (formulae) {
|
parseStatus (formulae) {
|
||||||
|
|
@ -203,7 +210,11 @@ class MakeHomebrewList {
|
||||||
// console.log('formulaeWithStatus', formulaeWithStatus)
|
// console.log('formulaeWithStatus', formulaeWithStatus)
|
||||||
|
|
||||||
|
|
||||||
const formulaeList = []
|
const formulaeList = new Map()
|
||||||
|
|
||||||
|
const category = {
|
||||||
|
slug: 'homebrew'
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
for (const formulae of this.issueTableRowData) {
|
for (const formulae of this.issueTableRowData) {
|
||||||
|
|
@ -224,11 +235,7 @@ class MakeHomebrewList {
|
||||||
// strict: true
|
// strict: true
|
||||||
// })
|
// })
|
||||||
|
|
||||||
const category = {
|
formulaeList.set(formulae.name, {
|
||||||
slug: 'homebrew'
|
|
||||||
}
|
|
||||||
|
|
||||||
formulaeList.push({
|
|
||||||
name: formulae.name,
|
name: formulae.name,
|
||||||
status: this.parseStatus(formulae),
|
status: this.parseStatus(formulae),
|
||||||
// url: `https://formulae.brew.sh/formula/${formulae.name}`,
|
// url: `https://formulae.brew.sh/formula/${formulae.name}`,
|
||||||
|
|
@ -256,7 +263,7 @@ class MakeHomebrewList {
|
||||||
|
|
||||||
// console.log('formulaeList', formulaeList)
|
// console.log('formulaeList', formulaeList)
|
||||||
|
|
||||||
return formulaeList
|
return Array.from( formulaeList , ([_, data]) => data )
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue