Open-Source API Development Ecosystem • https://hoppscotch.io • Offline, On-Prem & Cloud • Web, Desktop & CLI • Open-Source Alternative to Postman, Insomnia
TypeScript apiapi-clientapi-restapi-testingdeveloper-toolsgraphqlhttphttp-clientpwarestrest-apispatestingtesting-toolstoolsvuevuejswebsocket
use a concise approach to fetch the last element
jamesgeorge00774d2119f3128
diff --git a/pages/index.vue b/pages/index.vueindex 6a32925be..fde4e0de3 100644--- a/pages/index.vue+++ b/pages/index.vue@@ -991,7 +991,7 @@try {let parsedCurl = parseCurlCommand(text);this.url = parsedCurl.url.replace(/"/g,"").replace(/'/g,"");- this.url = this.url[this.url.length -1] == '/' ? this.url.slice(0, -1): this.url;+ this.url = this.url.slice(-1).pop() == '/' ? this.url.slice(0, -1): this.url;this.path = "";this.headers = [];for (const key of Object.keys(parsedCurl.headers)) {