mirror of
https://github.com/LuanRT/YouTube.js.git
synced 2026-07-02 21:52:48 +00:00
refactor: remove confusing code practices (#87)
* Prefer `c ? x : y` over `c && x || y` * Avoid unnecessary asssignment expressions * Prefer switch statements over object lookup tables * Add an .editorconfig * Fix style issues * Fix mentioned issues Co-authored-by: bob <bob.varioa@gmail.com>
This commit is contained in:
@@ -7,16 +7,18 @@ class MusicCarouselShelfBasicHeader {
|
||||
type = 'MusicCarouselShelfBasicHeader';
|
||||
|
||||
constructor(data) {
|
||||
data.strapline &&
|
||||
(this.strapline = new Text(data.strapline).toString());
|
||||
if (data.strapline) {
|
||||
this.strapline = new Text(data.strapline).toString()
|
||||
}
|
||||
|
||||
this.title = new Text(data.title).toString();
|
||||
|
||||
// this.label = data.accessibilityData.accessibilityData.label;
|
||||
// ^^ redundant?
|
||||
|
||||
data.thumbnail &&
|
||||
(this.thumbnail = Thumbnail.fromResponse(data.thumbnail.musicThumbnailRenderer.thumbnail));
|
||||
if (data.thumbnail) {
|
||||
this.thumbnail = Thumbnail.fromResponse(data.thumbnail.musicThumbnailRenderer.thumbnail)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user