Methods
getAllParams(url, optionsopt) → {object}
Retourne tous les paramètres sous forme d'objet
Parameters:
Name | Type | Attributes | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
url |
string | absolue ou relative |
|||||||||||
options |
object |
<optional> |
Properties
|
- Source:
Returns:
- Type
- object
getMyUrl(context) → {string}
Retourne l'url absolue de la requête courante
Parameters:
Name | Type | Description |
---|---|---|
context |
Contexte |
- Source:
Returns:
- Type
- string
getParam(url, name, optionsopt) → {string|Array.<string>|undefined}
Retourne un paramètre d'une url
Parameters:
Name | Type | Attributes | Description | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|
url |
string | ||||||||||||
name |
string | ||||||||||||
options |
object |
<optional> |
Properties
|
- Source:
Returns:
Si une seule valeur retourne une string, sinon un Array
- Type
- string | Array.<string> | undefined
join(parts) → {string}
Réuni les morceaux d'une url
Parameters:
Name | Type | Description |
---|---|---|
parts |
urlParts |
- Source:
Returns:
- Type
- string
pageNext(url, optionsopt) → {string}
Incrémente skip (et ajoute limit s'il n'y était pas) dans la queryString
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
url |
||||||||||||||||||
options |
Object |
<optional> |
Properties
|
- Source:
Returns:
L'url de la page suivante
- Type
- string
pageNextFromContext(context)
Retourne l'url courante avec limit et skip incrémenté
Parameters:
Name | Type | Description |
---|---|---|
context |
Context |
- Source:
pagePrevious(url, optionsopt) → {string}
Décrémente skip (et ajoute limit s'il n'y était pas) dans la queryString
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
url |
||||||||||||||||||
options |
Object |
<optional> |
Properties
|
- Source:
Returns:
L'url de la page précédente (peut être la même si on avait déjà skip = 0)
- Type
- string
pagePreviousFromContext(context)
Retourne l'url courante avec limit et skip décrémenté
Parameters:
Name | Type | Description |
---|---|---|
context |
Context |
- Source:
split(url) → {urlParts}
Découpe l'url en 3 morceaux
Parameters:
Name | Type | Description |
---|---|---|
url |
string |
- Source:
Returns:
- Type
- urlParts
update(url, args, optionsopt) → {string}
Retourne url modifiée pour lui ajouter / mettre à jour des arguments en queryString
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
url |
string | |||||||||||||||||
args |
object | |||||||||||||||||
options |
object |
<optional> |
Properties
|
- Source:
Returns:
- Type
- string
Type Definitions
urlParts
3 morceaux d'une url
Type:
- Array.<string>
Properties:
Name | Type | Description |
---|---|---|
urlParts[0 |
string | base (absolue ou relative) |
urlParts[1 |
string | queryString |
urlParts[2 |
string | anchor |
- Source: