Describe http headers in an object, like:
{
"Content-Type": "application/json",
"Content-Length": "16"
}
A tuple that can describe a http response. [body, status, ...httpHeaders]
.
If body is undefined, server will response nothing.
HttpReq is the request parameter of http or http2 request handler
HttpRes is the response parameter of http or http2 request handler
BasicRespond is a Respond of binary-like (string, Uint8Array and Readable stream) body
Request handler function of Freesia
MaybePromise is something that can may be wrapped in a Promise.
JSON type is something that can be serialize with JSON.stringify without dropping anything.
Create a Respond with a body.
Create a Respond with a body and status definition
Create a Respond with a body, status definitions and specify some headers.
Attach headers to a Respond
Rebuild a response with a synchronous function
Rebuild a response with a asynchronous function
Get HttpReq
from anywhere called by callback of shimHTTP
HttpReq
object
Get host, path and query object from the request.
Get request method.
method
Get request path from the request.
path
Get hostname from the request.
host
Get the search params from the ruquest.
query
Get the route result from the router
the router you want to use
Create a flare and return handle functions.
[light, observe, extinguish]
assign
assign value to the flareobserve
get the value from the flaredrop
remove the value from the flareCreate a flare and return handle functions.
{ mutable: boolean, reassign: boolean }
define it this flare mutable and reassignable
[light, observe, extinguish]
assign
assign value to the flareobserve
get the value from the flaredrop
remove the value from the flareCreate a flare and return handle functions.
{ mutable: boolean, reassign: boolean }
define it this flare mutable and reassignable
[light, observe, extinguish]
assign
assign value to the flareobserve
get the value from the flaredrop
remove the value from the flareTransform an entry function to Node HTTP request handler
a function receives request object and return a reponse object.
{errHandler, longestConnection}
a handler function for Node http
、https
、http2
modules
Create a route that request can get in.
specify the url matching pattern,
like /user/:<username>/:<age>/:{extra}/
can match url
/user/miku/10/other/many/arguments/?timestamp=1641891955803
.
is a function that can receive route matched params and searchParams generated by URL class and return some thing.
a function that receive a string as argument, if the string matched the pattern, call the handler and return its result, otherwise return undefined.
Create a route that request can get in.
specify the url matching pattern,
like /user/:<username>/:<age>/:{extra}/
can match url
/user/miku/10/other/many/arguments/?timestamp=1641891955803
.
is a function that can receive route matched params and searchParams generated by URL class and return some thing.
a function that receive a string argument and a extra arugment, if the string matched the pattern, call the handler and return its result, otherwise return undefined.
Create a switcher and registry some routes to it.
Create a extended switcher and registry some routes to it.
Create a switcher connected to many routes. Routes will be matched with the order of the arguments.
routes created by createRoute() and has same return type, for example some routes with handlers all return string.
a function that receive a string as argument, if the string matched the pattern, call the handler and return its result, otherwise return undefined.
Create a switcher connected to many routes with same extra argument. Routes will be matched with the order of the arguments.
routes created by createExtRoute() and has same return type, for example some routes with handlers all return string.
a function that receive a string argument and a extra arugment, if the string matched the pattern, call the handler and return its result, otherwise return undefined.
Create a function composition, and add first function.
a function that receive one value of type T and return a value of type R.
Create a computation stream.
Give a initial value to start the computation stream.
a container that contains the value.
Create a computation stream with lazy-computation features
Give a function that can return the value to start a lazy computation stream.
a container that contains the value.
Create a proxy for an asynchronous function.
is a function that executed before original function which returns arguments of original function, and a function executed after the original function, and returns a handled return value.
Create a proxy for an asynchronous function.
Create a proxy for an synchronous function.
is a function that executed before original function which returns arguments of original function, and a function executed after the original function, and returns a handled return value.
Create a proxy for an synchronous function.
Create a proxy that will change parameters type or returns type from the origin one.
is a function that receive the parameters of the new function, and returns arguments of the original function and an after-hook that returns the value of new function.
Create a proxy that will change parameters type or returns type from the origin one.
A function that just return the given value
the value pass to the function
the value passed to the function
Wrap a value into a Promise
the value to be wrapped
a Promisified value
createEffect can add hooks execute before and after original function, and hooks wouldn't change arguments and return value of original function, but can perform some side effect, like logging.
a function execute before original function, and return a function execute after original function.
a wrapper that can wrap the orignal function to another function with side effect.
createEffect can add hooks execute before and after original function, and hooks wouldn't change arguments and return value of original function, but can perform some side effect, like logging.
a wrapper that can wrap the orignal function to another function with side effect.
Create a effect for any function, the hook is not related to the parameters and return value of the origin function.
a function include code executed before the original function and returns the code executed after the original function
a function that can wrap another function.
Check if a string/number is a enumed value
The value to be checked
The enums
Create a cache wrapper for a function. The wrapped function will return the cached value if found the same arguments. Comparation rule is same-value-zero.
Be carefull! This may lead to OOM! You should only employ this wrapper to a simple caculation function, and do not use Inifity as the expire time.
the original function.
the time that a cached expired. Default to Inifinity
a wrapped function.
Wrap a function to make it do not be called too many times.
If it called too many times, wrapped function will return a fallback value without too many computation.
function to be wrapped.
specify maximum times to be called in a windowSize, and set the fallback value.
Generated using TypeDoc
Describe http status. Follow patterns are valid:
200
[200, "Ok"]