mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Variables: Support raw values of boolean type (#34727)
This commit is contained in:
parent
ac9cbbc02b
commit
4137534650
@ -169,6 +169,7 @@ describe('ensureStringValues', () => {
|
||||
${[1, 2]} | ${['1', '2']}
|
||||
${'1'} | ${'1'}
|
||||
${['1', '2']} | ${['1', '2']}
|
||||
${true} | ${'true'}
|
||||
`('when called with value:$value then result should be:$expected', ({ value, expected }) => {
|
||||
expect(ensureStringValues(value)).toEqual(expected);
|
||||
});
|
||||
|
@ -239,5 +239,9 @@ export function ensureStringValues(value: any | any[]): string | string[] {
|
||||
return value;
|
||||
}
|
||||
|
||||
if (typeof value === 'boolean') {
|
||||
return value.toString();
|
||||
}
|
||||
|
||||
return '';
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user