mirror of
https://github.com/a-nyx/maputnik-with-pmtiles.git
synced 2025-01-02 21:28:11 +01:00
18 lines
243 B
JavaScript
18 lines
243 B
JavaScript
|
function asBool(queryObj, key) {
|
||
|
if(queryObj.hasOwnProperty(key)) {
|
||
|
if(queryObj[key].match(/^false|0$/)) {
|
||
|
return false;
|
||
|
}
|
||
|
else {
|
||
|
return true;
|
||
|
}
|
||
|
}
|
||
|
else {
|
||
|
return false;
|
||
|
}
|
||
|
}
|
||
|
|
||
|
module.exports = {
|
||
|
asBool
|
||
|
}
|