Objects
values and lookup are typed against the object's declared fields — lookup infers the union of field types.
keys(value: object): string[]Property names (merged across elements for an array of objects).
values(value: object): unknown[]Property values, typed as the union of the object's field types.
lookup(value: object, key: string): unknownValue of the given key (mapped over an array of objects).
merge(objects: object[]): objectMerges an array of objects left to right.
spread(value: object): object[]Splits an object into an array of single-property objects.
type(value: unknown): string`"string" | "number" | "boolean" | "null" | "array" | "object" | "undefined"`.
keys
keys(value: object): string[]Property names (merged across elements for an array of objects).
headerNames: keys(req.headers)values
values(value: object): unknown[]Property values, typed as the union of the object's field types.
headerValues: values(req.headers)lookup
lookup(value: object, key: string): unknownValue of the given key (mapped over an array of objects).
host: lookup(req.headers, "host")merge
merge(objects: object[]): objectMerges an array of objects left to right.
settings: merge([defaults, user.overrides])spread
spread(value: object): object[]Splits an object into an array of single-property objects.
entries: spread(req.headers)type
type(value: unknown): string"string" | "number" | "boolean" | "null" | "array" | "object" | "undefined".
kind: type(req.headers)Playground
{ "headerNames": [ "host", "accept" ], "host": "example.dev", "merged": { "a": 1, "b": 2 }, "kind": "object" }
{
headerNames: string[];
host?: string;
merged: any;
kind: string;
}