Home > @uniformdev/redirect

redirect package

Classes

Class

Description

PathTrie

PathTrieData

RedirectClient

UncachedRedirectClient

WithMemoryCache

Functions

Function

Description

ExtractWildcards(url)

getSourceVariables(path, source, isVariable)

Extract the variables and their respective values given a source URL and a path. The source URL is expected to contain wildcards in it or end with a splat. A named wildcard takes the single path segment in its position; a trailing splat takes everything left in the path, which is an empty string when the path ends at the splat's parent — a splat covers that path too.

getTargetVariableExpandedUrl(url, redirectDefinition, isVariable)

Given a redirect definition and an incoming URL, calculate what the final outgoing URL is to be. Wildcards in the target are filled from the matching source wildcards; a source splat can be written in the target either as * or as :splat.

isVariable overrides which source path segments count as wildcards. It receives whether the segment is the last one in the source, which is what distinguishes a trailing splat from a literal *; a callback that ignores it cannot match splats. The default accepts both.

mergeQueryStrings(qs1, qs2)

processUrl(url)

Breaks a url into the separate parts for processing

RedirectFileConverter({ client, redirectEntryObject, wildcardConverter, writeFile, }, input)

Interfaces

Interface

Description

pathTrieReturn

Type Aliases

Type Alias

Description

DirectionAwareRedirectDefinition

ProcessedUrl

Breaks a url into the separate parts for processing

RedirectClientGetRedirect

RedirectClientGetRedirects

RedirectClientGetRequest

RedirectClientOptions

RedirectDataCache

RedirectDefinition

RedirectDefinitions

RedirectDeleteRequest

RedirectDeleteResponse

RedirectFileConverterParams

RedirectGetRequest

RedirectGetResponse

RedirectOptions

RedirectResult

RedirectUpsertRequest

RedirectUpsertResponse

SourceAndTarget

SourceTargetAndWildcards

Wildcard