Skip to content

Commit

Permalink
Fix DATERANGE parser handling of clientAttrs property (#5891)
Browse files Browse the repository at this point in the history
  • Loading branch information
robwalch committed Oct 17, 2023
1 parent ce6821a commit 664f76f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 9 deletions.
2 changes: 2 additions & 0 deletions api-extractor/report/hls.js.api.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,8 @@ export class AttrList {
// (undocumented)
bool(attrName: string): boolean;
// (undocumented)
get clientAttrs(): string[];
// (undocumented)
decimalFloatingPoint(attrName: string): number;
// (undocumented)
decimalInteger(attrName: string): number;
Expand Down
13 changes: 4 additions & 9 deletions src/utils/attr-list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,16 +9,11 @@ export class AttrList {
if (typeof attrs === 'string') {
attrs = AttrList.parseAttrList(attrs);
}
Object.assign(this, attrs);
}

for (const attr in attrs) {
if (attrs.hasOwnProperty(attr)) {
if (attr.substring(0, 2) === 'X-') {
this.clientAttrs = this.clientAttrs || [];
this.clientAttrs.push(attr);
}
this[attr] = attrs[attr];
}
}
get clientAttrs(): string[] {
return Object.keys(this).filter((attr) => attr.substring(0, 2) === 'X-');
}

decimalInteger(attrName: string): number {
Expand Down

0 comments on commit 664f76f

Please sign in to comment.