mirror of
https://github.com/uetchy/namae.git
synced 2025-08-20 01:48:12 +09:00
fix: tsc errors
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
import { NowRequest, NowResponse } from '@vercel/node';
|
||||
import assert from 'assert';
|
||||
import fetch from 'cross-fetch';
|
||||
import { send, sendError } from '../../../util/http';
|
||||
|
||||
@@ -8,6 +9,8 @@ export default async function handler(
|
||||
): Promise<void> {
|
||||
const { query } = req.query;
|
||||
|
||||
assert(process.env.DOMAINR_API_KEY);
|
||||
|
||||
if (!query || typeof query !== 'string') {
|
||||
return sendError(res, new Error('No query given'));
|
||||
}
|
||||
|
@@ -1,5 +1,6 @@
|
||||
import { send, sendError, fetch } from '../../../util/http';
|
||||
import { NowRequest, NowResponse } from '@vercel/node';
|
||||
import 'cross-fetch';
|
||||
import { fetch, send, sendError } from '../../../util/http';
|
||||
|
||||
export default async function handler(
|
||||
req: NowRequest,
|
||||
@@ -18,12 +19,14 @@ export default async function handler(
|
||||
)}`,
|
||||
'GET'
|
||||
).then((res) => res.text());
|
||||
|
||||
const response = JSON.parse(
|
||||
responseText.match(
|
||||
/AF_initDataCallback.+?hash: '5'.+?data:([\w\W]+?), sideChannel/m
|
||||
)[1]
|
||||
)?.[1] ?? ''
|
||||
);
|
||||
const apps = response[0][1][0][0][0].map((entry) => ({
|
||||
|
||||
const apps = response[0][1][0][0][0].map((entry: any) => ({
|
||||
id: entry[12][0],
|
||||
name: entry[2],
|
||||
author: entry[4][0][0][0],
|
||||
|
Reference in New Issue
Block a user