mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-11-02 05:51:30 +08:00
Merge pull request #646 from TriliumNext/renovate/is-svg-5.x
fix(deps): update dependency is-svg to v5
This commit is contained in:
commit
abd5238acc
19
package-lock.json
generated
19
package-lock.json
generated
@ -55,7 +55,7 @@
|
||||
"image-type": "4.1.0",
|
||||
"ini": "5.0.0",
|
||||
"is-animated": "2.0.2",
|
||||
"is-svg": "4.4.0",
|
||||
"is-svg": "5.1.0",
|
||||
"jimp": "1.6.0",
|
||||
"joplin-turndown-plugin-gfm": "1.0.12",
|
||||
"jquery": "3.7.1",
|
||||
@ -8189,6 +8189,13 @@
|
||||
"undici-types": "~6.19.2"
|
||||
}
|
||||
},
|
||||
"node_modules/electron/node_modules/undici-types": {
|
||||
"version": "6.19.8",
|
||||
"resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz",
|
||||
"integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==",
|
||||
"dev": true,
|
||||
"license": "MIT"
|
||||
},
|
||||
"node_modules/elkjs": {
|
||||
"version": "0.9.3",
|
||||
"resolved": "https://registry.npmjs.org/elkjs/-/elkjs-0.9.3.tgz",
|
||||
@ -11357,15 +11364,15 @@
|
||||
}
|
||||
},
|
||||
"node_modules/is-svg": {
|
||||
"version": "4.4.0",
|
||||
"resolved": "https://registry.npmjs.org/is-svg/-/is-svg-4.4.0.tgz",
|
||||
"integrity": "sha512-v+AgVwiK5DsGtT9ng+m4mClp6zDAmwrW8nZi6Gg15qzvBnRWWdfWA1TGaXyCDnWq5g5asofIgMVl3PjKxvk1ug==",
|
||||
"version": "5.1.0",
|
||||
"resolved": "https://registry.npmjs.org/is-svg/-/is-svg-5.1.0.tgz",
|
||||
"integrity": "sha512-uVg5yifaTxHoefNf5Jcx+i9RZe2OBYd/UStp1umx+EERa4xGRa3LLGXjoEph43qUORC0qkafUgrXZ6zzK89yGA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"fast-xml-parser": "^4.1.3"
|
||||
"fast-xml-parser": "^4.4.1"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=6"
|
||||
"node": ">=14.16"
|
||||
},
|
||||
"funding": {
|
||||
"url": "https://github.com/sponsors/sindresorhus"
|
||||
|
||||
@ -98,7 +98,7 @@
|
||||
"image-type": "4.1.0",
|
||||
"ini": "5.0.0",
|
||||
"is-animated": "2.0.2",
|
||||
"is-svg": "4.4.0",
|
||||
"is-svg": "5.1.0",
|
||||
"jimp": "1.6.0",
|
||||
"joplin-turndown-plugin-gfm": "1.0.12",
|
||||
"jquery": "3.7.1",
|
||||
|
||||
@ -45,15 +45,11 @@ async function processImage(uploadBuffer: Buffer, originalName: string, shrinkIm
|
||||
}
|
||||
|
||||
function getImageType(buffer: Buffer) {
|
||||
if (isSvg(buffer)) {
|
||||
return {
|
||||
ext: 'svg'
|
||||
}
|
||||
if (isSvg(buffer.toString())) {
|
||||
return { ext: 'svg' }
|
||||
}
|
||||
else {
|
||||
return imageType(buffer) || {
|
||||
ext: "jpg"
|
||||
}; // optimistic JPG default
|
||||
return imageType(buffer) || { ext: "jpg" }; // optimistic JPG default
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user