@fangxq/request
Advanced tools
Comparing version 0.0.27 to 0.0.28
// import { TReq,TRes } from './shared'; | ||
type thandler = <TReq,TRes>(src: string, req: TReq) => Promise<{ data?: TRes, use_ws?: (ws: typeof global.WebSocket) => void }> | ||
type thandler = <TReq, TRes>(src: string, req: TReq, res: { data?: TRes, use_ws?: (ws: typeof global.WebSocket) => Promise<void>})=> Promise<void>; | ||
export async function listen<TReq,TRes>(host: string, port: number, handler: thandler<TReq,TRes>): Promise<import('https').Server> | ||
export async function listen<TReq, TRes>(host: string, port: number, handler: thandler<TReq, TRes>): Promise<import('https').Server> |
@@ -33,5 +33,7 @@ const fs = require('fs') | ||
let result = await handler(src, data) | ||
const result = {} | ||
if(result.use_ws){ | ||
await handler(src, data, result) | ||
if (result.use_ws) { | ||
const ws_token = uuid() | ||
@@ -38,0 +40,0 @@ const use_ws = result.use_ws |
{ | ||
"name": "@fangxq/request", | ||
"version": "0.0.27", | ||
"version": "0.0.28", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "scripts": { |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
4646
117