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:
@@ -19,9 +19,12 @@ class ToggleButton {
|
||||
data.defaultText?.accessibility?.accessibilityData.label ||
|
||||
data?.accessibility?.label;
|
||||
|
||||
this.icon_type == 'LIKE' &&
|
||||
(this.like_count = parseInt(acc_label.replace(/\D/g, ''))) &&
|
||||
(this.short_like_count = new Text(data.defaultText).toString());
|
||||
if (this.icon_type == 'LIKE') {
|
||||
this.like_count = parseInt(acc_label.replace(/\D/g, ''))
|
||||
if (this.like_count) {
|
||||
this.short_like_count = new Text(data.defaultText).toString()
|
||||
}
|
||||
}
|
||||
|
||||
this.endpoint =
|
||||
data.defaultServiceEndpoint?.commandExecutorCommand?.commands &&
|
||||
|
||||
Reference in New Issue
Block a user