Skip to content
Snippets Groups Projects
Commit 5951bd3a authored by echicken's avatar echicken :chicken:
Browse files

has_params

parent fdd93709
No related branches found
No related tags found
1 merge request!463MRC mods by Codefenix (2024-10-20)
// Helpers for http_request
var Request = {
// Query parameter p exists and first instance is of optional type t
// Query parameter p exists
has_param: function (p) {
return (Array.isArray(http_request.query[p]) && http_request.query[p].length);
},
// All query parameters in Array[String] p exist
has_params: function (p) {
return p.every(function (e) {
return (Array.isArray(http_request.query[e]) && http_request.query[e].length);
});
},
// First instance of query parameter p, or undefined
get_param: function (p) {
if (Array.isArray(http_request.query[p]) && http_request.query[p].length) {
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment