]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/commitdiff
tslint update
authorChocobozzz <me@florianbigard.com>
Tue, 2 Apr 2019 16:30:26 +0000 (18:30 +0200)
committerChocobozzz <me@florianbigard.com>
Tue, 2 Apr 2019 16:30:26 +0000 (18:30 +0200)
26 files changed:
client/package.json
client/src/app/+accounts/accounts.component.ts
client/src/app/+video-channels/video-channel-playlists/video-channel-playlists.component.html
client/src/app/shared/forms/form-reactive.ts
client/src/app/shared/misc/utils.ts
client/src/app/shared/renderer/markdown.service.ts
client/src/app/shared/video-playlist/video-playlist-element-miniature.component.html
client/src/app/shared/video-playlist/video-playlist-miniature.component.html
client/src/app/videos/+video-watch/video-watch.component.html
client/src/assets/player/p2p-media-loader/segment-url-builder.ts
client/src/assets/player/utils.ts
client/src/assets/player/videojs-components/resolution-menu-button.ts
client/src/assets/player/videojs-components/settings-menu-button.ts
client/src/assets/player/videojs-components/settings-menu-item.ts
client/src/assets/player/webtorrent/peertube-chunk-store.ts
client/src/assets/player/webtorrent/video-renderer.ts
client/src/assets/player/webtorrent/webtorrent-plugin.ts
client/src/polyfills.ts
client/src/standalone/player/definitions.ts
client/src/standalone/player/events.ts
client/src/standalone/videos/embed.ts
client/src/standalone/videos/test-embed.ts
client/tsconfig.json
client/tslint.json
client/yarn.lock
shared/models/videos/video-resolution.enum.ts

index edcddcfee17f36cfe969a2d4b87482b935afd899..c1532ee62564f9cae688a65e4da92f7c05fa1356 100644 (file)
@@ -73,7 +73,6 @@
     "bootstrap": "^4.1.3",
     "buffer": "^5.1.0",
     "cache-chunk-store": "^3.0.0",
-    "codelyzer": "^5.0.0",
     "core-js": "^3.0.0",
     "css-loader": "^2.1.1",
     "dexie": "^2.0.4",
     "stream-http": "^3.0.0",
     "terser-webpack-plugin": "^1.1.0",
     "tslint": "^5.7.0",
+    "tslint-angular": "^1.1.2",
     "tslint-config-standard": "^8.0.1",
     "typescript": "3.2",
     "video.js": "^7",
index e8339b78bd76d80a95a16de0d4607a6d751b18b1..d9786fb5cb2052749958d4eae0eef12d133ba232 100644 (file)
@@ -7,7 +7,6 @@ import { catchError, distinctUntilChanged, map, switchMap, tap } from 'rxjs/oper
 import { Subscription } from 'rxjs'
 import { AuthService, Notifier, RedirectService } from '@app/core'
 import { User, UserRight } from '../../../../shared'
-import { I18n } from '@ngx-translate/i18n-polyfill'
 
 @Component({
   templateUrl: './accounts.component.html',
index 0d9fba3756f037f13f6f9a4d00ddf9390ade4694..befc7143cde58b0aa01ddfacf8d2a26e5886baaf 100644 (file)
@@ -1,5 +1,5 @@
 <div i18n class="title-page title-page-single">
-  Created {{pagination.totalItems}} playlists
+  Created {{ pagination.totalItems }} playlists
 </div>
 
 <div i18n class="no-results" *ngIf="pagination.totalItems === 0">This channel does not have playlists.</div>
index b9873af2c44aef9cde215933d265ec48ec7631b2..0d40b6f4ae8715eaa172235f14e8e87dca6bbd63 100644 (file)
@@ -59,7 +59,7 @@ export abstract class FormReactive {
       const isDirty = control.dirty || forceCheck === true
       if (control && isDirty && !control.valid) {
         const messages = validationMessages[ field ]
-        for (const key in control.errors) {
+        for (const key of Object.keys(control.errors)) {
           formErrors[ field ] += messages[ key ] + ' '
         }
       }
index 8a1d342c9e1e344c8104bb23d18c27131d56b334..85fc1c3a0987af8f03af863be655be1480790791 100644 (file)
@@ -78,10 +78,10 @@ function objectToUrlEncoded (obj: any) {
 
 // Thanks: https://gist.github.com/ghinda/8442a57f22099bdb2e34
 function objectToFormData (obj: any, form?: FormData, namespace?: string) {
-  let fd = form || new FormData()
+  const fd = form || new FormData()
   let formKey
 
-  for (let key of Object.keys(obj)) {
+  for (const key of Object.keys(obj)) {
     if (namespace) formKey = `${namespace}[${key}]`
     else formKey = key
 
index 69dc60aaf7726a5209506c54fcce1513736bd241..9a90663511c850767e91f2e5755b3f292ae6656a 100644 (file)
@@ -45,7 +45,7 @@ export class MarkdownService {
 
     const markdownIt = new MarkdownItClass('zero', { linkify: true, breaks: true })
 
-    for (let rule of rules) {
+    for (const rule of rules) {
       markdownIt.enable(rule)
     }
 
index 4764fc0e1511ca6f1921d0e9202a198c01967c3c..ab5a789286c598c4bfd64c882f9c56ae6c84043b 100644 (file)
@@ -19,7 +19,7 @@
       <a *ngIf="accountLink" tabindex="-1" class="video-info-account" [routerLink]="[ '/accounts', video.byAccount ]">{{ video.byAccount }}</a>
       <span *ngIf="!accountLink" tabindex="-1" class="video-info-account">{{ video.byAccount }}</span>
 
-      <span tabindex="-1" class="video-info-timestamp">{{ formatTimestamp(video)}}</span>
+      <span tabindex="-1" class="video-info-timestamp">{{ formatTimestamp(video) }}</span>
     </div>
   </a>
 
@@ -66,7 +66,7 @@
       </div>
 
       <span class="dropdown-item" (click)="removeFromPlaylist(video)">
-            <my-global-icon iconName="delete"></my-global-icon> <ng-container i18n>Delete from {{playlist?.displayName}}</ng-container>
+            <my-global-icon iconName="delete"></my-global-icon> <ng-container i18n>Delete from {{ playlist?.displayName }}</ng-container>
           </span>
     </div>
   </div>
index c01c7301223a359a8a962be0c98112c8ae11e12b..faf906c593ec1e7b30e4214108a38cb4f89c3ffb 100644 (file)
@@ -6,7 +6,7 @@
     <img alt="" [attr.aria-labelledby]="playlist.displayName" [attr.src]="playlist.thumbnailUrl" />
 
     <div class="miniature-playlist-info-overlay">
-      <ng-container i18n>{playlist.videosLength, plural, =0 {No videos} =1 {1 video} other {{{playlist.videosLength}} videos}}</ng-container>
+      <ng-container i18n>{playlist.videosLength, plural, =0 {No videos} =1 {1 video} other {{{ playlist.videosLength }} videos}}</ng-container>
     </div>
 
     <div class="play-overlay">
index 91f77cbf3929819bdb63369c5eedf8875b73d633..ad1d04b702a7160bbae7fd60b75bdfcf290556af 100644 (file)
@@ -22,7 +22,7 @@
         <div class="playlist-by-index">
           <div class="playlist-by">{{ playlist.ownerBy }}</div>
           <div class="playlist-index">
-            <span>{{currentPlaylistPosition}}</span><span>{{playlistPagination.totalItems}}</span>
+            <span>{{ currentPlaylistPosition }}</span><span>{{ playlistPagination.totalItems }}</span>
           </div>
         </div>
       </div>
index 32e7ce4f2b6e3db81847cd37ae537e9fd67bb998..fb990a19dd44558bcfcb0ee72a89da16421967f2 100644 (file)
@@ -8,8 +8,8 @@ function segmentUrlBuilderFactory (baseUrls: string[]) {
 
     if (i === max - 1) return segment.url
 
-    let newBaseUrl = baseUrls[i]
-    let middlePart = newBaseUrl.endsWith('/') ? '' : '/'
+    const newBaseUrl = baseUrls[i]
+    const middlePart = newBaseUrl.endsWith('/') ? '' : '/'
 
     return newBaseUrl + middlePart + basename(segment.url)
   }
index 54f1313105e02562480c24630f2bf4d7f4f99038..0966027ace04e171d1832f9c39a93596dff821bf 100644 (file)
@@ -61,12 +61,12 @@ function secondsToTime (seconds: number, full = false, symbol?: string) {
   const minuteSymbol = (symbol || 'm')
   const secondsSymbol = full ? '' : 's'
 
-  let hours = Math.floor(seconds / 3600)
+  const hours = Math.floor(seconds / 3600)
   if (hours >= 1) time = hours + hourSymbol
   else if (full) time = '0' + hourSymbol
 
   seconds %= 3600
-  let minutes = Math.floor(seconds / 60)
+  const minutes = Math.floor(seconds / 60)
   if (minutes >= 1 && minutes < 10 && full) time += '0' + minutes + minuteSymbol
   else if (minutes >= 1) time += minutes + minuteSymbol
   else if (full) time += '00' + minuteSymbol
index abcc16411df0b7727d821947b515316cd074137e..cff44de72e3bdccd8cca06eeb33753db9a844ace 100644 (file)
@@ -49,7 +49,7 @@ class ResolutionMenuButton extends MenuButton {
 
   private addClickListener (component: any) {
     component.on('click', () => {
-      let children = this.menu.children()
+      const children = this.menu.children()
 
       for (const child of children) {
         if (component !== child) {
index 14cb8ba43367c52c3dc0b4236c10a95d9bc2c7fe..5e09032b410d9ddea0015372b27b967af3c0c1be 100644 (file)
@@ -53,7 +53,7 @@ class SettingsButton extends Button {
 
   onDisposeSettingsItem (event: any, name: string) {
     if (name === undefined) {
-      let children = this.menu.children()
+      const children = this.menu.children()
 
       while (children.length > 0) {
         children[0].dispose()
@@ -62,7 +62,7 @@ class SettingsButton extends Button {
 
       this.addClass('vjs-hidden')
     } else {
-      let item = this.menu.getChild(name)
+      const item = this.menu.getChild(name)
 
       if (item) {
         item.dispose()
@@ -148,8 +148,8 @@ class SettingsButton extends Button {
       return
     }
 
-    let offset = this.options_.setup.maxHeightOffset
-    let maxHeight = this.playerComponent.el_.offsetHeight - offset
+    const offset = this.options_.setup.maxHeightOffset
+    const maxHeight = this.playerComponent.el_.offsetHeight - offset
 
     if (height > maxHeight) {
       height = maxHeight
@@ -166,7 +166,7 @@ class SettingsButton extends Button {
   buildMenu () {
     this.menu = new Menu(this.player())
     this.menu.addClass('vjs-main-menu')
-    let entries = this.options_.entries
+    const entries = this.options_.entries
 
     if (entries.length === 0) {
       this.addClass('vjs-hidden')
@@ -174,7 +174,7 @@ class SettingsButton extends Button {
       return
     }
 
-    for (let entry of entries) {
+    for (const entry of entries) {
       this.addMenuItem(entry, this.options_)
     }
 
@@ -191,7 +191,7 @@ class SettingsButton extends Button {
     }
 
     options.name = toTitleCase(entry)
-    let settingsMenuItem = new SettingsMenuItem(this.player(), options, entry, this as any)
+    const settingsMenuItem = new SettingsMenuItem(this.player(), options, entry, this as any)
 
     this.menu.addChild(settingsMenuItem)
 
@@ -204,7 +204,7 @@ class SettingsButton extends Button {
   }
 
   resetChildren () {
-    for (let menuChild of this.menu.children()) {
+    for (const menuChild of this.menu.children()) {
       menuChild.reset()
     }
   }
@@ -213,7 +213,7 @@ class SettingsButton extends Button {
    * Hide all the sub menus
    */
   hideChildren () {
-    for (let menuChild of this.menu.children()) {
+    for (const menuChild of this.menu.children()) {
       menuChild.hideSubMenu()
     }
   }
index f14959f9cf4e0b958933cd0ff9e7fd3d63364796..78879a2ec3d57f25937b759221e6665ad1dda543 100644 (file)
@@ -167,7 +167,7 @@ class SettingsMenuItem extends MenuItem {
    * @method PrefixedEvent
    */
   PrefixedEvent (element: any, type: any, callback: any, action = 'addEvent') {
-    let prefix = ['webkit', 'moz', 'MS', 'o', '']
+    const prefix = ['webkit', 'moz', 'MS', 'o', '']
 
     for (let p = 0; p < prefix.length; p++) {
       if (!prefix[p]) {
@@ -249,7 +249,7 @@ class SettingsMenuItem extends MenuItem {
 
   update (event?: any) {
     let target: HTMLElement = null
-    let subMenu = this.subMenu.name()
+    const subMenu = this.subMenu.name()
 
     if (event && event.type === 'tap') {
       target = event.target
@@ -264,7 +264,7 @@ class SettingsMenuItem extends MenuItem {
       setTimeout(() => this.settingsSubMenuValueEl_.innerHTML = this.subMenu.labelEl_.innerHTML, 250)
     } else {
       // Loop trough the submenu items to find the selected child
-      for (let subMenuItem of this.subMenu.menu.children_) {
+      for (const subMenuItem of this.subMenu.menu.children_) {
         if (!(subMenuItem instanceof component)) {
           continue
         }
@@ -287,7 +287,7 @@ class SettingsMenuItem extends MenuItem {
   }
 
   bindClickEvents () {
-    for (let item of this.subMenu.menu.children()) {
+    for (const item of this.subMenu.menu.children()) {
       if (!(item instanceof component)) {
         continue
       }
@@ -307,7 +307,7 @@ class SettingsMenuItem extends MenuItem {
   }
 
   setMargin () {
-    let [width] = this.size
+    const [ width ] = this.size
 
     this.settingsSubMenuEl_.style.marginRight = `-${width}px`
   }
index 54cc0ea64d0669ccc80086ed67a5b881ec1f0195..66762bef8a8b1530c28977bb968ef80490e0c74a 100644 (file)
@@ -131,7 +131,7 @@ export class PeertubeChunkStore extends EventEmitter {
     // Chunk in store
     this.db.transaction('r', this.db.chunks, async () => {
       const result = await this.db.chunks.get({ id: index })
-      if (result === undefined) return cb(null, new Buffer(0))
+      if (result === undefined) return cb(null, Buffer.alloc(0))
 
       const buf = result.buf
       if (!opts) return this.nextTick(cb, null, buf)
@@ -162,13 +162,13 @@ export class PeertubeChunkStore extends EventEmitter {
       }
 
       if (this.db) {
-        await this.db.close()
+        this.db.close()
 
         await this.dropDatabase(this.databaseName)
       }
 
       if (this.expirationDB) {
-        await this.expirationDB.close()
+        this.expirationDB.close()
         this.expirationDB = null
       }
 
index a3415937b96e9f7e602ea176ab77a833a82cc21a..4dce871124ae3d8b44ee78ea8f0980c164d23e18 100644 (file)
@@ -29,7 +29,7 @@ function renderVideo (
 
 function renderMedia (file: any, elem: HTMLVideoElement, opts: RenderMediaOptions, callback: (err: Error, renderer?: any) => void) {
   const extension = extname(file.name).toLowerCase()
-  let preparedElem: any = undefined
+  let preparedElem: any
   let currentTime = 0
   let renderer: any
 
index c7182acc94477585c3c8cb9bac46330112def8a8..eee3d4db9fd492b11a75a496e7b0f86bbbf27294 100644 (file)
@@ -347,7 +347,7 @@ class WebTorrentPlugin extends Plugin {
     if (!averageDownloadSpeed) averageDownloadSpeed = this.getAndSaveActualDownloadSpeed()
 
     // Limit resolution according to player height
-    const playerHeight = this.playerElement.offsetHeight as number
+    const playerHeight = this.playerElement.offsetHeight
 
     // We take the first resolution just above the player height
     // Example: player height is 530px, we want the 720p file instead of 480p
index 3689084324c021070ed6a08241f68e581104fdd6..b68c07fdb9cac4695c8e8128b69e0c2cee47ae57 100644 (file)
@@ -76,6 +76,7 @@ import 'core-js/es7/object'
 /***************************************************************************************************
  * Zone JS is required by default for Angular itself.
  */
+// tslint:disable
 import 'zone.js/dist/zone'  // Included with Angular CLI.
 
 /***************************************************************************************************
index 7f9ef9b6f9807a315e430037d16a38291474b883..afd10541bbf311a02a34777b2d215c172aa07532 100644 (file)
@@ -1,6 +1,4 @@
-export interface EventHandler<T> {
-  (ev: T): void
-}
+export type EventHandler<T> = (ev: T) => void
 
 export type PlayerEventType =
   'pause' | 'play' |
index f1639ef19d707fad1889ff3efcdc055e172b2c91..28a13c727b0b3f4c2f24ea03f93c60c4c0fab395 100644 (file)
@@ -13,13 +13,13 @@ export class EventRegistrar {
   private eventRegistrations: PlayerEventRegistrationMap = {}
 
   public bindToChannel (channel: Channel.MessagingChannel) {
-    for (let name of Object.keys(this.eventRegistrations)) {
+    for (const name of Object.keys(this.eventRegistrations)) {
       channel.bind(name, (txn, params) => this.fire(name, params))
     }
   }
 
   public registerTypes (names: string[]) {
-    for (let name of names) {
+    for (const name of names) {
       this.eventRegistrations[ name ] = { registrations: [] }
     }
   }
index b55b4bace00aa5159545ba610d4392ed1a3bfed5..626d55a7c2fcfb93ee7364ed0235e0856ee97ba1 100644 (file)
@@ -40,7 +40,7 @@ class PeerTubeEmbedApi {
   }
 
   private constructChannel () {
-    let channel = Channel.build({ window: window.parent, origin: '*', scope: this.embed.scope })
+    const channel = Channel.build({ window: window.parent, origin: '*', scope: this.embed.scope })
 
     channel.bind('play', (txn, params) => this.embed.player.play())
     channel.bind('pause', (txn, params) => this.embed.player.pause())
@@ -82,8 +82,8 @@ class PeerTubeEmbedApi {
     let currentState: 'playing' | 'paused' | 'unstarted' = 'unstarted'
 
     setInterval(() => {
-      let position = this.element.currentTime
-      let volume = this.element.volume
+      const position = this.element.currentTime
+      const volume = this.element.volume
 
       this.channel.notify({
         method: 'playbackStatusUpdate',
@@ -114,8 +114,8 @@ class PeerTubeEmbedApi {
   }
 
   private loadWebTorrentResolutions () {
-    let resolutions = []
-    let currentResolutionId = this.embed.player.webtorrent().getCurrentResolutionId()
+    const resolutions = []
+    const currentResolutionId = this.embed.player.webtorrent().getCurrentResolutionId()
 
     for (const videoFile of this.embed.player.webtorrent().videoFiles) {
       let label = videoFile.resolution.label
@@ -235,7 +235,7 @@ class PeerTubeEmbed {
 
   private loadParams () {
     try {
-      let params = new URL(window.location.toString()).searchParams
+      const params = new URL(window.location.toString()).searchParams
 
       this.autoplay = this.getParamToggle(params, 'autoplay')
       this.controls = this.getParamToggle(params, 'controls')
index 30a298573a22dd9314e7b8f8e8f7adb1de9ae122..8e83d92a928488b0ee47cac328d80f78c4a91944 100644 (file)
@@ -7,13 +7,13 @@ window.addEventListener('load', async () => {
   const lastPart = urlParts[ urlParts.length - 1 ]
   const videoId = lastPart.indexOf('?') === -1 ? lastPart : lastPart.split('?')[ 0 ]
 
-  let iframe = document.createElement('iframe')
+  const iframe = document.createElement('iframe')
   iframe.src = `/videos/embed/${videoId}?autoplay=1&controls=0&api=1`
-  let mainElement = document.querySelector('#host')
+  const mainElement = document.querySelector('#host')
   mainElement.appendChild(iframe)
 
   console.log(`Document finished loading.`)
-  let player = new PeerTubePlayer(document.querySelector('iframe'))
+  const player = new PeerTubePlayer(document.querySelector('iframe'))
 
   window[ 'player' ] = player
 
@@ -21,7 +21,7 @@ window.addEventListener('load', async () => {
   await player.ready
   console.log(`Player is ready.`)
 
-  let monitoredEvents = [
+  const monitoredEvents = [
     'pause',
     'play',
     'playbackStatusUpdate',
@@ -36,18 +36,18 @@ window.addEventListener('load', async () => {
   let playbackRates: number[] = []
   let currentRate = await player.getPlaybackRate()
 
-  let updateRates = async () => {
-    let rateListEl = document.querySelector('#rate-list')
+  const updateRates = async () => {
+    const rateListEl = document.querySelector('#rate-list')
     rateListEl.innerHTML = ''
 
     playbackRates.forEach(rate => {
       if (currentRate === rate) {
-        let itemEl = document.createElement('strong')
+        const itemEl = document.createElement('strong')
         itemEl.innerText = `${rate} (active)`
         itemEl.style.display = 'block'
         rateListEl.appendChild(itemEl)
       } else {
-        let itemEl = document.createElement('a')
+        const itemEl = document.createElement('a')
         itemEl.href = 'javascript:;'
         itemEl.innerText = rate.toString()
         itemEl.addEventListener('click', () => {
@@ -66,18 +66,18 @@ window.addEventListener('load', async () => {
     updateRates()
   })
 
-  let updateResolutions = ((resolutions: PeerTubeResolution[]) => {
-    let resolutionListEl = document.querySelector('#resolution-list')
+  const updateResolutions = ((resolutions: PeerTubeResolution[]) => {
+    const resolutionListEl = document.querySelector('#resolution-list')
     resolutionListEl.innerHTML = ''
 
     resolutions.forEach(resolution => {
       if (resolution.active) {
-        let itemEl = document.createElement('strong')
+        const itemEl = document.createElement('strong')
         itemEl.innerText = `${resolution.label} (active)`
         itemEl.style.display = 'block'
         resolutionListEl.appendChild(itemEl)
       } else {
-        let itemEl = document.createElement('a')
+        const itemEl = document.createElement('a')
         itemEl.href = 'javascript:;'
         itemEl.innerText = resolution.label
         itemEl.addEventListener('click', () => {
index a0fbc27c682ef665b9befeaf898129e84cbc5839..e46528d1c9117717cd9c5bc8d304ec88d2aa64b7 100644 (file)
@@ -43,6 +43,7 @@
     "fullTemplateTypeCheck": true
   },
   "include": [
+    "./src",
     "../../shared"
   ],
   "exclude": [
index fcc866ee38ab7526e741c5cd96a37cc97451d435..f45b1d576dd652205431698f35c12ef6b1ff4862 100644 (file)
@@ -1,12 +1,12 @@
 {
-  "extends": "tslint-config-standard",
-  "rulesDirectory": ["./node_modules/codelyzer"],
+  "extends": [ "tslint-angular", "tslint-config-standard" ],
   "rules": {
     "no-inferrable-types": true,
     "eofline": true,
     "max-line-length": [true, 140],
     "no-floating-promises": false,
     "no-unused-variable": false, // Memory issues
+    "await-promise": [true, "PromiseLike"],
     "member-ordering": [true, {
       "order": [
         "public-static-field",
         ]}
     ],
 
-    "angular-whitespace": [true, "check-interpolation", "check-semicolon"],
-    "banana-in-box": true,
-    "templates-no-negated-async": true,
-    "directive-selector": [true, "attribute", "my", "camelCase"],
-    "component-selector": [true, "element", "my", "kebab-case"],
-    "use-input-property-decorator": true,
-    "use-output-property-decorator": true,
-    "use-host-property-decorator": true,
-    "use-view-encapsulation": true,
-    "no-attribute-parameter-decorator": true,
-    "no-input-rename": true,
-    "no-output-rename": true,
-    "no-output-on-prefix": true,
-    "no-forward-ref": false,
-    "use-life-cycle-interface": true,
-    "contextual-life-cycle": true,
-    "trackBy-function": false,
-    "use-pipe-transform-interface": true,
-    "pipe-prefix": [true, "my"],
-    "component-class-suffix": true,
-    "directive-class-suffix": true,
-    "pipe-impure": true
+    "no-shadowed-variable": false,
+    "no-bitwise": false,
+    "max-classes-per-file": false,
+    "interface-over-type-literal": false
   }
 }
index 361aa1e196a8d159b5de3f8adfe9674498e7f5fa..5be2cf642e91dcadfe5219ffd76bcdd10a3b5b8a 100644 (file)
@@ -961,14 +961,6 @@ argparse@^1.0.7:
   dependencies:
     sprintf-js "~1.0.2"
 
-aria-query@^3.0.0:
-  version "3.0.0"
-  resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-3.0.0.tgz#65b3fcc1ca1155a8c9ae64d6eee297f15d5133cc"
-  integrity sha1-ZbP8wcoRVajJrmTW7uKX8V1RM8w=
-  dependencies:
-    ast-types-flow "0.0.7"
-    commander "^2.11.0"
-
 arr-diff@^4.0.0:
   version "4.0.0"
   resolved "https://registry.yarnpkg.com/arr-diff/-/arr-diff-4.0.0.tgz#d6461074febfec71e7e15235761a329a5dc7c520"
@@ -1064,11 +1056,6 @@ assign-symbols@^1.0.0:
   resolved "https://registry.yarnpkg.com/assign-symbols/-/assign-symbols-1.0.0.tgz#59667f41fadd4f20ccbc2bb96b8d4f7f78ec0367"
   integrity sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=
 
-ast-types-flow@0.0.7:
-  version "0.0.7"
-  resolved "https://registry.yarnpkg.com/ast-types-flow/-/ast-types-flow-0.0.7.tgz#f70b735c6bca1a5c9c22d982c3e39e7feba3bdad"
-  integrity sha1-9wtzXGvKGlycItmCw+Oef+ujva0=
-
 ast-types@0.9.6:
   version "0.9.6"
   resolved "https://registry.yarnpkg.com/ast-types/-/ast-types-0.9.6.tgz#102c9e9e9005d3e7e3829bf0c4fa24ee862ee9b9"
@@ -1147,13 +1134,6 @@ aws4@^1.8.0:
   resolved "https://registry.yarnpkg.com/aws4/-/aws4-1.8.0.tgz#f0e003d9ca9e7f59c7a508945d7b2ef9a04a542f"
   integrity sha512-ReZxvNHIOv88FlT7rxcXIIC0fPt4KZqZbOlivyWtXLt8ESx84zd3kMC6iK5jVeS2qt+g7ftS7ye4fi06X5rtRQ==
 
-axobject-query@^2.0.2:
-  version "2.0.2"
-  resolved "https://registry.yarnpkg.com/axobject-query/-/axobject-query-2.0.2.tgz#ea187abe5b9002b377f925d8bf7d1c561adf38f9"
-  integrity sha512-MCeek8ZH7hKyO1rWUbKNQBbl4l2eY0ntk7OGi+q0RlafrCnfPxC06WZA+uebCfmYp4mNU9jRBP1AhGyf8+W3ww==
-  dependencies:
-    ast-types-flow "0.0.7"
-
 babel-code-frame@^6.22.0, babel-code-frame@^6.26.0:
   version "6.26.0"
   resolved "https://registry.yarnpkg.com/babel-code-frame/-/babel-code-frame-6.26.0.tgz#63fd43f7dc1e3bb7ce35947db8fe369a3f58c74b"
@@ -1969,20 +1949,17 @@ code-point-at@^1.0.0:
   resolved "https://registry.yarnpkg.com/code-point-at/-/code-point-at-1.1.0.tgz#0d070b4d043a5bea33a2f1a40e2edb3d9a4ccf77"
   integrity sha1-DQcLTQQ6W+ozovGkDi7bPZpMz3c=
 
-codelyzer@^5.0.0:
-  version "5.0.0"
-  resolved "https://registry.yarnpkg.com/codelyzer/-/codelyzer-5.0.0.tgz#e4032efb23a7c5d4bcfe7321fc1789490c679837"
-  integrity sha512-Bif70XYt8NFf/Q9GPTxmC86OsBRfQZq1dBjdruJ5kZhJ8/jKhJL6MvCLKnYtSOG6Rhiv/44DU0cHk6GYthjy8Q==
+codelyzer@^4.0.2:
+  version "4.5.0"
+  resolved "https://registry.yarnpkg.com/codelyzer/-/codelyzer-4.5.0.tgz#a65ddeeeca2894653253a89bfa229118ff9f59b1"
+  integrity sha512-oO6vCkjqsVrEsmh58oNlnJkRXuA30hF8cdNAQV9DytEalDwyOFRvHMnlKFzmOStNerOmPGZU9GAHnBo4tGvtiQ==
   dependencies:
     app-root-path "^2.1.0"
-    aria-query "^3.0.0"
-    axobject-query "^2.0.2"
-    css-selector-tokenizer "^0.7.1"
+    css-selector-tokenizer "^0.7.0"
     cssauron "^1.4.0"
-    damerau-levenshtein "^1.0.4"
     semver-dsl "^1.0.1"
     source-map "^0.5.7"
-    sprintf-js "^1.1.2"
+    sprintf-js "^1.1.1"
 
 collection-visit@^1.0.0:
   version "1.0.0"
@@ -2026,7 +2003,7 @@ commander@2.17.x:
   resolved "https://registry.yarnpkg.com/commander/-/commander-2.17.1.tgz#bd77ab7de6de94205ceacc72f1716d29f20a77bf"
   integrity sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==
 
-commander@^2.11.0, commander@^2.12.1, commander@^2.18.0, commander@^2.19.0, commander@^2.9.0, commander@~2.19.0:
+commander@^2.12.1, commander@^2.18.0, commander@^2.19.0, commander@^2.9.0, commander@~2.19.0:
   version "2.19.0"
   resolved "https://registry.yarnpkg.com/commander/-/commander-2.19.0.tgz#f6198aa84e5b83c46054b94ddedbfed5ee9ff12a"
   integrity sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==
@@ -2345,7 +2322,7 @@ css-select@^1.1.0:
     domutils "1.5.1"
     nth-check "~1.0.1"
 
-css-selector-tokenizer@^0.7.1:
+css-selector-tokenizer@^0.7.0:
   version "0.7.1"
   resolved "https://registry.yarnpkg.com/css-selector-tokenizer/-/css-selector-tokenizer-0.7.1.tgz#a177271a8bca5019172f4f891fc6eed9cbf68d5d"
   integrity sha512-xYL0AMZJ4gFzJQsHUKa5jiWWi2vH77WVNg7JYRyewwj6oPh4yb/y6Y9ZCw9dsj/9UauMhtuxR+ogQd//EdEVNA==
@@ -2415,11 +2392,6 @@ d@1:
   dependencies:
     es5-ext "^0.10.9"
 
-damerau-levenshtein@^1.0.4:
-  version "1.0.4"
-  resolved "https://registry.yarnpkg.com/damerau-levenshtein/-/damerau-levenshtein-1.0.4.tgz#03191c432cb6eea168bb77f3a55ffdccb8978514"
-  integrity sha1-AxkcQyy27qFou3fzpV/9zLiXhRQ=
-
 dashdash@^1.12.0:
   version "1.14.1"
   resolved "https://registry.yarnpkg.com/dashdash/-/dashdash-1.14.1.tgz#853cfa0f7cbe2fed5de20326b8dd581035f6e2f0"
@@ -8065,7 +8037,7 @@ split@^1.0.0:
   dependencies:
     through "2"
 
-sprintf-js@^1.1.2:
+sprintf-js@^1.1.1:
   version "1.1.2"
   resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.1.2.tgz#da1765262bf8c0f571749f2ad6c26300207ae673"
   integrity sha512-VE0SOVEHCk7Qc8ulkWw3ntAzXuqf7S2lvwQaDLRnUeIEaKNQJzV6BwmLKhOqT61aGhfUMrXeaBk+oDGCzvhcug==
@@ -8592,6 +8564,14 @@ tslib@^1.7.1, tslib@^1.8.0, tslib@^1.8.1, tslib@^1.9.0, tslib@~1.9.0:
   resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.9.3.tgz#d7e4dd79245d85428c4d7e4822a79917954ca286"
   integrity sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==
 
+tslint-angular@^1.1.2:
+  version "1.1.2"
+  resolved "https://registry.yarnpkg.com/tslint-angular/-/tslint-angular-1.1.2.tgz#5ce7020968e3b9dc7a40b6d15dadd6da34787309"
+  integrity sha512-YDLdgQXBSFcVdDZH3mThx21fKzRctIgmCWpuwmppFLc7QHV3tdWDaFnD5lwUmgvLH8W0o+KsXhSzZ2uIsFJ+YA==
+  dependencies:
+    codelyzer "^4.0.2"
+    tslint "^5.8.0"
+
 tslint-config-standard@^8.0.1:
   version "8.0.1"
   resolved "https://registry.yarnpkg.com/tslint-config-standard/-/tslint-config-standard-8.0.1.tgz#e4dd3128e84b0e34b51990b68715a641f2b417e4"
@@ -8608,7 +8588,7 @@ tslint-eslint-rules@^5.3.1:
     tslib "1.9.0"
     tsutils "^3.0.0"
 
-tslint@^5.7.0:
+tslint@^5.7.0, tslint@^5.8.0:
   version "5.15.0"
   resolved "https://registry.yarnpkg.com/tslint/-/tslint-5.15.0.tgz#6ffb180986d63afa1e531feb2a134dbf961e27d3"
   integrity sha512-6bIEujKR21/3nyeoX2uBnE8s+tMXCQXhqMmaIPJpHmXJoBJPTLcI7/VHRtUwMhnLVdwLqqY3zmd8Dxqa5CVdJA==
index 7da5e71004dc1f061ece37e0c53b0daab9fdc081..5ba2c1faa45e66064eb3a3908d3a87430594a3d2 100644 (file)
@@ -17,27 +17,27 @@ export enum VideoResolution {
  */
 function getBaseBitrate (resolution: VideoResolution) {
   switch (resolution) {
-  case VideoResolution.H_240P:
-    // quality according to Google Live Encoder: 300 - 700 Kbps
-    // Quality according to YouTube Video Info: 186 Kbps
-    return 250 * 1000
-  case VideoResolution.H_360P:
-    // quality according to Google Live Encoder: 400 - 1,000 Kbps
-    // Quality according to YouTube Video Info: 480 Kbps
-    return 500 * 1000
-  case VideoResolution.H_480P:
-    // quality according to Google Live Encoder: 500 - 2,000 Kbps
-    // Quality according to YouTube Video Info: 879 Kbps
-    return 900 * 1000
-  case VideoResolution.H_720P:
-    // quality according to Google Live Encoder: 1,500 - 4,000 Kbps
-    // Quality according to YouTube Video Info: 1752 Kbps
-    return 1750 * 1000
-  case VideoResolution.H_1080P: // fallthrough
-  default:
-    // quality according to Google Live Encoder: 3000 - 6000 Kbps
-    // Quality according to YouTube Video Info: 3277 Kbps
-    return 3300 * 1000
+    case VideoResolution.H_240P:
+      // quality according to Google Live Encoder: 300 - 700 Kbps
+      // Quality according to YouTube Video Info: 186 Kbps
+      return 250 * 1000
+    case VideoResolution.H_360P:
+      // quality according to Google Live Encoder: 400 - 1,000 Kbps
+      // Quality according to YouTube Video Info: 480 Kbps
+      return 500 * 1000
+    case VideoResolution.H_480P:
+      // quality according to Google Live Encoder: 500 - 2,000 Kbps
+      // Quality according to YouTube Video Info: 879 Kbps
+      return 900 * 1000
+    case VideoResolution.H_720P:
+      // quality according to Google Live Encoder: 1,500 - 4,000 Kbps
+      // Quality according to YouTube Video Info: 1752 Kbps
+      return 1750 * 1000
+    case VideoResolution.H_1080P: // fallthrough
+    default:
+      // quality according to Google Live Encoder: 3000 - 6000 Kbps
+      // Quality according to YouTube Video Info: 3277 Kbps
+      return 3300 * 1000
   }
 }