A stream that is guarded from emitting errors when there are no listeners. If an error occurs while no listener is attached, it will store the error and emit it once a listener is added (or a timeout occurs).
An incoming HTTP request;
An outgoing HTTP response;
Different log levels, from most important to least important.
Adds a header value without overriding previous values.
Decodes all components of a URI path.
Encodes all (non-slash) special characters in a URI path.
Makes sure the input path has exactly 1 slash at the end. Multiple slashes will get merged into one. If there is no slash it will be added.
Path to check.
The potentially changed path.
Gets a logger instance for the given class instance.
The returned type of logger depends on the configured LoggerFactory in {@link Setup}.
The following shows a typical pattern on how to create loggers:
class MyClass {
protected readonly logger = getLoggerFor(this);
}
If no class is applicable, a logger can also be created as follows:
const logger = getLoggerFor('MyFunction');
A class instance or a class string name.
Makes sure that listeners always receive the error event of a stream, even if it was thrown before the listener was attached. If the input is already guarded nothing will happen.
Stream that can potentially throw an error.
The stream.
Checks if the identifier corresponds to a container identifier.
Identifier to check.
Checks if the path corresponds to a container path (ending in a /).
Path to check.
Determines whether the stream is guarded from emitting errors.
Determines whether the object is a RepresentationMetadata
.
Determines whether the object is a ResourceIdentifier
.
Checks if the given two media types/ranges match each other. Takes wildcards into account.
Media type to match.
Media type to match.
True if the media type patterns can match each other.
Filters media types based on the given preferences.
Based on RFC 7231 - Content negotiation.
Will add a default internal/*;q=0
to the preferences to prevent accidental use of internal types.
Since more specific media ranges override less specific ones,
this will be ignored if there is a specific internal type preference.
Preferences for output type.
Media types to compare to the preferences.
The weighted and filtered list of matching types.
Parses an Accept-Charset header string.
The Accept-Charset header string.
An array of AcceptCharset objects, sorted by weight.
Parses an Accept-Encoding header string.
The Accept-Encoding header string.
An array of AcceptEncoding objects, sorted by weight.
Parses an Accept-Language header string.
The Accept-Language header string.
An array of AcceptLanguage objects, sorted by weight.
Parses a Forwarded header value.
The Forwarded header value.
The parsed Forwarded header.
Parses a list of split parameters and checks their validity.
A list of split parameters (token [ "=" ( token / quoted-string ) ])
The double quoted strings that need to be replaced.
An array of name/value objects corresponding to the parameters.
Helper function to convert a Readable into an array of quads.
The readable object.
The content-type of the stream.
A promise containing the array of quads.
Pipes one stream into another and emits errors of the first stream with the second. In case of an error in the first stream the second one will be destroyed with the given error. This will also make the stream Guarded.
Initial readable stream.
The destination for writing data.
Optional function that takes the error and converts it to a new error.
The destination stream.
Generates a quad with the given subject/predicate/object and pushes it to the given array.
Joins all strings of a stream.
Stream of strings.
The joined string.
Resets the global logger factory to undefined.
This typically only needs to be called during testing. Call this at your own risk.
Helper function for serializing an array of quads, with as result a Readable object.
The array of quads.
The content-type to serialize to.
The Readable object.
Sets the global logger factory. This will cause all loggers created by getLoggerFor to be delegated to a logger from the given factory.
A logger factory.
Splits the input string on commas, trims all parts and filters out empty ones.
Input header string.
Determines whether the given conversion request is supported, given the available content type conversions:
Incoming arguments.
Media types that can be parsed by the converter.
Media types that can be produced by the converter.
Converts a URI path to the canonical version by splitting on slashes, decoding any percent-based encodings, and then encoding any special characters.
Replaces all double quoted strings in the input string with "0"
, "1"
, etc.
The Accept header string.
The transformed string and a map with keys "0"
, etc. and values the original string that was there.
Makes sure the input path has no slashes at the end.
Path to check.
The potentially changed path.
Agent metadata related to pod generation.