]> git.immae.eu Git - github/Chocobozzz/PeerTube.git/blobdiff - client/src/app/shared/misc/utils.ts
Add ability to search available plugins
[github/Chocobozzz/PeerTube.git] / client / src / app / shared / misc / utils.ts
index 7cc6055c2ae6c3b355ef7ba0940b77988332232a..85fc1c3a0987af8f03af863be655be1480790791 100644 (file)
@@ -17,7 +17,7 @@ function getParameterByName (name: string, url: string) {
   return decodeURIComponent(results[2].replace(/\+/g, ' '))
 }
 
-function populateAsyncUserVideoChannels (authService: AuthService, channel: { id: number, label: string, support: string }[]) {
+function populateAsyncUserVideoChannels (authService: AuthService, channel: { id: number, label: string, support?: string }[]) {
   return new Promise(res => {
     authService.userInformationLoaded
       .subscribe(
@@ -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