1
0
mirror of https://github.com/uetchy/namae.git synced 2025-08-20 18:08:11 +09:00

chore: cosmetic changes

This commit is contained in:
2019-09-17 14:30:26 +09:00
parent 2438518e3c
commit 6c84493360
56 changed files with 724 additions and 729 deletions

View File

@@ -1,17 +1,17 @@
import npmName from 'npm-name'
import { send, sendError, fetch, NowRequest, NowResponse } from '../util/http'
import npmName from 'npm-name';
import {send, sendError, fetch, NowRequest, NowResponse} from '../util/http';
export default async function handler(req: NowRequest, res: NowResponse) {
const { query } = req.query
const {query} = req.query;
if (!query) {
return sendError(res, new Error('no query given'))
return sendError(res, new Error('no query given'));
}
try {
const availability = await npmName(`@${query}`)
send(res, { availability })
const availability = await npmName(`@${query}`);
send(res, {availability});
} catch (err) {
sendError(res, err)
sendError(res, err);
}
}