mirror of
https://github.com/zadam/trilium.git
synced 2025-11-17 18:50:41 +01:00
Merge branch 'feature/typescript_backend_2' into feature/typescript_backend_3
This commit is contained in:
@@ -10,7 +10,7 @@ import passwordService = require('./encryption/password');
|
||||
|
||||
const noAuthentication = config.General && config.General.noAuthentication === true;
|
||||
|
||||
// FIXME: We are using custom types for request & response because couldn't extract those pesky express types.
|
||||
// TODO: We are using custom types for request & response because couldn't extract those pesky express types.
|
||||
interface Request {
|
||||
method: string;
|
||||
path: string;
|
||||
|
||||
@@ -31,7 +31,7 @@ function changePassword(currentPassword: string, newPassword: string) {
|
||||
const newPasswordVerificationKey = utils.toBase64(myScryptService.getVerificationHash(newPassword));
|
||||
|
||||
if (decryptedDataKey) {
|
||||
// FIXME: what should happen if the decrypted data key is null?
|
||||
// TODO: what should happen if the decrypted data key is null?
|
||||
passwordEncryptionService.setDataKey(newPassword, decryptedDataKey);
|
||||
}
|
||||
|
||||
|
||||
@@ -762,7 +762,7 @@ function updateNoteData(noteId: string, content: string, attachments: BAttachmen
|
||||
const existingAttachmentsByTitle = utils.toMap(note.getAttachments({includeContentLength: false}), 'title');
|
||||
|
||||
for (const attachment of attachments) {
|
||||
// FIXME: The content property was extracted directly instead of `getContent`. To investigate.
|
||||
// TODO: The content property was extracted directly instead of `getContent`. To investigate.
|
||||
const {attachmentId, role, mime, title, position} = attachment;
|
||||
const content = attachment.getContent();
|
||||
|
||||
@@ -835,7 +835,7 @@ function undeleteBranch(branchId: string, deleteId: string, taskContext: TaskCon
|
||||
|
||||
for (const attributeRow of attributeRows) {
|
||||
// relation might point to a note which hasn't been undeleted yet and would thus throw up
|
||||
// FIXME: skipValidation is not used.
|
||||
// TODO: skipValidation is not used.
|
||||
new BAttribute(attributeRow).save({skipValidation: true});
|
||||
}
|
||||
|
||||
@@ -1015,7 +1015,7 @@ function duplicateSubtreeInner(origNote: BNote, origBranch: BBranch, newParentNo
|
||||
}
|
||||
|
||||
// the relation targets may not be created yet, the mapping is pre-generated
|
||||
// FIXME: This used to be `attr.save({skipValidation: true});`, but skipValidation is in beforeSaving.
|
||||
// TODO: This used to be `attr.save({skipValidation: true});`, but skipValidation is in beforeSaving.
|
||||
attr.save();
|
||||
}
|
||||
|
||||
|
||||
@@ -39,7 +39,6 @@ class OrderByAndLimitExp extends Expression {
|
||||
|
||||
execute(inputNoteSet: NoteSet, executionContext: {}, searchContext: SearchContext) {
|
||||
if (!this.subExpression) {
|
||||
// FIXME: who is setting the subexpression?
|
||||
throw new Error("Missing subexpression");
|
||||
}
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
const Mutex = require('async-mutex').Mutex;
|
||||
const instance = new Mutex();
|
||||
|
||||
async function doExclusively<T>(func: () => void) {
|
||||
async function doExclusively<T>(func: () => T) {
|
||||
const releaseMutex = await instance.acquire();
|
||||
|
||||
try {
|
||||
|
||||
@@ -82,7 +82,7 @@ function unescapeHtml(str: string) {
|
||||
}
|
||||
|
||||
function toObject<T, K extends string | number | symbol, V>(array: T[], fn: (item: T) => [K, V]): Record<K, V> {
|
||||
const obj: Record<K, V> = {} as Record<K, V>; // FIXME: unsafe?
|
||||
const obj: Record<K, V> = {} as Record<K, V>; // TODO: unsafe?
|
||||
|
||||
for (const item of array) {
|
||||
const ret = fn(item);
|
||||
@@ -98,7 +98,7 @@ function stripTags(text: string) {
|
||||
}
|
||||
|
||||
function union<T extends string | number | symbol>(a: T[], b: T[]): T[] {
|
||||
const obj: Record<T, T> = {} as Record<T, T>; // FIXME: unsafe?
|
||||
const obj: Record<T, T> = {} as Record<T, T>; // TODO: unsafe?
|
||||
|
||||
for (let i = a.length-1; i >= 0; i--) {
|
||||
obj[a[i]] = a[i];
|
||||
|
||||
Reference in New Issue
Block a user