diff --git a/app/package.json b/app/package.json index 0b018de6e4..9c0da31557 100644 --- a/app/package.json +++ b/app/package.json @@ -35,7 +35,6 @@ "electron-window-state": "^5.0.3", "event-kit": "^2.0.0", "file-metadata": "^1.0.0", - "file-uri-to-path": "^2.0.0", "file-url": "^2.0.2", "focus-trap-react": "^8.1.0", "fs-admin": "^0.19.0", diff --git a/app/src/lib/markdown-filters/emoji-filter.ts b/app/src/lib/markdown-filters/emoji-filter.ts index d60bfc14c1..094adbea5b 100644 --- a/app/src/lib/markdown-filters/emoji-filter.ts +++ b/app/src/lib/markdown-filters/emoji-filter.ts @@ -1,7 +1,7 @@ import { INodeFilter } from './node-filter' import * as FSE from 'fs-extra' import { escapeRegExp } from '../helpers/regex' -import uri2path from 'file-uri-to-path' +import { fileURLToPath } from 'url' /** * The Emoji Markdown filter will take a text node and create multiple text and @@ -122,7 +122,7 @@ export class EmojiFilter implements INodeFilter { if (cached !== undefined) { return cached } - const imageBuffer = await FSE.readFile(uri2path(filePath)) + const imageBuffer = await FSE.readFile(fileURLToPath(filePath)) const b64src = imageBuffer.toString('base64') const uri = `data:image/png;base64,${b64src}` this.emojiBase64URICache.set(filePath, uri) diff --git a/app/src/lib/source-map-support.ts b/app/src/lib/source-map-support.ts index dd4e55cd53..b31016bf0b 100644 --- a/app/src/lib/source-map-support.ts +++ b/app/src/lib/source-map-support.ts @@ -1,7 +1,7 @@ import * as Path from 'path' import * as Fs from 'fs' -import fileUriToPath from 'file-uri-to-path' import sourceMapSupport from 'source-map-support' +import { fileURLToPath } from 'url' /** * This array tells the source map logic which files that we can expect to @@ -23,7 +23,7 @@ function retrieveSourceMap(source: string) { // We get a file uri when we're inside a renderer, convert to a path if (source.startsWith('file://')) { - source = fileUriToPath(source) + source = fileURLToPath(source) } // We store our source maps right next to the bundle diff --git a/app/yarn.lock b/app/yarn.lock index d8550805ad..fe829cbf74 100644 --- a/app/yarn.lock +++ b/app/yarn.lock @@ -597,11 +597,6 @@ file-stream-rotator@^0.6.1: dependencies: moment "^2.29.1" -file-uri-to-path@^2.0.0: - version "2.0.0" - resolved "https://registry.yarnpkg.com/file-uri-to-path/-/file-uri-to-path-2.0.0.tgz#7b415aeba227d575851e0a5b0c640d7656403fba" - integrity sha512-hjPFI8oE/2iQPVe4gbrJ73Pp+Xfub2+WI2LlXDbsaJBwT5wuMh35WNWVYYTpnz895shtwfyutMFLFywpQAFdLg== - file-url@^2.0.2: version "2.0.2" resolved "https://registry.yarnpkg.com/file-url/-/file-url-2.0.2.tgz#e951784d79095127d3713029ab063f40818ca2ae"