uri

Methods

(static) checkEncoding(raw, legalRange, doThrow) → {error}

Validates if string contains legalRange + valid pchars PCHAR. PCHARS represent valid UTF-8 sequence

Source:
Parameters:
Name Type Description
raw UriObj
legalRange string regex expression
doThrow string
Returns:
NULL if ok, Error if failed
Type
error

(static) decodeSegments(encodedPath) → {array}

Spliting path by "/". Main reason is to eliminate unambiquity of "/a%2f%b/c" and "/a/b/c".

Source:
Parameters:
Name Type Description
encodedPath string
Returns:
Path split to DECODED segments as array
Type
array

(static) decomposeComponents(uriStr) → {UriObj}

uri string to be decomposed

Source:
Parameters:
Name Type Description
uriStr string
Returns:
Type
UriObj

(static) encodeSegments(segments) → {string}

Joining path segments by "/". Main reason is to eliminate unambiquity of "/a%2f%b/c" and "/a/b/c".

Source:
Parameters:
Name Type Description
segments array array of segments not encoded
Returns:
path-abempty, ENCODED path, only characters specified in RFC3986_SEGMENT are encoded if [] specified "" is returned
Type
string

(static) isSubordinate(uriParent, uriSub, orSame) → {boolean}

Check if path is subordinate

Source:
Parameters:
Name Type Description
uriParent UriObj
uriSub UriObj
orSame boolean
Returns:
Type
boolean

(static) parseQuery(query, bDecode) → {any}

Striktna varianta rozoznavajuca empty a undefined query.

Source:
Parameters:
Name Type Description
query string Ak undefined alebo null vracia null. Ak "" vracia {}, inak vracia {p1:v1,ps:[]}, ocakavane bez delimitera (?,#) teda z naseho API
bDecode Uri Default false, ci dekodovat mena a values
Returns:
Type
any

(static) percentEncode(str, legalRange) → {string}

this will encode every character of string with hexadecimal ASCII code

Source:
Parameters:
Name Type Description
str string
legalRange string regex pattern
Returns:
Type
string

(static) recomposeAuthorityComponents(userInfo, host, port) → {string}

recomposing authority from userInfo, host and port

Source:
Parameters:
Name Type Description
userInfo string
host string
port string
Returns:
Type
string

(static) recomposeComponents(object) → {string}

this will recompose uri as string from each component

Source:
See:
  • 5.3. Component Recomposition . . . . . . . . . . . . . . . . 35 Remarks: defined(x) is coded with !=null (means undefined and null are handled the same way) ignores "authority sub components"
Parameters:
Name Type Description
object UriObj
Returns:
Type
string

(static) removeDotSegments(path) → {string}

this will remove dot segments in path

Source:
Parameters:
Name Type Description
path string
Returns:
Type
string

(static) resolve(base, ref) → {UriObj}

TODO

Source:
Parameters:
Name Type Description
base UriObj
ref UriObj
Returns:
Type
UriObj

Type Definitions

UriObj

Source:
Properties:
Name Type Description
scheme string
host string
port string
userInfo string
authority string
path string
query string
fragment string
Type:
  • object