diff --git a/api-extractor/report/hls.js.api.md b/api-extractor/report/hls.js.api.md index 28dc0c2f959..278e8a79b3c 100644 --- a/api-extractor/report/hls.js.api.md +++ b/api-extractor/report/hls.js.api.md @@ -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; diff --git a/src/utils/attr-list.ts b/src/utils/attr-list.ts index ba5d0fd8506..32984bc29c0 100755 --- a/src/utils/attr-list.ts +++ b/src/utils/attr-list.ts @@ -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 {