Index

src/lib/src/location-reference.ts

bindUrl
bindUrl(source: typeReference, target: typeReference)
Parameters :
Name Type Optional Description
source typeReference
target typeReference
isLocationReference
isLocationReference(obj: any)
Parameters :
Name Type Optional Description
obj any

src/lib/src/utils/debug-log.ts

debugLog
debugLog()

src/lib/src/utils/sorted-array.ts

defaultComparer
defaultComparer(a: typeReference, b: typeReference)

Compare values using < and === operators.

Parameters :
Name Type Optional Description
a typeReference

First value to be compared.

b typeReference

Second value to be compared.

src/lib/src/utils/wildcard-to-regex.ts

escapeRegExpPattern
escapeRegExpPattern(s: string)

Converts any string to regular expression, which matches it. Handles special RegExp characters.

Parameters :
Name Type Optional Description
s string

Any string.

wildcardToRegex
wildcardToRegex(wildcard: string)

Converts wildcard pattern with ? and * characters to regular expression.

Usage:

wildcardToRegex('*.js').test('foo.js') == true
    wildcardToRegex('*.js').test('foo.jsx') == false
    wildcardToRegex('image/*').test('image/png') == true
    wildcardToRegex('image/*').test('text/plain') == false
Parameters :
Name Type Optional Description
wildcard string

Wildcard pattern, supports ? and * characters.

src/lib/src/navigable.ts

isNavigable
isNavigable(obj: any)

Safe-cast function for Navigable instances. Returns true if obj is Navigable.

Parameters :
Name Type Optional Description
obj any
makeNavigableRef
makeNavigableRef(value: typeReference)

Creates immutable NavigableRef instance from given value.

Parameters :
Name Type Optional Description
value typeReference
topLevelNavigableRef
topLevelNavigableRef()

src/lib/src/utils/normalize-media-type.ts

normalizeMediaType
normalizeMediaType(mimeType: string)

Normalizes the media type. Removes format suffix (everything after +), and prepends application/ if there is just subtype provided.

Parameters :
Name Type Optional Description
mimeType string

Media type to match.

src/lib/src/utils/parse-url.ts

parseUrl
parseUrl(url: string)

Rough URL parser.

Parameters :
Name Type Optional Description
url string

URL to be parsed. Must be well-formed.

src/lib/src/resource-router-module.ts

provideLocationStrategy
provideLocationStrategy(platformLocationStrategy: typeReference, baseHref: string, options: typeReference)

Internal factory function, exported only for AOT support.

Parameters :
Name Type Optional Description
platformLocationStrategy typeReference
baseHref string
options typeReference

src/lib/src/resource-data.ts

resourceDataNavigableRef
resourceDataNavigableRef()

src/lib/src/quality-evaluator.ts

simpleTypeQualityEvaluator
simpleTypeQualityEvaluator(type: string)

View type evaluator function, that returns:

0 for pure wildcard types (like '') 0.5 for types containing wildcard (like 'aaa/') 1 for types without wildcard characters.

Parameters :
Name Type Optional Description
type string

Type to evaluate.

statusQualityEvaluator
statusQualityEvaluator(status: string)

Response status code pattern quality evaluator.

0 for pure wildcard patterns (like '*' or '???') 1 for exact values (like '204') otherwise its ration of wildcard to number characters. That is '2??' is 0.333, '20?' is 0.666.

This function assumes all status strings has constant length. Otherwise values would be inconsistent.

Parameters :
Name Type Optional Description
status string

Status to evaluate.

results matching ""

    No results matching ""