Skip to content

Commit 55b3f7b

Browse files
committed
Cleanup
1 parent 4d108b8 commit 55b3f7b

1 file changed

Lines changed: 3 additions & 7 deletions

File tree

src/models/metadata.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -578,20 +578,16 @@ export class Metadata {
578578
// so check both the dashed and snake versions
579579
// ie. 'creator-alt-script' is easier to access as 'creator_alt_script'
580580
const normalizedKey = key.replace(/-/g, '_');
581-
if (normalizedKey === key) {
582-
return this._valueFor(key);
583-
} else {
584-
return this._valueFor(normalizedKey) ?? this._valueFor(key);
585-
}
581+
return this._valueFor(normalizedKey) ?? this._valueFor(key);
586582
}
587583

588584
@Memoize() private _valueFor(
589585
key: string,
590586
): MetadataFieldInterface<unknown> | undefined {
591-
const value = this[key as keyof Metadata] as
587+
const field = this[key as keyof Metadata] as
592588
| MetadataFieldInterface<unknown>
593589
| undefined;
594-
if (value) return value;
590+
if (field) return field;
595591

596592
const rawValue = this.rawMetadata[key];
597593
if (rawValue != null) {

0 commit comments

Comments
 (0)