44 Commits

Author SHA1 Message Date
Panagiotis Papadopoulos
65be2cf048 refactor(server/utils): simplify getNoteTitle 2025-02-01 14:37:12 +01:00
Panagiotis Papadopoulos
c15e46bf25 chore(server/utils): improve types for getNoteTitle 2025-02-01 14:37:12 +01:00
Panagiotis Papadopoulos
fedaec6c79 refactor(server/utils): merge sanitizeFilenameForHeader into getContentDisposition
sanitizeFilenameForHeader is not used anywhere else and is tiny, so let's merge it
2025-02-01 14:37:12 +01:00
Panagiotis Papadopoulos
29b1befd60 fix(server/utils): missing export for sanitizeFilenameForHeader 2025-02-01 14:37:12 +01:00
Panagiotis Papadopoulos
6ab9a3979d refactor(server/utils): simplify sanitizeFilenameForHeader
since "" is falsy, we can just use "||" here
2025-02-01 14:37:12 +01:00
Panagiotis Papadopoulos
df1d479720 chore(server/utils): sort exports alphabetically 2025-02-01 14:37:12 +01:00
Panagiotis Papadopoulos
ef66d330ec chore(server/utils): timeLimit - add TODO comment 2025-02-01 14:37:12 +01:00
Panagiotis Papadopoulos
9a8a27c02c refactor(server/utils): avoid same variable name for error in timeLimit
rename the error created in timeLimit to `errorTimeLimit` to differentiate it from the error that is caught inside the promise

makes it a bit easier to quickly distinguish these
2025-02-01 14:37:12 +01:00
Panagiotis Papadopoulos
440dbfd4d4 refactor(server/utils): use Set for isStringNote 2025-02-01 14:37:12 +01:00
Panagiotis Papadopoulos
283b19c716 fix(server/utils): add missed export of isDev in default export object 2025-02-01 14:37:12 +01:00
Panagiotis Papadopoulos
81db681732 refactor(server/utils): remove unused union
function is not used at all anywhere
2025-02-01 14:37:12 +01:00
Panagiotis Papadopoulos
92123e1761 refactor(server/utils): get rid of isString
let's use typeof x === "string" → works exactly the same and at the same speed as this custom isString fn
2025-02-01 14:37:12 +01:00
Panagiotis Papadopoulos
03c1128a72 fix(isEmptyOrWhitespace): avoid exception throwing when passed value is undefined
the req.body value from "routes/api/branches" actually seems to never get parsed into a JS object, but arrives as text string, so req.body.prefix could be undefined, which of course would cause an error to be thrown, when trying to call "match" on undefined.
2025-02-01 14:37:12 +01:00
Panagiotis Papadopoulos
31c46753de refactor(server/utils): isDev move to utils and replace fn with boolean
this value cannot change during runtime,
=> there is no need to have these checks
as dynamic function, instead just
export the boolean value directly
2025-01-29 10:58:00 +01:00
Panagiotis Papadopoulos
ca2bb94200 refactor(server/utils): isElectron - replace fn with boolean
this values cannot change during runtime,
=> there is no need to have these checks
as dynamic function, instead just
export the boolean value directly
2025-01-29 10:55:53 +01:00
Panagiotis Papadopoulos
94411cf418 refactor(server/utils): isMac/isWin - replace fn with boolean
those values cannot change during runtime,
=> there is no need to have these checks
as dynamic function, instead just
export the boolean value directly
2025-01-29 10:55:53 +01:00
Panagiotis Papadopoulos
c0327bf8e2 feat(server/utils): add envToBoolean helper function
turns "true" / "false" strings from a process.env property into actual boolean values or undefined
2025-01-23 20:18:05 +01:00
Elian Doran
4cbb529fd4
chore(prettier): fix all files 2025-01-09 18:07:02 +02:00
Panagiotis Papadopoulos
6da656cd67 refactor(formatDownloadTitle): simplify function
I've kept the "extension determination process" in a nested function,
that reuses the formatDownloadTitle arguments,
however it could also be refactored into an own util function later,
if it is ever required.

The for loop got replaced by the built functions in `mimeType`
2025-01-03 14:17:30 +01:00
Panagiotis Papadopoulos
13235a25b1 refactor(utils): add isMac and isWindows as util func 2025-01-02 18:45:41 +01:00
Elian Doran
2556d51870
Merge pull request #873 from pano9000/refactor_use_Set
refactor(services): use Set instead of Arrays for faster lookups
2025-01-02 17:50:35 +02:00
Panagiotis Papadopoulos
baea3bdcdd refactor(services): use Set instead of Arrays for faster lookups 2025-01-02 14:59:26 +01:00
Panagiotis Papadopoulos
3814621e1c reafctor(services/utils): export functions individually 2025-01-02 13:26:25 +01:00
Elian Doran
b321d99076
chore(code): fix editorconfig for src/public 2024-12-22 15:42:15 +02:00
CobriMediaJulien
e64e51c078
Update utils.ts to fix backend bug that prevented library items from loading 2024-12-15 15:56:10 +01:00
Elian Doran
a02146df17
server: Fix loading of code block theme on server builds 2024-11-05 02:58:21 +02:00
Elian Doran
e72eb5f27c
electron: Fix asset path on forge build 2024-11-02 11:49:33 +02:00
Elian Doran
4ad725842e
server: Trim .htm when importing zip (closes #500) 2024-10-20 00:17:51 +03:00
Elian Doran
013f25a49b
server-esm: Make crash async 2024-07-18 23:26:21 +03:00
Elian Doran
efdae79c10
server-esm: Remove two more straightforward imports 2024-07-18 22:25:03 +03:00
Elian Doran
a8fd3be133
server-esm: Remove dynamic import to utils 2024-07-18 22:21:33 +03:00
Elian Doran
0ceae0a65e
server-esm: Change some more export object to export default object 2024-07-18 21:47:30 +03:00
Elian Doran
2750df04a3
server-esm: Change simple library import statements 2024-07-18 21:37:45 +03:00
Elian Doran
8fb67c9766
server-esm: Normalize quotes in require imports 2024-07-18 21:28:51 +03:00
Elian Doran
c4c2259e69
server-ts: Port share/shaca/sattachment 2024-04-09 22:21:07 +03:00
Elian Doran
53d4873c1f
server-ts: Port services/import/zip 2024-04-03 22:46:14 +03:00
Elian Doran
8c5f680dca
server-ts: Fix build errors 2024-02-25 15:06:43 +02:00
Elian Doran
0903cf2646
Merge branch 'feature/typescript_backend_2' into feature/typescript_backend_3 2024-02-18 20:43:27 +02:00
Elian Doran
aff1c30557
server-ts: FIXME -> TODO 2024-02-18 20:29:23 +02:00
Elian Doran
d89b791914
server-ts: Port services/sync 2024-02-18 13:10:51 +02:00
Elian Doran
9aec3390dd
server-ts: Fix most errors in bnote 2024-02-17 13:32:42 +02:00
Elian Doran
f9ba8ca87d
server-ts: Fix errors in abstract_becca_entity 2024-02-17 13:32:42 +02:00
Elian Doran
c20d2273e6
server-ts: services/encryption/*.js -> ts 2024-02-17 13:32:41 +02:00
Elian Doran
7a9365457a
server-ts: utils.js -> utils.ts 2024-02-17 13:32:41 +02:00