( value: QueryValue, fallback?: boolean )
| 155 | export function decodeBoolean(value: QueryValue): boolean | undefined; |
| 156 | export function decodeBoolean(value: QueryValue, fallback: boolean): boolean; |
| 157 | export function decodeBoolean( |
| 158 | value: QueryValue, |
| 159 | fallback?: boolean |
| 160 | ): boolean | undefined { |
| 161 | const unwrapped = decodeScalar(value); |
| 162 | |
| 163 | if (unwrapped === 'true') { |
| 164 | return true; |
| 165 | } |
| 166 | |
| 167 | if (unwrapped === 'false') { |
| 168 | return false; |
| 169 | } |
| 170 | |
| 171 | return fallback; |
| 172 | } |
| 173 | |
| 174 | /** |
| 175 | * If a tag conflicts with a reserved keyword, change it to `tags[key]:value` |
no test coverage detected