fix migration, closes #4262

This commit is contained in:
zadam 2023-09-18 23:45:00 +02:00
parent 4a67f63abd
commit 8075265753
3 changed files with 12 additions and 8 deletions

14
package-lock.json generated
View File

@ -47,7 +47,7 @@
"jimp": "0.22.10", "jimp": "0.22.10",
"joplin-turndown-plugin-gfm": "1.0.12", "joplin-turndown-plugin-gfm": "1.0.12",
"jsdom": "22.1.0", "jsdom": "22.1.0",
"marked": "9.0.0", "marked": "9.0.3",
"mime-types": "2.1.35", "mime-types": "2.1.35",
"multer": "1.4.5-lts.1", "multer": "1.4.5-lts.1",
"node-abi": "3.47.0", "node-abi": "3.47.0",
@ -8946,9 +8946,9 @@
} }
}, },
"node_modules/marked": { "node_modules/marked": {
"version": "9.0.0", "version": "9.0.3",
"resolved": "https://registry.npmjs.org/marked/-/marked-9.0.0.tgz", "resolved": "https://registry.npmjs.org/marked/-/marked-9.0.3.tgz",
"integrity": "sha512-37yoTpjU+TSXb9OBYY5n78z/CqXh76KiQj9xsKxEdztzU9fRLmbWO5YqKxgCVGKlNdexppnbKTkwB3RipVri8w==", "integrity": "sha512-pI/k4nzBG1PEq1J3XFEHxVvjicfjl8rgaMaqclouGSMPhk7Q3Ejb2ZRxx/ZQOcQ1909HzVoWCFYq6oLgtL4BpQ==",
"bin": { "bin": {
"marked": "bin/marked.js" "marked": "bin/marked.js"
}, },
@ -19990,9 +19990,9 @@
"requires": {} "requires": {}
}, },
"marked": { "marked": {
"version": "9.0.0", "version": "9.0.3",
"resolved": "https://registry.npmjs.org/marked/-/marked-9.0.0.tgz", "resolved": "https://registry.npmjs.org/marked/-/marked-9.0.3.tgz",
"integrity": "sha512-37yoTpjU+TSXb9OBYY5n78z/CqXh76KiQj9xsKxEdztzU9fRLmbWO5YqKxgCVGKlNdexppnbKTkwB3RipVri8w==" "integrity": "sha512-pI/k4nzBG1PEq1J3XFEHxVvjicfjl8rgaMaqclouGSMPhk7Q3Ejb2ZRxx/ZQOcQ1909HzVoWCFYq6oLgtL4BpQ=="
}, },
"matcher": { "matcher": {
"version": "3.0.0", "version": "3.0.0",

View File

@ -68,7 +68,7 @@
"jimp": "0.22.10", "jimp": "0.22.10",
"joplin-turndown-plugin-gfm": "1.0.12", "joplin-turndown-plugin-gfm": "1.0.12",
"jsdom": "22.1.0", "jsdom": "22.1.0",
"marked": "9.0.0", "marked": "9.0.3",
"mime-types": "2.1.35", "mime-types": "2.1.35",
"multer": "1.4.5-lts.1", "multer": "1.4.5-lts.1",
"node-abi": "3.47.0", "node-abi": "3.47.0",

View File

@ -25,6 +25,10 @@ function md5(content) {
} }
function hashedBlobId(content) { function hashedBlobId(content) {
if (content === null || content === undefined) {
content = "";
}
// sha512 is faster than sha256 // sha512 is faster than sha256
const base64Hash = crypto.createHash('sha512').update(content).digest('base64'); const base64Hash = crypto.createHash('sha512').update(content).digest('base64');