aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--package-lock.json169
-rw-r--r--package.json6
-rw-r--r--src/api/server/LocalApi.ts (renamed from src/api/server/LocalApi.js)10
-rw-r--r--src/helpers/array-helpers.ts (renamed from src/helpers/array-helpers.js)2
-rw-r--r--src/helpers/asar-helpers.ts (renamed from src/helpers/asar-helpers.js)2
-rw-r--r--src/helpers/async-helpers.ts (renamed from src/helpers/async-helpers.js)2
-rw-r--r--src/helpers/i18n-helpers.ts (renamed from src/helpers/i18n-helpers.js)4
-rw-r--r--src/helpers/password-helpers.ts (renamed from src/helpers/password-helpers.js)6
-rw-r--r--src/helpers/recipe-helpers.ts (renamed from src/helpers/recipe-helpers.js)6
-rw-r--r--src/helpers/routing-helpers.js4
-rw-r--r--src/helpers/routing-helpers.ts3
-rw-r--r--src/helpers/schedule-helpers.ts (renamed from src/helpers/schedule-helpers.js)2
-rw-r--r--src/helpers/userAgent-helpers.ts (renamed from src/helpers/userAgent-helpers.js)2
13 files changed, 70 insertions, 148 deletions
diff --git a/package-lock.json b/package-lock.json
index f810e8bc3..fe083ea78 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -6513,6 +6513,12 @@
6513 "@types/ms": "*" 6513 "@types/ms": "*"
6514 } 6514 }
6515 }, 6515 },
6516 "@types/du": {
6517 "version": "1.0.0",
6518 "resolved": "https://registry.npmjs.org/@types/du/-/du-1.0.0.tgz",
6519 "integrity": "sha512-gyG+2sBzYwIcwaj2zyRZ75qOwvhFeD6XytT16jBTyqiS9nH9tYy39Ln1oRcECxBfDCJmUmOEyjQoTHJeMFM91w==",
6520 "dev": true
6521 },
6516 "@types/fs-extra": { 6522 "@types/fs-extra": {
6517 "version": "9.0.12", 6523 "version": "9.0.12",
6518 "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.12.tgz", 6524 "resolved": "https://registry.npmjs.org/@types/fs-extra/-/fs-extra-9.0.12.tgz",
@@ -6610,6 +6616,15 @@
6610 "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==", 6616 "integrity": "sha512-jhuKLIRrhvCPLqwPcx6INqmKeiA5EWrsCOPhrlFSrbrmU4ZMPjj5Ul/oLCMDO98XRUIwVm78xICz4EPCektzeQ==",
6611 "dev": true 6617 "dev": true
6612 }, 6618 },
6619 "@types/minipass": {
6620 "version": "3.1.0",
6621 "resolved": "https://registry.npmjs.org/@types/minipass/-/minipass-3.1.0.tgz",
6622 "integrity": "sha512-b2yPKwCrB8x9SB65kcCistMoe3wrYnxxt5rJSZ1kprw0uOXvhuKi9kTQ746Y+Pbqoh+9C0N4zt0ztmTnG9yg7A==",
6623 "dev": true,
6624 "requires": {
6625 "@types/node": "*"
6626 }
6627 },
6613 "@types/ms": { 6628 "@types/ms": {
6614 "version": "0.7.31", 6629 "version": "0.7.31",
6615 "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.31.tgz", 6630 "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.31.tgz",
@@ -6686,6 +6701,12 @@
6686 "@types/node": "*" 6701 "@types/node": "*"
6687 } 6702 }
6688 }, 6703 },
6704 "@types/route-parser": {
6705 "version": "0.1.3",
6706 "resolved": "https://registry.npmjs.org/@types/route-parser/-/route-parser-0.1.3.tgz",
6707 "integrity": "sha512-1AQYpsMbxangSnApsyIHzck5TP8cfas8fzmemljLi2APssJvlZiHkTar/ZtcZwOtK/Ory/xwLg2X8dwhkbnM+g==",
6708 "dev": true
6709 },
6689 "@types/scheduler": { 6710 "@types/scheduler": {
6690 "version": "0.16.2", 6711 "version": "0.16.2",
6691 "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.2.tgz", 6712 "resolved": "https://registry.npmjs.org/@types/scheduler/-/scheduler-0.16.2.tgz",
@@ -6720,6 +6741,16 @@
6720 "integrity": "sha512-ipixuVrh2OdNmauvtT51o3d8z12p6LtFW9in7U79der/kwejjdNchQC5UMn5u/KxNoM7VHHOs/l8KS8uHxhODQ==", 6741 "integrity": "sha512-ipixuVrh2OdNmauvtT51o3d8z12p6LtFW9in7U79der/kwejjdNchQC5UMn5u/KxNoM7VHHOs/l8KS8uHxhODQ==",
6721 "dev": true 6742 "dev": true
6722 }, 6743 },
6744 "@types/tar": {
6745 "version": "4.0.5",
6746 "resolved": "https://registry.npmjs.org/@types/tar/-/tar-4.0.5.tgz",
6747 "integrity": "sha512-cgwPhNEabHaZcYIy5xeMtux2EmYBitfqEceBUi2t5+ETy4dW6kswt6WX4+HqLeiiKOo42EXbGiDmVJ2x+vi37Q==",
6748 "dev": true,
6749 "requires": {
6750 "@types/minipass": "*",
6751 "@types/node": "*"
6752 }
6753 },
6723 "@types/uglify-js": { 6754 "@types/uglify-js": {
6724 "version": "3.13.1", 6755 "version": "3.13.1",
6725 "resolved": "https://registry.npmjs.org/@types/uglify-js/-/uglify-js-3.13.1.tgz", 6756 "resolved": "https://registry.npmjs.org/@types/uglify-js/-/uglify-js-3.13.1.tgz",
@@ -8785,39 +8816,6 @@
8785 "file-uri-to-path": "1.0.0" 8816 "file-uri-to-path": "1.0.0"
8786 } 8817 }
8787 }, 8818 },
8788 "bl": {
8789 "version": "1.2.3",
8790 "resolved": "https://registry.npmjs.org/bl/-/bl-1.2.3.tgz",
8791 "integrity": "sha512-pvcNpa0UU69UT341rO6AYy4FVAIkUHuZXRIWbq+zHnsVcRzDDjIAhGuuYoi0d//cwIwtt4pkpKycWEfjdV+vww==",
8792 "requires": {
8793 "readable-stream": "^2.3.5",
8794 "safe-buffer": "^5.1.1"
8795 },
8796 "dependencies": {
8797 "readable-stream": {
8798 "version": "2.3.7",
8799 "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
8800 "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
8801 "requires": {
8802 "core-util-is": "~1.0.0",
8803 "inherits": "~2.0.3",
8804 "isarray": "~1.0.0",
8805 "process-nextick-args": "~2.0.0",
8806 "safe-buffer": "~5.1.1",
8807 "string_decoder": "~1.1.1",
8808 "util-deprecate": "~1.0.1"
8809 }
8810 },
8811 "string_decoder": {
8812 "version": "1.1.1",
8813 "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
8814 "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
8815 "requires": {
8816 "safe-buffer": "~5.1.0"
8817 }
8818 }
8819 }
8820 },
8821 "block-stream": { 8819 "block-stream": {
8822 "version": "0.0.9", 8820 "version": "0.0.9",
8823 "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz", 8821 "resolved": "https://registry.npmjs.org/block-stream/-/block-stream-0.0.9.tgz",
@@ -9280,6 +9278,7 @@
9280 "version": "1.2.0", 9278 "version": "1.2.0",
9281 "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", 9279 "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz",
9282 "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==", 9280 "integrity": "sha512-CFsHQgjtW1UChdXgbyJGtnm+O/uLQeZdtbDo8mfUgYXCHSM1wgrVxXm6bSyrUuErEb+4sYVGCzASBRot7zyrow==",
9281 "dev": true,
9283 "requires": { 9282 "requires": {
9284 "buffer-alloc-unsafe": "^1.1.0", 9283 "buffer-alloc-unsafe": "^1.1.0",
9285 "buffer-fill": "^1.0.0" 9284 "buffer-fill": "^1.0.0"
@@ -9288,7 +9287,8 @@
9288 "buffer-alloc-unsafe": { 9287 "buffer-alloc-unsafe": {
9289 "version": "1.1.0", 9288 "version": "1.1.0",
9290 "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz", 9289 "resolved": "https://registry.npmjs.org/buffer-alloc-unsafe/-/buffer-alloc-unsafe-1.1.0.tgz",
9291 "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==" 9290 "integrity": "sha512-TEM2iMIEQdJ2yjPJoSIsldnleVaAk1oW3DBVUykyOLsEsFmEc9kn+SFFPz+gl54KQNxlDnAwCXosOS9Okx2xAg==",
9291 "dev": true
9292 }, 9292 },
9293 "buffer-crc32": { 9293 "buffer-crc32": {
9294 "version": "0.2.13", 9294 "version": "0.2.13",
@@ -9310,7 +9310,8 @@
9310 "buffer-fill": { 9310 "buffer-fill": {
9311 "version": "1.0.0", 9311 "version": "1.0.0",
9312 "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz", 9312 "resolved": "https://registry.npmjs.org/buffer-fill/-/buffer-fill-1.0.0.tgz",
9313 "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=" 9313 "integrity": "sha1-+PeLdniYiO858gXNY39o5wISKyw=",
9314 "dev": true
9314 }, 9315 },
9315 "buffer-from": { 9316 "buffer-from": {
9316 "version": "1.1.2", 9317 "version": "1.1.2",
@@ -12311,18 +12312,11 @@
12311 "dev": true 12312 "dev": true
12312 }, 12313 },
12313 "du": { 12314 "du": {
12314 "version": "0.1.0", 12315 "version": "1.0.0",
12315 "resolved": "https://registry.npmjs.org/du/-/du-0.1.0.tgz", 12316 "resolved": "https://registry.npmjs.org/du/-/du-1.0.0.tgz",
12316 "integrity": "sha1-8m40CgnHvFtv1pr2263qYPqMb00=", 12317 "integrity": "sha512-w00+6XpIq924IvDLyOOx5HFO4KwH6YV6buqFx6og/ErTaJ34kVOyI+Q2f+X8pvZkDoEgT6xspA4iYSN99mqPDA==",
12317 "requires": { 12318 "requires": {
12318 "async": "~0.1.22" 12319 "map-async": "~0.1.1"
12319 },
12320 "dependencies": {
12321 "async": {
12322 "version": "0.1.22",
12323 "resolved": "https://registry.npmjs.org/async/-/async-0.1.22.tgz",
12324 "integrity": "sha1-D8GqoIig4+8Ovi2IMbqw3PiEUGE="
12325 }
12326 } 12320 }
12327 }, 12321 },
12328 "duplexer": { 12322 "duplexer": {
@@ -15388,11 +15382,6 @@
15388 } 15382 }
15389 } 15383 }
15390 }, 15384 },
15391 "fs-constants": {
15392 "version": "1.0.0",
15393 "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz",
15394 "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow=="
15395 },
15396 "fs-extra": { 15385 "fs-extra": {
15397 "version": "10.0.0", 15386 "version": "10.0.0",
15398 "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz", 15387 "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-10.0.0.tgz",
@@ -21192,6 +21181,11 @@
21192 "p-defer": "^1.0.0" 21181 "p-defer": "^1.0.0"
21193 } 21182 }
21194 }, 21183 },
21184 "map-async": {
21185 "version": "0.1.1",
21186 "resolved": "https://registry.npmjs.org/map-async/-/map-async-0.1.1.tgz",
21187 "integrity": "sha1-yJfARJ+Fhkx0taPxlu20IVZDF0U="
21188 },
21195 "map-cache": { 21189 "map-cache": {
21196 "version": "0.2.2", 21190 "version": "0.2.2",
21197 "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", 21191 "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz",
@@ -28096,74 +28090,6 @@
28096 } 28090 }
28097 } 28091 }
28098 }, 28092 },
28099 "tar-fs": {
28100 "version": "1.16.3",
28101 "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-1.16.3.tgz",
28102 "integrity": "sha512-NvCeXpYx7OsmOh8zIOP/ebG55zZmxLE0etfWRbWok+q2Qo8x/vOR/IJT1taADXPe+jsiu9axDb3X4B+iIgNlKw==",
28103 "requires": {
28104 "chownr": "^1.0.1",
28105 "mkdirp": "^0.5.1",
28106 "pump": "^1.0.0",
28107 "tar-stream": "^1.1.2"
28108 },
28109 "dependencies": {
28110 "pump": {
28111 "version": "1.0.3",
28112 "resolved": "https://registry.npmjs.org/pump/-/pump-1.0.3.tgz",
28113 "integrity": "sha512-8k0JupWme55+9tCVE+FS5ULT3K6AbgqrGa58lTT49RpyfwwcGedHqaC5LlQNdEAumn/wFsu6aPwkuPMioy8kqw==",
28114 "requires": {
28115 "end-of-stream": "^1.1.0",
28116 "once": "^1.3.1"
28117 }
28118 }
28119 }
28120 },
28121 "tar-stream": {
28122 "version": "1.6.2",
28123 "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-1.6.2.tgz",
28124 "integrity": "sha512-rzS0heiNf8Xn7/mpdSVVSMAWAoy9bfb1WOTYC78Z0UQKeKa/CWS8FOq0lKGNa8DWKAn9gxjCvMLYc5PGXYlK2A==",
28125 "requires": {
28126 "bl": "^1.0.0",
28127 "buffer-alloc": "^1.2.0",
28128 "end-of-stream": "^1.0.0",
28129 "fs-constants": "^1.0.0",
28130 "readable-stream": "^2.3.0",
28131 "to-buffer": "^1.1.1",
28132 "xtend": "^4.0.0"
28133 },
28134 "dependencies": {
28135 "readable-stream": {
28136 "version": "2.3.7",
28137 "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz",
28138 "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==",
28139 "requires": {
28140 "core-util-is": "~1.0.0",
28141 "inherits": "~2.0.3",
28142 "isarray": "~1.0.0",
28143 "process-nextick-args": "~2.0.0",
28144 "safe-buffer": "~5.1.1",
28145 "string_decoder": "~1.1.1",
28146 "util-deprecate": "~1.0.1"
28147 }
28148 },
28149 "string_decoder": {
28150 "version": "1.1.1",
28151 "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz",
28152 "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==",
28153 "requires": {
28154 "safe-buffer": "~5.1.0"
28155 }
28156 }
28157 }
28158 },
28159 "targz": {
28160 "version": "1.0.1",
28161 "resolved": "https://registry.npmjs.org/targz/-/targz-1.0.1.tgz",
28162 "integrity": "sha1-j3alI2lM3t+7XWCkB2/27uzFOY8=",
28163 "requires": {
28164 "tar-fs": "^1.8.1"
28165 }
28166 },
28167 "tarn": { 28093 "tarn": {
28168 "version": "1.1.5", 28094 "version": "1.1.5",
28169 "resolved": "https://registry.npmjs.org/tarn/-/tarn-1.1.5.tgz", 28095 "resolved": "https://registry.npmjs.org/tarn/-/tarn-1.1.5.tgz",
@@ -28658,11 +28584,6 @@
28658 "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=", 28584 "integrity": "sha1-fSKbH8xjfkZsoIEYCDanqr/4P0M=",
28659 "dev": true 28585 "dev": true
28660 }, 28586 },
28661 "to-buffer": {
28662 "version": "1.1.1",
28663 "resolved": "https://registry.npmjs.org/to-buffer/-/to-buffer-1.1.1.tgz",
28664 "integrity": "sha512-lx9B5iv7msuFYE3dytT+KE5tap+rNYw+K4jVkb9R/asAb+pbBSM17jtunHplhBe6RRJdZx3Pn2Jph24O32mOVg=="
28665 },
28666 "to-fast-properties": { 28587 "to-fast-properties": {
28667 "version": "2.0.0", 28588 "version": "2.0.0",
28668 "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", 28589 "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz",
diff --git a/package.json b/package.json
index 1778ab0b7..10eca8882 100644
--- a/package.json
+++ b/package.json
@@ -79,7 +79,7 @@
79 "darkreader": "4.9.34", 79 "darkreader": "4.9.34",
80 "dbus-next": "0.9.2", 80 "dbus-next": "0.9.2",
81 "debug": "4.3.2", 81 "debug": "4.3.2",
82 "du": "0.1.0", 82 "du": "1.0.0",
83 "electron-dl": "3.2.1", 83 "electron-dl": "3.2.1",
84 "electron-fetch": "1.7.3", 84 "electron-fetch": "1.7.3",
85 "electron-find": "1.0.7", 85 "electron-find": "1.0.7",
@@ -127,7 +127,6 @@
127 "smoothscroll-polyfill": "0.4.4", 127 "smoothscroll-polyfill": "0.4.4",
128 "sqlite3": "5.0.2", 128 "sqlite3": "5.0.2",
129 "tar": "4.4.15", 129 "tar": "4.4.15",
130 "targz": "1.0.1",
131 "tslib": "2.3.1", 130 "tslib": "2.3.1",
132 "useragent-generator": "1.1.1-amkt-22079-finish.0", 131 "useragent-generator": "1.1.1-amkt-22079-finish.0",
133 "uuid": "3.3.3", 132 "uuid": "3.3.3",
@@ -151,11 +150,14 @@
151 "@commitlint/config-conventional": "13.1.0", 150 "@commitlint/config-conventional": "13.1.0",
152 "@tsconfig/node14": "1.0.1", 151 "@tsconfig/node14": "1.0.1",
153 "@types/color": "3.0.2", 152 "@types/color": "3.0.2",
153 "@types/du": "1.0.0",
154 "@types/fs-extra": "9.0.12", 154 "@types/fs-extra": "9.0.12",
155 "@types/lodash": "4.14.172", 155 "@types/lodash": "4.14.172",
156 "@types/node": "14.17.6", 156 "@types/node": "14.17.6",
157 "@types/react": "16.14.6", 157 "@types/react": "16.14.6",
158 "@types/react-dom": "16.9.13", 158 "@types/react-dom": "16.9.13",
159 "@types/route-parser": "0.1.3",
160 "@types/tar": "4.0.5",
159 "@types/uuid": "3.4.9", 161 "@types/uuid": "3.4.9",
160 "@typescript-eslint/eslint-plugin": "4.29.1", 162 "@typescript-eslint/eslint-plugin": "4.29.1",
161 "@typescript-eslint/parser": "4.29.1", 163 "@typescript-eslint/parser": "4.29.1",
diff --git a/src/api/server/LocalApi.js b/src/api/server/LocalApi.ts
index 644f15b93..71721bb0f 100644
--- a/src/api/server/LocalApi.js
+++ b/src/api/server/LocalApi.ts
@@ -8,9 +8,9 @@ const debug = require('debug')('Ferdi:LocalApi');
8 8
9export default class LocalApi { 9export default class LocalApi {
10 // Settings 10 // Settings
11 getAppSettings(type) { 11 getAppSettings(type: any) {
12 return new Promise(resolve => { 12 return new Promise(resolve => {
13 ipcRenderer.once('appSettings', (event, resp) => { 13 ipcRenderer.once('appSettings', (_event, resp) => {
14 debug('LocalApi::getAppSettings resolves', resp.type, resp.data); 14 debug('LocalApi::getAppSettings resolves', resp.type, resp.data);
15 resolve(resp); 15 resolve(resp);
16 }); 16 });
@@ -19,7 +19,7 @@ export default class LocalApi {
19 }); 19 });
20 } 20 }
21 21
22 async updateAppSettings(type, data) { 22 async updateAppSettings(type: any, data: any) {
23 debug('LocalApi::updateAppSettings resolves', type, data); 23 debug('LocalApi::updateAppSettings resolves', type, data);
24 ipcRenderer.send('updateAppSettings', { 24 ipcRenderer.send('updateAppSettings', {
25 type, 25 type,
@@ -31,7 +31,7 @@ export default class LocalApi {
31 async getAppCacheSize() { 31 async getAppCacheSize() {
32 const partitionsDir = getServicePartitionsDirectory(); 32 const partitionsDir = getServicePartitionsDirectory();
33 return new Promise((resolve, reject) => { 33 return new Promise((resolve, reject) => {
34 du(partitionsDir, (err, size) => { 34 du(partitionsDir, (err: Error | null, size?: number | undefined) => {
35 if (err) reject(err); 35 if (err) reject(err);
36 36
37 debug('LocalApi::getAppCacheSize resolves', size); 37 debug('LocalApi::getAppCacheSize resolves', size);
@@ -40,7 +40,7 @@ export default class LocalApi {
40 }); 40 });
41 } 41 }
42 42
43 async clearCache(serviceId = null) { 43 async clearCache(serviceId: string | null = null) {
44 const s = serviceId 44 const s = serviceId
45 ? session.fromPartition(`persist:service-${serviceId}`) 45 ? session.fromPartition(`persist:service-${serviceId}`)
46 : session.defaultSession; 46 : session.defaultSession;
diff --git a/src/helpers/array-helpers.js b/src/helpers/array-helpers.ts
index 5e592b7f7..ae5d8d99f 100644
--- a/src/helpers/array-helpers.js
+++ b/src/helpers/array-helpers.ts
@@ -1,4 +1,4 @@
1export const shuffleArray = (arr) => arr 1export const shuffleArray = (arr: any[]) => arr
2 .map((a) => [Math.random(), a]) 2 .map((a) => [Math.random(), a])
3 .sort((a, b) => a[0] - b[0]) 3 .sort((a, b) => a[0] - b[0])
4 .map((a) => a[1]); 4 .map((a) => a[1]);
diff --git a/src/helpers/asar-helpers.js b/src/helpers/asar-helpers.ts
index 9e4380c06..3d9f0d941 100644
--- a/src/helpers/asar-helpers.js
+++ b/src/helpers/asar-helpers.ts
@@ -1,3 +1,3 @@
1export function asarPath(dir = '') { 1export function asarPath(dir: string = '') {
2 return dir.replace('app.asar', 'app.asar.unpacked'); 2 return dir.replace('app.asar', 'app.asar.unpacked');
3} 3}
diff --git a/src/helpers/async-helpers.js b/src/helpers/async-helpers.ts
index c6c57e28e..aae3c3928 100644
--- a/src/helpers/async-helpers.js
+++ b/src/helpers/async-helpers.ts
@@ -1,5 +1,5 @@
1/* eslint-disable import/prefer-default-export */ 1/* eslint-disable import/prefer-default-export */
2 2
3export function sleep(ms = 0) { 3export function sleep(ms: number = 0) {
4 return new Promise((r) => setTimeout(r, ms)); 4 return new Promise((r) => setTimeout(r, ms));
5} 5}
diff --git a/src/helpers/i18n-helpers.js b/src/helpers/i18n-helpers.ts
index 807b9066e..c1f18f446 100644
--- a/src/helpers/i18n-helpers.js
+++ b/src/helpers/i18n-helpers.ts
@@ -3,7 +3,7 @@ export function getLocale({
3}) { 3}) {
4 let localeStr = locale; 4 let localeStr = locale;
5 if (locales[locale] === undefined) { 5 if (locales[locale] === undefined) {
6 let localeFuzzy; 6 let localeFuzzy: string | undefined;
7 Object.keys(locales).forEach((localStr) => { 7 Object.keys(locales).forEach((localStr) => {
8 if (locales && Object.hasOwnProperty.call(locales, localStr)) { 8 if (locales && Object.hasOwnProperty.call(locales, localStr)) {
9 if (locale.substring(0, 2) === localStr.substring(0, 2)) { 9 if (locale.substring(0, 2) === localStr.substring(0, 2)) {
@@ -31,7 +31,7 @@ export function getLocale({
31export function getSelectOptions({ 31export function getSelectOptions({
32 locales, resetToDefaultText = '', automaticDetectionText = '', sort = true, 32 locales, resetToDefaultText = '', automaticDetectionText = '', sort = true,
33}) { 33}) {
34 const options = []; 34 const options: object[] = [];
35 35
36 if (resetToDefaultText) { 36 if (resetToDefaultText) {
37 options.push( 37 options.push(
diff --git a/src/helpers/password-helpers.js b/src/helpers/password-helpers.ts
index cf461e4f7..89c75c752 100644
--- a/src/helpers/password-helpers.js
+++ b/src/helpers/password-helpers.ts
@@ -1,10 +1,10 @@
1import crypto from 'crypto'; 1import crypto from 'crypto';
2 2
3export function hash(password) { 3export function hash(password: crypto.BinaryLike) {
4 return crypto.createHash('sha256').update(password).digest('base64'); 4 return crypto.createHash('sha256').update(password).digest('base64');
5} 5}
6 6
7export function scorePassword(password) { 7export function scorePassword(password: string) {
8 let score = 0; 8 let score = 0;
9 if (!password) { 9 if (!password) {
10 return score; 10 return score;
@@ -32,5 +32,5 @@ export function scorePassword(password) {
32 32
33 score += (variationCount - 1) * 10; 33 score += (variationCount - 1) * 10;
34 34
35 return parseInt(score, 10); 35 return parseInt(score.toString(), 10);
36} 36}
diff --git a/src/helpers/recipe-helpers.js b/src/helpers/recipe-helpers.ts
index 7e4bfa85a..965429210 100644
--- a/src/helpers/recipe-helpers.js
+++ b/src/helpers/recipe-helpers.ts
@@ -1,15 +1,15 @@
1import { parse } from 'path'; 1import { parse } from 'path';
2import { userDataRecipesPath } from '../environment'; 2import { userDataRecipesPath } from '../environment';
3 3
4export function getRecipeDirectory(id = '') { 4export function getRecipeDirectory(id: string = ''): string {
5 return userDataRecipesPath(id); 5 return userDataRecipesPath(id);
6} 6}
7 7
8export function getDevRecipeDirectory(id = '') { 8export function getDevRecipeDirectory(id: string = ''): string {
9 return userDataRecipesPath('dev', id); 9 return userDataRecipesPath('dev', id);
10} 10}
11 11
12export function loadRecipeConfig(recipeId) { 12export function loadRecipeConfig(recipeId: string) {
13 try { 13 try {
14 const configPath = `${recipeId}/package.json`; 14 const configPath = `${recipeId}/package.json`;
15 // Delete module from cache 15 // Delete module from cache
diff --git a/src/helpers/routing-helpers.js b/src/helpers/routing-helpers.js
deleted file mode 100644
index 14922ebf3..000000000
--- a/src/helpers/routing-helpers.js
+++ /dev/null
@@ -1,4 +0,0 @@
1import RouteParser from 'route-parser';
2
3// eslint-disable-next-line
4export const matchRoute = (pattern, path) => new RouteParser(pattern).match(path);
diff --git a/src/helpers/routing-helpers.ts b/src/helpers/routing-helpers.ts
new file mode 100644
index 000000000..18169f01b
--- /dev/null
+++ b/src/helpers/routing-helpers.ts
@@ -0,0 +1,3 @@
1import RouteParser from 'route-parser';
2
3export const matchRoute = (pattern: string, path: string) => new RouteParser(pattern).match(path);
diff --git a/src/helpers/schedule-helpers.js b/src/helpers/schedule-helpers.ts
index a3020cad6..754fd5556 100644
--- a/src/helpers/schedule-helpers.js
+++ b/src/helpers/schedule-helpers.ts
@@ -1,6 +1,6 @@
1/* eslint-disable import/prefer-default-export */ 1/* eslint-disable import/prefer-default-export */
2 2
3export function isInTimeframe(start, end) { 3export function isInTimeframe(start: string, end: string) {
4 const [ 4 const [
5 startHourStr, 5 startHourStr,
6 startMinuteStr, 6 startMinuteStr,
diff --git a/src/helpers/userAgent-helpers.js b/src/helpers/userAgent-helpers.ts
index ede5e6dc4..73c8bfd03 100644
--- a/src/helpers/userAgent-helpers.js
+++ b/src/helpers/userAgent-helpers.ts
@@ -6,7 +6,7 @@ import {
6} from '../environment'; 6} from '../environment';
7 7
8function macOS() { 8function macOS() {
9 const version = macosVersion(); 9 const version = macosVersion() || '';
10 let cpuName = os.cpus()[0].model.split(' ')[0]; 10 let cpuName = os.cpus()[0].model.split(' ')[0];
11 if (cpuName && cpuName.match(/\(/)) { 11 if (cpuName && cpuName.match(/\(/)) {
12 cpuName = cpuName.split('(')[0]; 12 cpuName = cpuName.split('(')[0];