Fix type checks

9a392afee34aeef74a9443d0d9580c78e200a2b9

Cohee <18619528+Cohee1207@users.noreply.github.com>

2 files changed, +4 -0Ignore whitespace
src/endpoints/openrouter.js+2 -0
@@ -18,6 +18,7 @@ router.post('/models/providers', async (req, res) => {
1818 return res.json([]);
1919 }
2020
21+ /** @type {any} */
2122 const data = await response.json();
2223 const endpoints = data?.data?.endpoints || [];
2324 const providerNames = endpoints.map(e => e.provider_name);
@@ -43,6 +44,7 @@ router.post('/models/multimodal', async (_req, res) => {
4344 return res.json([]);
4445 }
4546
47+ /** @type {any} */
4648 const data = await response.json();
4749 const models = data?.data || [];
4850 const multimodalModels = models.filter(m => m?.architecture?.modality === 'text+image->text').map(m => m.id);
src/endpoints/tokenizers.js+2 -0
@@ -1025,6 +1025,7 @@ router.post('/remote/kobold/count', async function (request, response) {
10251025 return response.send({ error: true });
10261026 }
10271027
1028+ /** @type {any} */
10281029 const data = await result.json();
10291030 const count = data['value'];
10301031 const ids = data['ids'] ?? [];
@@ -1089,6 +1090,7 @@ router.post('/remote/textgenerationwebui/encode', async function (request, respo
10891090 return response.send({ error: true });
10901091 }
10911092
1093+ /** @type {any} */
10921094 const data = await result.json();
10931095 const count = (data?.length ?? data?.count ?? data?.value ?? data?.tokens?.length);
10941096 const ids = (data?.tokens ?? data?.ids ?? []);