moving out note revision content into separate table, refactoring, WIP

This commit is contained in:
zadam
2019-10-31 21:58:34 +01:00
parent 1a182d1b58
commit cf53cbf1dd
10 changed files with 172 additions and 143 deletions

View File

@@ -154,6 +154,14 @@ function getContentDisposition(filename) {
return `file; filename="${sanitizedFilename}"; filename*=UTF-8''${sanitizedFilename}`;
}
const STRING_MIME_TYPES = ["application/x-javascript"];
function isStringNote(type, mime) {
return ["text", "code", "relation-map", "search"].includes(type)
|| mime.startsWith('text/')
|| STRING_MIME_TYPES.includes(mime);
}
module.exports = {
randomSecureToken,
randomString,
@@ -177,5 +185,6 @@ module.exports = {
escapeRegExp,
crash,
sanitizeFilenameForHeader,
getContentDisposition
getContentDisposition,
isStringNote
};