Variables: Support raw values of boolean type (#34727)

This commit is contained in:
Simon Podlipsky 2021-06-02 06:40:37 +02:00 committed by GitHub
parent ac9cbbc02b
commit 4137534650
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 0 deletions

View File

@ -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);
});

View File

@ -239,5 +239,9 @@ export function ensureStringValues(value: any | any[]): string | string[] {
return value;
}
if (typeof value === 'boolean') {
return value.toString();
}
return '';
}