From cda70628fa6ef13e0f39379dc08ffe2bbde3fc40 Mon Sep 17 00:00:00 2001 From: Philip Molares Date: Mon, 22 Jun 2026 23:10:28 +0200 Subject: [PATCH] refactor: remove wurl dependency This was mainly used in now removed code, any other uses were fixed with the URL constructor Signed-off-by: Philip Molares --- package.json | 3 +-- public/js/index.js | 6 +++--- yarn.lock | 8 -------- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/package.json b/package.json index a6076b34..41a1ede0 100644 --- a/package.json +++ b/package.json @@ -204,8 +204,7 @@ "viz.js": "1.8.2", "webpack": "4.47.0", "webpack-cli": "4.10.0", - "webpack-merge": "5.10.0", - "wurl": "2.5.4" + "webpack-merge": "5.10.0" }, "optionalDependencies": { "bufferutil": "4.1.0", diff --git a/public/js/index.js b/public/js/index.js index dd5d66ca..a3f27032 100644 --- a/public/js/index.js +++ b/public/js/index.js @@ -18,7 +18,6 @@ import hex2rgb from '../vendor/ot/hex2rgb' import { saveAs } from 'file-saver' import chance from 'chance' import store from 'store' -import url from 'wurl' import { Spinner } from 'spin.js' import _ from 'lodash' @@ -1798,7 +1797,7 @@ $('#gistImportModalConfirm').click(function () { false ) } else { - const hostname = url('hostname', gisturl) + const hostname = new URL(gisturl).hostname if (hostname !== 'gist.github.com') { showMessageModal( ' Import from Gist', @@ -1809,7 +1808,8 @@ $('#gistImportModalConfirm').click(function () { ) } else { ui.spinner.show() - $.get('https://api.github.com/gists/' + url('-1', gisturl)) + const gistId = new URL(gisturl).pathname.split('/').pop() + $.get('https://api.github.com/gists/' + gistId) .done(function (data) { if (data.files) { let contents = '' diff --git a/yarn.lock b/yarn.lock index 48a6af2d..4978d458 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1619,7 +1619,6 @@ __metadata: webpack-cli: "npm:4.10.0" webpack-merge: "npm:5.10.0" winston: "npm:3.19.0" - wurl: "npm:2.5.4" xss: "npm:1.0.15" dependenciesMeta: bufferutil: @@ -17826,13 +17825,6 @@ __metadata: languageName: node linkType: hard -"wurl@npm:2.5.4": - version: 2.5.4 - resolution: "wurl@npm:2.5.4" - checksum: 10/d8b151720dc252a53e35c3df3cc77390afa4b6f0af35f891c7ef172c6b6fb9c432539dde16f94ec6c123380084ba1e77ab71eebc55305d2cd349e5b07332f99c - languageName: node - linkType: hard - "xml-crypto@npm:^6.1.2": version: 6.1.2 resolution: "xml-crypto@npm:6.1.2"