remove query string from apple dev doc urls

main
Lee Hanken 2022-05-02 02:39:43 +01:00
parent 6be7fee1ad
commit dd46072666
1 changed files with 7 additions and 3 deletions

View File

@ -2,11 +2,15 @@ module.exports = {
dev_doc_url: function (url) { dev_doc_url: function (url) {
if (url.endsWith('/')) { let query_parts = url.split('?');
url = url.slice(0, -1)
let queryless = query_parts[0];
if (queryless.endsWith('/')) {
queryless = queryless.slice(0, -1)
} }
let parts = url.split("/"); let parts = queryless.split("/");
let json_url = "https://developer.apple.com/tutorials/data"; let json_url = "https://developer.apple.com/tutorials/data";