This commit is contained in:
Mauro I. Dominguez 2026-05-24 11:54:12 +08:00 committed by GitHub
commit c2b1ac5685
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with 16 additions and 1 deletions

View File

@ -117,7 +117,22 @@
if (match) { if (match) {
// We have to decode the URL since want the cleartext value // We have to decode the URL since want the cleartext value
return decodeURIComponent(match[1]); const value = decodeURIComponent(match[1]);
if (value.toLowerCase() === 'false' || value === '0') {
return false;
}
if (value.toLowerCase() === 'true' || value === '1') {
return true;
}
// Check for integer
if (/^-?\d+$/.test(value)) {
return parseInt(value, 10);
}
// Check for float
if (/^-?\d*\.\d+$/.test(value)) {
return parseFloat(value);
}
return value;
} }
return defaultValue; return defaultValue;