mirror of
https://github.com/koreanbots/core.git
synced 2025-12-15 14:10:22 +00:00
feat: added parseCookie function
This commit is contained in:
parent
6286a9fa2a
commit
8bb615d721
@ -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'
|
||||
Loading…
x
Reference in New Issue
Block a user