Skip to content

Commit

Permalink
enable 'array-bracket-spacing' rule
Browse files Browse the repository at this point in the history
  • Loading branch information
tjenkinson committed Sep 28, 2019
1 parent bcf6c56 commit eb16793
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 9 deletions.
2 changes: 1 addition & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ module.exports = {
'no-global-assign': 2,
'prefer-const': 2,
'dot-notation': 0,
'array-bracket-spacing': 0,
'array-bracket-spacing': 2,
'quote-props': 2,
'no-void': 0,
'no-useless-catch': 2,
Expand Down
4 changes: 2 additions & 2 deletions src/loader/m3u8-parser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,7 @@ export default class M3U8Parser {
// avoid sliced strings https://github.com/video-dev/hls.js/issues/939
const title = (' ' + result[2]).slice(1);
frag.title = title || null;
frag.tagList.push(title ? [ 'INF', duration, title ] : [ 'INF', duration ]);
frag.tagList.push(title ? ['INF', duration, title] : ['INF', duration]);
} else if (result[3]) { // url
if (Number.isFinite(frag.duration)) {
const sn = currentSN++;
Expand Down Expand Up @@ -227,7 +227,7 @@ export default class M3U8Parser {

switch (result[i]) {
case '#':
frag.tagList.push(value2 ? [ value1, value2 ] : [ value1 ]);
frag.tagList.push(value2 ? [value1, value2] : [value1]);
break;
case 'PLAYLIST-TYPE':
level.type = value1.toUpperCase();
Expand Down
2 changes: 1 addition & 1 deletion src/types/level.ts
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ export class Level {
public unknownCodecs: string[] | undefined;

constructor (data: LevelParsed) {
this.url = [ data.url ];
this.url = [data.url];
this.attrs = data.attrs;
this.bitrate = data.bitrate;
this.details = data.details;
Expand Down
10 changes: 5 additions & 5 deletions tests/unit/controller/abr-controller.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ describe('AbrController', function () {
const hls = new Hls({ maxStarvationDelay: 4 });
hls.levelController._levels = [
{ bitrate: 105000, name: '144', details: { totalduration: 4, fragments: [{}] } },
{ bitrate: 246440, name: '240', details: { totalduration: 10, fragments: [ {} ] } },
{ bitrate: 460560, name: '380', details: { totalduration: 10, fragments: [ {} ] } },
{ bitrate: 836280, name: '480', details: { totalduration: 10, fragments: [ {} ] } },
{ bitrate: 2149280, name: '720', details: { totalduration: 10, fragments: [ {} ] } },
{ bitrate: 6221600, name: '1080', details: { totalduration: 10, fragments: [ {} ] } }
{ bitrate: 246440, name: '240', details: { totalduration: 10, fragments: [{}] } },
{ bitrate: 460560, name: '380', details: { totalduration: 10, fragments: [{}] } },
{ bitrate: 836280, name: '480', details: { totalduration: 10, fragments: [{}] } },
{ bitrate: 2149280, name: '720', details: { totalduration: 10, fragments: [{}] } },
{ bitrate: 6221600, name: '1080', details: { totalduration: 10, fragments: [{}] } }
];
const abrController = new AbrController(hls);
abrController.bwEstimator = new EwmaBandWidthEstimator(hls, 15, 4, 5e5);
Expand Down

0 comments on commit eb16793

Please sign in to comment.