mirror of
https://github.com/ThatGuySam/doesitarm.git
synced 2026-05-15 06:35:20 -07:00
Add ensureListingDetails to prevent redundancy
This commit is contained in:
parent
98099df011
commit
1055f80429
1 changed files with 11 additions and 0 deletions
|
|
@ -93,6 +93,8 @@ export class ListingDetails {
|
||||||
|
|
||||||
type = ''
|
type = ''
|
||||||
|
|
||||||
|
isListingDetails = true
|
||||||
|
|
||||||
get mainHeading () {
|
get mainHeading () {
|
||||||
if ( this.type === 'formula' ) {
|
if ( this.type === 'formula' ) {
|
||||||
return `Does <code>${ this.api.name }</code> work on Apple Silicon when installed via Homebrew?`
|
return `Does <code>${ this.api.name }</code> work on Apple Silicon when installed via Homebrew?`
|
||||||
|
|
@ -176,3 +178,12 @@ export class ListingDetails {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
export function ensureListingDetails ( listing ) {
|
||||||
|
if ( listing.isListingDetails ) {
|
||||||
|
return listing
|
||||||
|
}
|
||||||
|
|
||||||
|
return new ListingDetails( listing )
|
||||||
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue