Skip to main content
Deno 2 is finally here 🎉️
Learn more
Latest
class HttpResponseUtil
import { HttpResponseUtil } from "https://deno.land/x/sptaki@1.2.0/utils/mod.ts";

Constructors

new
HttpResponseUtil(jsonUtil: JsonUtil, localisationService: LocalisationService)

Properties

protected
jsonUtil: JsonUtil
protected
localisationService: LocalisationService

Methods

protected
clearString(s: string): any

Add an error into the 'warnings' array of the client response message

getBody<T>(
data: T,
err?: number,
errmsg?: any,
sanitize?: boolean,
): IGetBodyResponseData<T>

Game client needs server responses in a particular format

getUnclearedBody(
data: any,
err?: number,
errmsg?: any,
): string
noBody(data: any): any

Return passed in data as JSON string