From 113bf14718d9fc513821a4e2bbcc7e2ab45e6269 Mon Sep 17 00:00:00 2001 From: jamesgeorge007 Date: Tue, 26 Nov 2019 14:20:57 +0530 Subject: [PATCH 1/8] refactor(graphql): replace instances of var with const --- pages/graphql.vue | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pages/graphql.vue b/pages/graphql.vue index 0de838f2b..3c1494463 100644 --- a/pages/graphql.vue +++ b/pages/graphql.vue @@ -59,7 +59,7 @@ @change=" $store.commit('setGQLHeaderKey', { index, - value: $event.target.value + value: $event.target.value }) " autofocus @@ -424,9 +424,9 @@ export default { this.responseBodyMaxLines = (this.responseBodyMaxLines == Infinity) ? 16 : Infinity; }, downloadResponse() { - var dataToWrite = JSON.stringify(this.schemaString, null, 2) - var file = new Blob([dataToWrite], { type: "application/json" }); - var a = document.createElement("a"), + const dataToWrite = JSON.stringify(this.schemaString, null, 2) + const file = new Blob([dataToWrite], { type: "application/json" }); + const a = document.createElement("a"), url = URL.createObjectURL(file); a.href = url; a.download = ( From b3680224cc879a2a5a70d723d79debabf9801560 Mon Sep 17 00:00:00 2001 From: jamesgeorge007 Date: Tue, 26 Nov 2019 14:24:27 +0530 Subject: [PATCH 2/8] refactor(index): replace instances of var with const --- pages/index.vue | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/pages/index.vue b/pages/index.vue index 3f7bf29e6..003fb233b 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -1205,7 +1205,7 @@ export default { }, requestCode() { if (this.requestType === "JavaScript XHR") { - var requestString = []; + const requestString = []; requestString.push("const xhr = new XMLHttpRequest()"); const user = this.auth === "Basic" ? "'" + this.httpUser + "'" : null; const pswd = @@ -1259,14 +1259,14 @@ export default { } return requestString.join("\n"); } else if (this.requestType == "Fetch") { - var requestString = []; - var headers = []; + const requestString = []; + const headers = []; requestString.push( 'fetch("' + this.url + this.pathName + this.queryString + '", {\n' ); requestString.push(' method: "' + this.method + '",\n'); if (this.auth === "Basic") { - var basic = this.httpUser + ":" + this.httpPassword; + const basic = this.httpUser + ":" + this.httpPassword; headers.push( ' "Authorization": "Basic ' + window.btoa(unescape(encodeURIComponent(basic))) + @@ -1308,13 +1308,13 @@ export default { requestString.push("})"); return requestString.join(""); } else if (this.requestType === "cURL") { - var requestString = []; + const requestString = []; requestString.push("curl -X " + this.method + " \\\n"); requestString.push( " '" + this.url + this.pathName + this.queryString + "' \\\n" ); if (this.auth === "Basic") { - var basic = this.httpUser + ":" + this.httpPassword; + const basic = this.httpUser + ":" + this.httpPassword; requestString.push( " -H 'Authorization: Basic " + window.btoa(unescape(encodeURIComponent(basic))) + @@ -1672,7 +1672,7 @@ export default { .then(() => {}) .catch(console.error); } else { - var dummy = document.createElement("input"); + const dummy = document.createElement("input"); document.body.appendChild(dummy); dummy.value = window.location.href; dummy.select(); @@ -1709,8 +1709,8 @@ export default { this.$toast.success("Copied to clipboard", { icon: "done" }); - var aux = document.createElement("textarea"); - var copy = + const aux = document.createElement("textarea"); + const copy = this.responseType == "application/json" ? JSON.stringify(this.response.body) : this.response.body; @@ -1725,9 +1725,9 @@ export default { ); }, downloadResponse() { - var dataToWrite = JSON.stringify(this.response.body, null, 2); - var file = new Blob([dataToWrite], { type: this.responseType }); - var a = document.createElement("a"), + const dataToWrite = JSON.stringify(this.response.body, null, 2); + const file = new Blob([dataToWrite], { type: this.responseType }); + const a = document.createElement("a"), url = URL.createObjectURL(file); a.href = url; a.download = ( From 06d75344620da1a87379276f20896eec58e06bb5 Mon Sep 17 00:00:00 2001 From: jamesgeorge007 Date: Tue, 26 Nov 2019 14:25:40 +0530 Subject: [PATCH 3/8] refactor(realtime): replace instances of var with const --- pages/realtime.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/realtime.vue b/pages/realtime.vue index df0186591..8b2a15892 100644 --- a/pages/realtime.vue +++ b/pages/realtime.vue @@ -434,7 +434,7 @@ export default { }, updated: function() { this.$nextTick(function() { - var divLog = document.getElementById("log"); + const divLog = document.getElementById("log"); divLog.scrollBy(0, divLog.scrollHeight + 100); }); } From 20a7094d33884842495fd9e5888844ed3b32fbc0 Mon Sep 17 00:00:00 2001 From: jamesgeorge007 Date: Tue, 26 Nov 2019 14:27:51 +0530 Subject: [PATCH 4/8] refactor(index): us Array.includes --- pages/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/index.vue b/pages/index.vue index 003fb233b..db5df7fc1 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -109,7 +109,7 @@
  • From 61f8e3638346b3a388d8913cba9404b4db6db433 Mon Sep 17 00:00:00 2001 From: jamesgeorge007 Date: Tue, 26 Nov 2019 14:32:18 +0530 Subject: [PATCH 5/8] refactor(folder): self closing component --- components/collections/folder.vue | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/components/collections/folder.vue b/components/collections/folder.vue index 8703a8e58..29b4694cd 100644 --- a/components/collections/folder.vue +++ b/components/collections/folder.vue @@ -45,8 +45,7 @@ folderIndex, requestIndex: index }) - " - > + "/>
  • From ba1410c7f40f0b2c9b137646887249ca4e3a6d0b Mon Sep 17 00:00:00 2001 From: jamesgeorge007 Date: Tue, 26 Nov 2019 14:34:32 +0530 Subject: [PATCH 6/8] refactor(index): self closing components --- components/collections/index.vue | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/components/collections/index.vue b/components/collections/index.vue index c8323e372..114ecdee2 100644 --- a/components/collections/index.vue +++ b/components/collections/index.vue @@ -8,19 +8,19 @@ TODO: + /> + /> + /> + /> + /> + />
    From ffb8fd017241aba63fafdd78cc2738fd8bde7e8f Mon Sep 17 00:00:00 2001 From: jamesgeorge007 Date: Tue, 26 Nov 2019 14:37:32 +0530 Subject: [PATCH 7/8] refactor(index): use directive shorthand notation for consistency --- pages/index.vue | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pages/index.vue b/pages/index.vue index db5df7fc1..c4595426d 100644 --- a/pages/index.vue +++ b/pages/index.vue @@ -248,7 +248,7 @@