new LanguageHeader()
A parsed language header.
Delivers a more direct access to the individual elements of the header it represents
- Source:
Methods
country() → {string}
Returns the country as reported by the HTTP client.
- Source:
Returns:
variant
- Type
- string
isMatchedBy(matchTry) → {boolean}
Test if this header is matched by matchTry header
Parameters:
Name | Type | Description |
---|---|---|
matchTry |
ParsedHeaderValue | The header to be matched from |
- Source:
Returns:
true if this header represents a subset of matchTry, otherwise, false
- Type
- boolean
isPermitted() → {boolean}
Is this an allowed operation as specified by the corresponding header?
- Source:
Returns:
- Type
- boolean
language() → {string}
Returns the language as reported by the HTTP client.
- Source:
Returns:
language
- Type
- string
parameter(key) → {string}
The value of the parameter specified by this key. Each is one of 3 things:
- null <- That key was not specified
- ParsedHeaderValue.EMPTY (tested using ==) <- The value was not specified
- [Other] <- The value of the parameter
q
parameter is never present.
Parameters:
Name | Type | Description |
---|---|---|
key |
string |
- Source:
Returns:
- Type
- string
parameters() → {Array.<string>}
The parameters specified in this header value.
Note: The
q
parameter is never present.
- Source:
Returns:
Unmodifiable Map of parameters of this header value
- Type
- Array.<string>
rawValue() → {string}
Contains the raw value that was received from the user agent
- Source:
Returns:
- Type
- string
subtag(level) → {string}
A subtag of this language header.
+ info: rfc7231#section-3.1.3.1
+ info: rfc7231#section-3.1.3.1
Parameters:
Name | Type | Description |
---|---|---|
level |
number |
- Source:
Returns:
The language subtag at specified position
- Type
- string
subtagCount() → {number}
- Source:
Returns:
the number of subtags this value has
- Type
- number
tag() → {string}
The tag of the language as specified by
rfc7231#section-3.1.3.1.
Equivalent to
Equivalent to
- Source:
Returns:
The language tag
- Type
- string
value() → {string}
Holds the unparsed value of the header.
For the most part, this is the content before the semi-colon (";")
For the most part, this is the content before the semi-colon (";")
- Source:
Returns:
- Type
- string
variant() → {string}
Returns the variant as reported by the HTTP client.
- Source:
Returns:
variant
- Type
- string
weight() → {number}
Holds the weight specified in the "q" parameter of the header.
If the parameter is not specified, 1.0 is assumed according to rfc7231
If the parameter is not specified, 1.0 is assumed according to rfc7231
- Source:
Returns:
- Type
- number
weightedOrder() → {number}
An integer that represents the absolute order position of this header
- Source:
Returns:
- Type
- number