feat: added parseCookie function

This commit is contained in:
원더 2021-01-27 22:58:52 +09:00
parent 6286a9fa2a
commit 8bb615d721

View File

@ -1,6 +1,10 @@
import { Readable } from 'stream'
import { NextPageContext } from 'next'
import cookie from 'cookie'
import { ImageOptions, UserPemissionFlags } from '@types'
import { Oauth, perms } from './Constants'
import { NextRouter } from 'next/router'
export function formatNumber(value: number):string {
const suffixes = ['', '만', '억', '조','해']
@ -77,4 +81,13 @@ export function bufferToStream(binary: Buffer) {
return readableInstanceStream
}
export function parseCookie(ctx: NextPageContext) {
return cookie.parse(ctx.req.headers.cookie || '')
}
export function redirectTo(router: NextRouter, to: string) {
router.push(to)
return
}
export { anchorHeader } from './ShowdownExtensions'